From c6b8143b9f61f59326563dd5274f9d1849577cef Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Wed, 27 Feb 2013 16:55:09 +0530 Subject: cli : Display error messages if virt file has been deleted or is invalid. "gluster volume set group virt" will display error message if virt file is deleted or is invalid. Change-Id: Icb202b6a445597fcd9a3dcef8001891f2601a115 BUG: 916127 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/4586 Reviewed-by: Amar Tumballi Tested-by: Gluster Build System Reviewed-by: Anand Avati --- cli/src/cli-cmd-volume.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cli/src/cli-cmd-volume.c') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 97a47c2c..8d508158 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -897,6 +897,7 @@ cli_cmd_volume_set_cbk (struct cli_state *state, struct cli_cmd_word *word, call_frame_t *frame = NULL; dict_t *options = NULL; cli_local_t *local = NULL; + char *op_errstr = NULL; proc = &cli_rpc_prog->proctable[GLUSTER_CLI_SET_VOLUME]; @@ -904,9 +905,14 @@ cli_cmd_volume_set_cbk (struct cli_state *state, struct cli_cmd_word *word, if (!frame) goto out; - ret = cli_cmd_volume_set_parse (words, wordcount, &options); + ret = cli_cmd_volume_set_parse (words, wordcount, &options, &op_errstr); if (ret) { - cli_usage_out (word->pattern); + if (op_errstr) { + cli_err ("%s", op_errstr); + GF_FREE (op_errstr); + } else + cli_usage_out (word->pattern); + parse_error = 1; goto out; } -- cgit