summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2019-04-23 12:41:32 +0530
committerAmar Tumballi <amarts@redhat.com>2019-05-11 11:09:06 +0000
commitaf4d9131c8d09907853ee2f6e30b2a9bd80f3c84 (patch)
tree87a3adb186c0b116574ee37aedc59942a92a60a5 /cli/src/cli-cmd-volume.c
parentb4db967224db3b16bc1d749fc2cb6f795363362d (diff)
cli: Validate invalid slave url
This patch validates the invalid slave url in cli itself and throws appropriate error. fixes: bz#1098991 Change-Id: I278e2a04a4d619d2c2d1db0dd56ab5bdf7e7f469 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index e711608ed80..ab2f18bd679 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -2138,6 +2138,7 @@ cli_cmd_volume_gsync_set_cbk(struct cli_state *state, struct cli_cmd_word *word,
rpc_clnt_procedure_t *proc = NULL;
call_frame_t *frame = NULL;
cli_local_t *local = NULL;
+ char *errstr = NULL;
#if (USE_EVENTS)
int ret1 = -1;
int cmd_type = -1;
@@ -2155,9 +2156,14 @@ cli_cmd_volume_gsync_set_cbk(struct cli_state *state, struct cli_cmd_word *word,
goto out;
}
- ret = cli_cmd_gsync_set_parse(words, wordcount, &options);
+ ret = cli_cmd_gsync_set_parse(words, wordcount, &options, &errstr);
if (ret) {
- cli_usage_out(word->pattern);
+ if (errstr) {
+ cli_err("%s", errstr);
+ GF_FREE(errstr);
+ } else {
+ cli_usage_out(word->pattern);
+ }
parse_err = 1;
goto out;
}