From 00bcf8e80bd65de7a8a102b137d35af3ba2cc3c1 Mon Sep 17 00:00:00 2001 From: Sachin Pandit Date: Thu, 26 Jun 2014 07:51:02 +0530 Subject: cli/snapshot : Dont display the snapshot hard-limit, soft-limit and auto-delete value in gluster volume info. 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: 1113476 Signed-off-by: Sachin Pandit Reviewed-on: http://review.gluster.org/8191 Tested-by: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Avra Sengupta Reviewed-by: Raghavendra Bhat Reviewed-by: Kaushal M --- cli/src/cli-cmd-parser.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'cli/src/cli-cmd-parser.c') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 4a00b8485d3..85a916e380c 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -3919,25 +3919,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; -- cgit