From 68a97ece53ec1da205a4da6da5d9d7f8b58b3f5e Mon Sep 17 00:00:00 2001 From: Venkatesh Somyajulu Date: Fri, 17 May 2013 11:00:29 +0530 Subject: 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 Reviewed-on: http://review.gluster.org/5027 Reviewed-by: Kaushal M Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- cli/src/cli-rpc-ops.c | 17 ++--------------- cli/src/cli-xml-output.c | 13 ------------- 2 files changed, 2 insertions(+), 28 deletions(-) (limited to 'cli/src') diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index d2c934a43..a9f53bfde 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 168159b68..a2bd2b141 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; - } - /* */ ret = xmlTextWriterEndElement (writer); XML_RET_CHECK_AND_GOTO (ret, out); -- cgit