summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorRajesh Joseph <rjoseph@redhat.com>2014-06-20 18:04:33 +0530
committerKrishnan Parthasarathi <kparthas@redhat.com>2014-06-23 03:36:54 -0700
commitbeeb30a4b777c5bbd6ebfd8f2074b99f30122e08 (patch)
treeeb385d2dd3291c17b36f0d896cc2ee9552adbb7d /cli
parent8d92734f289ab55910045ba7b92bbef1d0dd123c (diff)
glusterd/snapshot: cli error message corrected
snapshot delete on failure used to give invalid error message. Change-Id: I65d6edf8004c9a1bb91f28fa987b2d1629134013 BUG: 1111603 Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-on: http://review.gluster.org/8137 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 26b6152..c4846be 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -7648,16 +7648,17 @@ cli_snapshot_remove_reply (gf_cli_rsp *rsp, dict_t *dict)
GF_ASSERT (rsp);
GF_ASSERT (dict);
- ret = dict_get_str (dict, "snapname", &snap_name);
- if (ret) {
- gf_log ("cli", GF_LOG_ERROR, "Failed to get snapname");
+ if (rsp->op_ret) {
+ cli_err ("snapshot delete: failed: %s",
+ rsp->op_errstr ? rsp->op_errstr :
+ "Please check log file for details");
+ ret = rsp->op_ret;
goto out;
}
- if (rsp->op_ret) {
- cli_err("snapshot delete: failed: snap %s "
- "might not be in an usable state.", snap_name);
- ret = rsp->op_ret;
+ ret = dict_get_str (dict, "snapname", &snap_name);
+ if (ret) {
+ gf_log ("cli", GF_LOG_ERROR, "Failed to get snapname");
goto out;
}