summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2013-10-09 22:13:34 +0530
committershishir gowda <sgowda@redhat.com>2013-11-15 12:37:58 +0530
commit8c89a5ffc9d1a9aa6a52a915cdd988c40aececb7 (patch)
treea5629248a8c8f78637370920c26445310c283fe3 /cli
parent99a7b58a2983788a3bb36662d2b83c2da3b6472c (diff)
glusterd/locks: Adding multiple volume locks supports
Also linking snap create command to mgmt_v3 Change-Id: If2ed29be072e10d0b0bd271d53e48eeaa6501ed7 Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 3d8ec5d..87d2997 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -2899,29 +2899,19 @@ cli_snap_create_parse (dict_t *dict, const char **words, int wordcount,
goto out;
}
- /* Only one volume is present. volname
- * should be set and not volname%d. */
- if (volcount == 1) {
- ret = dict_set_str (dict, "volname", (char *)words[2]);
+ /* Saving the volume names */
+ for (i = 2; i < volcount + 2; i++) {
+ ret = snprintf (volname_buf, sizeof(volname_buf) - 1,
+ "volname%d", i - 1);
+ volname_buf[ret] = '\0';
+
+ ret = dict_set_str (dict, volname_buf,
+ (char *)words[i]);
if (ret) {
- gf_log ("", GF_LOG_ERROR, "Unable to save volname");
+ gf_log ("", GF_LOG_ERROR, "Unable to save %s",
+ volname_buf);
goto out;
}
- } else {
- /* Saving the volume names */
- for (i = 2; i < volcount + 2; i++) {
- ret = snprintf (volname_buf, sizeof(volname_buf) - 1,
- "volname%d", i - 1);
- volname_buf[ret] = '\0';
-
- ret = dict_set_str (dict, volname_buf,
- (char *)words[i]);
- if (ret) {
- gf_log ("", GF_LOG_ERROR, "Unable to save %s",
- volname_buf);
- goto out;
- }
- }
}
/* Saving the volcount */