diff options
author | Sachin Pandit <spandit@redhat.com> | 2014-06-26 07:51:02 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-09-23 02:00:22 -0700 |
commit | b98ed29cf6c1b999a025dff2269118a9198bd987 (patch) | |
tree | ffc1031036bc104b979ae4e24ada47cabec578f2 /cli | |
parent | 794d9fbe00b71aa80e841530f00af9b8f81c8f21 (diff) |
cli/snapshot : gluster volume info should not show the options which are not set explicitly.
Problem : Even though snap-max-hard-limit, snap-max-soft-limit and
auto-delete values were not set explicitly, It was getting showed
in the output of gluster volume info.
Solution : Check if the value is already present in dictionary
(That means, it is set), If value is not present then consider
the default value,
NOTE : This patch doesn't solve the problem where the values
which is set globally are being displayed in gluster volume info
Change-Id: I61445b3d2a12eb68c38a19bea53b9051ad028050
BUG: 1145020
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8191
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Kaushal M <kaushal@redhat.com>
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/8793
Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 23 | ||||
-rw-r--r-- | cli/src/cli-rpc-ops.c | 13 |
2 files changed, 12 insertions, 24 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 84d836e187a..b4dc3fe49bd 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -3917,25 +3917,14 @@ cli_snap_config_parse (const char **words, int wordcount, dict_t *dict, goto out; } - if ((strcmp (words[cmdi], "enable") == 0) || - (strcmp (words[cmdi], "disable") == 0)) { - ret = dict_set_str (dict, "auto-delete", - (char *)words[cmdi]); - if (ret) { - gf_log ("cli", GF_LOG_ERROR, "Failed to set " - "value of auto-delete in request " - "dictionary"); - goto out; - } - auto_delete = 1; - } else { - ret = -1; - cli_err ("Please enter a valid value (enable/disable) " - "for auto-delete"); - gf_log ("cli", GF_LOG_ERROR, "Invalid value for " - "auto-delete"); + ret = dict_set_str (dict, "auto-delete", (char *)words[cmdi]); + if (ret) { + gf_log ("cli", GF_LOG_ERROR, "Failed to set " + "value of auto-delete in request " + "dictionary"); goto out; } + auto_delete = 1; if (++cmdi != wordcount) { ret = -1; diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 6834e28decf..a240f376f7f 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -7811,17 +7811,16 @@ cli_snapshot_config_display (dict_t *dict, gf_cli_rsp *rsp) "& snap-max-soft-limit for system set " "successfully"); } else if (hard_limit) { - cli_out ("snapshot config: %s " - "for snap-max-hard-limit set successfully", + cli_out ("snapshot config: snap-max-hard-limit " + "for %s set successfully", volname); } else if (soft_limit) { - cli_out ("snapshot config: %s " - "for snap-max-soft-limit set successfully", + cli_out ("snapshot config: snap-max-soft-limit " + "for %s set successfully", volname); } else if (auto_delete) { - cli_out ("snapshot config: %s " - "auto-delete successfully %sd", - volname, auto_delete); + cli_out ("snapshot config: auto-delete " + "successfully set"); } break; |