diff options
author | JulesWang <w.jq0722@gmail.com> | 2012-12-21 14:32:35 +0800 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2012-12-26 23:40:43 -0800 |
commit | b94999ba8566bbf91cb9b402d2376f1ac9e36242 (patch) | |
tree | 4d107a0bdadc85f8dd41c45cde9f0c029d312dbe | |
parent | b7fd110d42c658e56e8af234a81a7664bbf83ba4 (diff) |
glusterd: "volume status" for remote brick fails on cli.
cli fails because key "brick-index-max" is missing in rsp dict.
Change-Id: I38119bbd31b68fe3ad1152af2495dff7624d99b7
BUG: 888752
Signed-off-by: JulesWang <w.jq0722@gmail.com>
Reviewed-on: http://review.gluster.org/4347
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 4d2d5f8ab85..846deed643a 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -6568,6 +6568,7 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict) int32_t node_count = 0; int32_t rsp_node_count = 0; int32_t brick_index_max = -1; + int32_t rsp_brick_index_max = -1; int32_t other_count = 0; int32_t rsp_other_count = 0; dict_t *ctx_dict = NULL; @@ -6581,6 +6582,14 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict) goto out; } + ret = dict_get_int32 (rsp_dict, "brick-index-max", + &rsp_brick_index_max); + if (ret) { + gf_log (THIS->name, GF_LOG_ERROR, + "Failed to get brick index max from rsp_dict"); + goto out; + } + ret = dict_get_int32 (rsp_dict, "other-count", &rsp_other_count); if (ret) { gf_log (THIS->name, GF_LOG_ERROR, @@ -6600,6 +6609,17 @@ glusterd_volume_status_copy_to_op_ctx_dict (dict_t *aggr, dict_t *rsp_dict) ret = dict_get_int32 (ctx_dict, "count", &node_count); ret = dict_get_int32 (ctx_dict, "brick-index-max", &brick_index_max); + if (ret) { + //This happens when flag GF_CLI_STATUS_BRICK is on + brick_index_max = rsp_brick_index_max; + ret = dict_set_int32 (ctx_dict, "brick-index-max", + rsp_brick_index_max); + if (ret) { + gf_log (THIS->name, GF_LOG_ERROR, + "Failed to update brick index max"); + goto out; + } + } ret = dict_get_int32 (ctx_dict, "other-count", &other_count); rsp_ctx.count = node_count; |