diff options
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-cmd-parser.c | 12 | ||||
-rw-r--r-- | cli/src/cli-rpc-ops.c | 8 |
2 files changed, 19 insertions, 1 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index adfb85e9e..2ad5d430c 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -2780,7 +2780,7 @@ cli_snap_create_desc_parse (dict_t *dict, const char **words, desc[desc_len] = '\0'; /* Calculating the size of the description as given by the user */ - ret = dict_set_dynstr (dict, "snap-description", desc); + ret = dict_set_dynstr (dict, "description", desc); if (ret) { gf_log ("cli", GF_LOG_ERROR, "Unable to save snap " "description"); @@ -3008,6 +3008,7 @@ cli_snap_info_parse (dict_t *dict, const char **words, int wordcount, unsigned int cmdi) { int ret = -1; + int32_t cmd = GF_SNAP_INFO_TYPE_ALL; GF_ASSERT (words); GF_ASSERT (dict); @@ -3044,6 +3045,7 @@ cli_snap_info_parse (dict_t *dict, const char **words, int wordcount, goto out; } + cmd = GF_SNAP_INFO_TYPE_SNAP; ret = 0; goto out; /* No need to continue the parsing once we @@ -3067,7 +3069,15 @@ cli_snap_info_parse (dict_t *dict, const char **words, int wordcount, "volume name %s", words[wordcount - 1]); goto out; } + cmd = GF_SNAP_INFO_TYPE_VOL; out : + if (ret == 0) { + ret = dict_set_int32 (dict, "cmd", cmd); + if (ret) { + gf_log ("cli", GF_LOG_ERROR, "Could not save " + "type of snapshot info"); + } + } return ret; } diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 0447e5baf..60abfc1bf 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -8147,6 +8147,14 @@ gf_cli_snapshot_cbk (struct rpc_req *req, struct iovec *iov, break; case GF_SNAP_OPTION_TYPE_LIST: + if (rsp.op_ret) { + cli_err ("Snapshot list : failed: %s", + rsp.op_errstr ? rsp.op_errstr : + "Please check log file for details"); + ret = rsp.op_ret; + goto out; + } + ret = cli_snapshot_list (dict); if (ret) { gf_log ("cli", GF_LOG_ERROR, "Failed to display " |