diff options
author | Pranith K <pranithk@gluster.com> | 2010-09-28 02:47:08 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-28 04:50:21 -0700 |
commit | 65a84c9d0d691ac4f7a5f33374140e50746a96af (patch) | |
tree | 3ae88729a1f8789d0df531331132180d3faed6c2 /cli/src/cli3_1-cops.c | |
parent | dbbec1261eae8440726b001df8fe4c06837d6f3d (diff) |
mgmt/glusterd: prevent detach of peer with its bricks existing in cluster
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1681 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1681
Diffstat (limited to 'cli/src/cli3_1-cops.c')
-rw-r--r-- | cli/src/cli3_1-cops.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/cli/src/cli3_1-cops.c b/cli/src/cli3_1-cops.c index d92da29138e..0984a793694 100644 --- a/cli/src/cli3_1-cops.c +++ b/cli/src/cli3_1-cops.c @@ -155,7 +155,31 @@ gf_cli3_1_deprobe_cbk (struct rpc_req *req, struct iovec *iov, } gf_log ("cli", GF_LOG_NORMAL, "Received resp to deprobe"); - cli_out ("Detach %s", (rsp.op_ret) ? "unsuccessful": "successful"); + if (rsp.op_ret) { + switch (rsp.op_errno) { + case GF_DEPROBE_LOCALHOST: + cli_out ("%s is localhost", + rsp.hostname); + break; + case GF_DEPROBE_NOT_FRIEND: + cli_out ("%s is not part of cluster", + rsp.hostname); + break; + case GF_DEPROBE_BRICK_EXIST: + cli_out ("Brick(s) with the peer %s exist in " + "cluster", rsp.hostname); + break; + default: + cli_out ("Detach returned with unknown errno %d", + rsp.op_errno); + break; + } + cli_out ("Detach unsuccessful"); + gf_log ("glusterd",GF_LOG_ERROR,"Detach failed with op_ret %d" + " and op_errno %d", rsp.op_ret, rsp.op_errno); + } else { + cli_out ("Detach successful"); + } ret = rsp.op_ret; |