summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cli/src/cli-rpc-ops.c9
-rw-r--r--tests/bugs/bug-961307.t32
2 files changed, 35 insertions, 6 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index d5256f128c7..5ae4cfbc83f 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -1976,9 +1976,6 @@ gf_cli_remove_brick_cbk (struct rpc_req *req, struct iovec *iov,
if (ret) {
gf_log ("cli", GF_LOG_ERROR,
"remove-brick-id is not present in dict");
- cli_err ("volume remove-brick %s: failed: %s", cmd_str,
- rsp.op_errstr);
- goto out;
}
break;
case GF_OP_CMD_COMMIT:
@@ -2003,7 +2000,7 @@ gf_cli_remove_brick_cbk (struct rpc_req *req, struct iovec *iov,
if (global_state->mode & GLUSTER_MODE_XML) {
ret = cli_xml_output_vol_remove_brick (_gf_false, rsp_dict,
rsp.op_ret, rsp.op_errno,
- rsp.op_errstr);
+ msg);
if (ret)
gf_log ("cli", GF_LOG_ERROR,
"Error outputting to xml");
@@ -2012,10 +2009,10 @@ gf_cli_remove_brick_cbk (struct rpc_req *req, struct iovec *iov,
if (rsp.op_ret) {
cli_err ("volume remove-brick %s: failed: %s", cmd_str,
- rsp.op_errstr);
+ msg);
} else {
cli_out ("volume remove-brick %s: success", cmd_str);
- if (GF_OP_CMD_START == cmd)
+ if (GF_OP_CMD_START == cmd && task_id_str != NULL)
cli_out ("ID: %s", task_id_str);
}
diff --git a/tests/bugs/bug-961307.t b/tests/bugs/bug-961307.t
new file mode 100644
index 00000000000..96e93a56f8d
--- /dev/null
+++ b/tests/bugs/bug-961307.t
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+. $(dirname $0)/../volume.rc
+
+cleanup;
+
+REPLICA=2
+
+TEST glusterd
+TEST pidof glusterd
+
+TEST $CLI volume create $V0 replica $REPLICA $H0:$B0/${V0}-00 $H0:$B0/${V0}-01 $H0:$B0/${V0}-10 $H0:$B0/${V0}-11
+TEST $CLI volume start $V0
+
+var1=$(gluster volume remove-brick $H0:$B0/${V0}-00 $H0:$B0/${V0}-01 start 2>&1)
+var2="volume remove-brick start: failed: Volume $H0:$B0/${V0}-00 does not exist"
+
+
+function compare_string()
+{
+ val="-1"
+ if [ "$1" == "$2" ]; then
+ val="0"
+ else
+ val="1"
+ fi
+ echo $val
+}
+
+EXPECT 0 compare_string "$var1" "$var2"
+cleanup;