diff options
author | Venkatesh Somyajulu <vsomyaju@redhat.com> | 2013-05-17 11:00:29 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2013-06-05 05:28:17 -0700 |
commit | 68a97ece53ec1da205a4da6da5d9d7f8b58b3f5e (patch) | |
tree | 47e10205b32f9b2991e1be3097d8da7a2bad8d0c /cli | |
parent | 7413ed951f9b5615dc63f94a8e702cb8f6a8bd98 (diff) |
cli: Remove unused port info from peer status.
Problem: "gluster peer status" on some nodes gives port info and fails to give
on other. But it is a hard coded value.
Fix: Removing the port info from command
Change-Id: I919f0349f252e658bfc13e60bb8e171da32eaf25
BUG: 964026
Signed-off-by: Venkatesh Somyajulu <vsomyaju@redhat.com>
Reviewed-on: http://review.gluster.org/5027
Reviewed-by: Kaushal M <kaushal@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 17 | ||||
-rw-r--r-- | cli/src/cli-xml-output.c | 13 |
2 files changed, 2 insertions, 28 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index d2c934a4305..a9f53bfde5c 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -303,7 +303,6 @@ gf_cli_output_peer_status (dict_t *dict, int count) int32_t i = 1; char key[256] = {0,}; char *state = NULL; - int32_t port = 0; int32_t connected = 0; char *connected_str = NULL; @@ -329,26 +328,14 @@ gf_cli_output_peer_status (dict_t *dict, int count) else connected_str = "Disconnected"; - snprintf (key, 256, "friend%d.port", i); - ret = dict_get_int32 (dict, key, &port); - if (ret) - goto out; snprintf (key, 256, "friend%d.state", i); ret = dict_get_str (dict, key, &state); if (ret) goto out; - if (!port) { - cli_out ("\nHostname: %s\nUuid: %s\nState: %s " - "(%s)", - hostname_buf, uuid_buf, state, - connected_str); - } else { - cli_out ("\nHostname: %s\nPort: %d\nUuid: %s\n" - "State: %s (%s)", hostname_buf, port, - uuid_buf, state, connected_str); - } + cli_out ("\nHostname: %s\nUuid: %s\nState: %s (%s)", + hostname_buf, uuid_buf, state, connected_str); i++; } diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c index 168159b68d0..a2bd2b141e4 100644 --- a/cli/src/cli-xml-output.c +++ b/cli/src/cli-xml-output.c @@ -2737,7 +2737,6 @@ cli_xml_output_peer_status (dict_t *dict, int op_ret, int op_errno, int connected = 0; int state_id = 0; char *state_str = NULL; - int port = 0; int i = 1; char key[1024] = {0,}; @@ -2820,18 +2819,6 @@ cli_xml_output_peer_status (dict_t *dict, int op_ret, int op_errno, XML_RET_CHECK_AND_GOTO (ret, out); } - memset (key, 0, sizeof (key)); - snprintf (key, sizeof (key), "friend%d.port", i); - ret = dict_get_int32 (dict, key, &port); - if (!ret) { - /* ignore */ - ret = xmlTextWriterWriteFormatElement - (writer, (xmlChar *)"port", "%d", port); - XML_RET_CHECK_AND_GOTO (ret, out); - - port = 0; - } - /* </peer> */ ret = xmlTextWriterEndElement (writer); XML_RET_CHECK_AND_GOTO (ret, out); |