summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-parser.c
diff options
context:
space:
mode:
authorSachin Pandit <spandit@redhat.com>2014-03-14 07:23:18 +0530
committerRajesh Joseph <rjoseph@redhat.com>2014-03-14 02:35:16 -0700
commitbc8a9a21f8e3184b2138be3ca10280dfde3ce153 (patch)
tree4e3da16321a1787a8e36a1179b8bd1005f09101d /cli/src/cli-cmd-parser.c
parent69827bac7215f269a2d29b4b9f9bd86092517d55 (diff)
cli/snapshot : Fix for snapshot create fail.
Change-Id: Ib3c239eadbcfc787f4f7d0734839c8425e93020a BUG: 1076356 Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7275 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r--cli/src/cli-cmd-parser.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 15675c884..8e914fa87 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -3468,6 +3468,13 @@ cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
* parsing fails & snapname cannot be "description",
* "force" and "volume", that check is made here
*/
+ if (wordcount == 2){
+ ret = -1;
+ gf_log ("cli", GF_LOG_ERROR,
+ "Invalid Syntax");
+ goto out;
+ }
+
ret = validate_snapname (words[2], invalid_snapnames);
if (ret) {
goto out;
@@ -3476,7 +3483,7 @@ cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
ret = cli_snap_create_parse (dict, words,
wordcount, cmdi);
if (ret) {
- gf_log ("", GF_LOG_ERROR,
+ gf_log ("cli", GF_LOG_ERROR,
"create command parsing failed.");
goto out;
}
@@ -3485,7 +3492,7 @@ cli_cmd_snapshot_parse (const char **words, int wordcount, dict_t **options,
case GF_SNAP_OPTION_TYPE_INFO:
{
/* Syntax :
- * gluster snapshot info ([snapname] | [vol <volname>])
+ * gluster snapshot info [(snapname] | [vol <volname>)]
*/
ret = cli_snap_info_parse (dict, words, wordcount,
cmdi);