From b3cc22184452824d436903baa62635acee739c50 Mon Sep 17 00:00:00 2001 From: Venkatesh Somyajulu Date: Wed, 19 Jun 2013 17:54:31 +0530 Subject: cli: Fix remove brick cli out for wrong volume name Problem: gluster volume remove-brick command, was not printing the error in case of volume-name specified is wrong. Fix: Fix will print error message to indicate that provided volume name is invalid. Although patch for bug 961669 http://review.gluster.org/#/c/4975/ does print cli-output now, but still xml is unable to use the response values Change-Id: I2ee1df86c1e756fb8e93b4d6bbdd102b4f368f87 BUG: 961307 Signed-off-by: Venkatesh Somyajulu Reviewed-on: http://review.gluster.org/4972 Reviewed-by: Pranith Kumar Karampuri Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- cli/src/cli-rpc-ops.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index d5256f12..5ae4cfbc 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); } -- cgit