diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2016-01-21 14:48:34 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2016-03-08 23:25:52 -0800 |
commit | 3122e47e70494fd224f764f86fae29eca16ac06b (patch) | |
tree | 1228868389053ee6ef42d23ae280feb9a89d84cd /xlators/mgmt/glusterd/src/glusterd-handler.c | |
parent | d1272ef0fdc9897fa388665e039b9f713109ef0c (diff) |
glusterd: volume get should pick options from priv->opts too
Backport of http://review.gluster.org/13272
As of now volume get was not looking for all the global options maintained in
option dictionary in glusterd_conf_t. This patch includes the same.
Change-Id: Ib05259a2dcacc4a712cae4217fe4a6553b61da56
BUG: 1315939
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/13272
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Gaurav Kumar Garg <ggarg@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-on: http://review.gluster.org/13651
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 86d1d5f23fb..fd01f0205ab 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -4777,17 +4777,43 @@ glusterd_get_volume_opts (rpcsvc_request_t *req, dict_t *dict) goto out; } } else { - ret = glusterd_get_default_val_for_volopt + sprintf (dict_key, "key%d", count); + ret = dict_set_str(dict, dict_key, key); + if (ret) { + gf_msg (this->name, GF_LOG_ERROR, 0, + GD_MSG_DICT_SET_FAILED, "Failed" + " to set %s in dictionary", + key); + goto out; + } + sprintf (dict_key, "value%d", count); + ret = dict_get_str (priv->opts, key, &value); + if (!ret) { + ret = dict_set_str(dict, dict_key, + value); + if (ret) { + gf_msg (this->name, + GF_LOG_ERROR, 0, + GD_MSG_DICT_SET_FAILED, + "Failed to set %s in " + " dictionary", key); + goto out; + } + } else { + ret = glusterd_get_default_val_for_volopt (dict, _gf_false, key, orig_key, volinfo->dict, &rsp.op_errstr); - if (ret && !rsp.op_errstr) { - snprintf (err_str, sizeof(err_str), - "Failed to fetch the value of" - " %s, check log file for more" - " details", key); + if (ret && !rsp.op_errstr) { + snprintf (err_str, + sizeof(err_str), + "Failed to fetch the " + "value of %s, check " + "log file for more" + " details", key); + } } } } |