summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2015-01-07 21:56:58 +0530
committerVijay Bellur <vbellur@redhat.com>2015-02-02 12:19:07 -0800
commit52765ad94f233e4b4e57515e49f5b7c9e7c08b43 (patch)
treebadad9a91e6a45e54205d3bc7941c305bf903c5a /cli
parent63f17d66258bca46532fe649bbb76a5e5948f22b (diff)
geo-rep: Adding Slave user field to georep status
New column introduced in Status output, "SLAVE USER", Slave user is not "root" in non root Geo-replication setup. Added additional tag in XML output <slave_user> BUG: 1180459 Change-Id: Ia48a5a8eb892ce883b9ec114be7bb2d46eff8535 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/9409 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c32
-rw-r--r--cli/src/cli-xml-output.c13
2 files changed, 24 insertions, 21 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index c26e1bbbd8d..bd133d0ba82 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -4027,18 +4027,19 @@ get_struct_variable (int mem_num, gf_gsync_status_t *sts_val)
case 0: return (sts_val->node);
case 1: return (sts_val->master);
case 2: return (sts_val->brick);
- case 3: return (sts_val->slave_node);
- case 4: return (sts_val->worker_status);
- case 5: return (sts_val->checkpoint_status);
- case 6: return (sts_val->crawl_status);
- case 7: return (sts_val->files_syncd);
- case 8: return (sts_val->files_remaining);
- case 9: return (sts_val->bytes_remaining);
- case 10: return (sts_val->purges_remaining);
- case 11: return (sts_val->total_files_skipped);
- case 12: return (sts_val->brick_host_uuid);
- case 13: return (sts_val->slavekey);
- case 14: return (sts_val->session_slave);
+ case 3: return (sts_val->slave_user);
+ case 4: return (sts_val->slave_node);
+ case 5: return (sts_val->worker_status);
+ case 6: return (sts_val->checkpoint_status);
+ case 7: return (sts_val->crawl_status);
+ case 8: return (sts_val->files_syncd);
+ case 9: return (sts_val->files_remaining);
+ case 10: return (sts_val->bytes_remaining);
+ case 11: return (sts_val->purges_remaining);
+ case 12: return (sts_val->total_files_skipped);
+ case 13: return (sts_val->brick_host_uuid);
+ case 14: return (sts_val->slavekey);
+ case 15: return (sts_val->session_slave);
default:
goto out;
}
@@ -4056,7 +4057,7 @@ gf_cli_print_status (char **title_values,
int i = 0;
int j = 0;
int ret = 0;
- int status_fields = 6; /* Indexed at 0 */
+ int status_fields = 7; /* Indexed at 0 */
int total_spacing = 0;
char **output_values = NULL;
char *tmp = NULL;
@@ -4218,12 +4219,13 @@ gf_cli_gsync_status_output (dict_t *dict, gf_boolean_t is_detail)
int i = 0;
int ret = 0;
int spacing[13] = {0};
- int num_of_fields = 12;
+ int num_of_fields = 13;
char errmsg[1024] = "";
char *master = NULL;
char *slave = NULL;
char *title_values[] = {"MASTER NODE", "MASTER VOL",
- "MASTER BRICK", "SLAVE",
+ "MASTER BRICK", "SLAVE USER",
+ "SLAVE",
"STATUS", "CHECKPOINT STATUS",
"CRAWL STATUS", "FILES SYNCD",
"FILES PENDING", "BYTES PENDING",
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
index dcce53901f4..b4c72eaa84e 100644
--- a/cli/src/cli-xml-output.c
+++ b/cli/src/cli-xml-output.c
@@ -3909,8 +3909,8 @@ cli_xml_output_vol_gsync_status (dict_t *dict,
int i = 1;
int j = 0;
int count = 0;
- const int number_of_fields = 12;
- const int number_of_basic_fields = 7;
+ const int number_of_fields = 13;
+ const int number_of_basic_fields = 8;
int closed = 1;
int session_closed = 1;
gf_gsync_status_t **status_values = NULL;
@@ -3924,6 +3924,7 @@ cli_xml_output_vol_gsync_status (dict_t *dict,
char *title_values[] = {"master_node",
"master_node_uuid",
"master_brick",
+ "slave_user",
"slave",
"status",
"checkpoint_status",
@@ -4006,7 +4007,7 @@ cli_xml_output_vol_gsync_status (dict_t *dict,
session_closed = 0;
- tmp = get_struct_variable (14, status_values[i]);
+ tmp = get_struct_variable (15, status_values[i]);
if (!tmp) {
gf_log ("cli", GF_LOG_ERROR,
"struct member empty.");
@@ -4031,7 +4032,7 @@ cli_xml_output_vol_gsync_status (dict_t *dict,
// Displaying the master_node uuid as second field
if (j == 1)
- tmp = get_struct_variable (12,
+ tmp = get_struct_variable (13,
status_values[i]);
else
tmp = get_struct_variable (j, status_values[i]);
@@ -4052,8 +4053,8 @@ cli_xml_output_vol_gsync_status (dict_t *dict,
XML_RET_CHECK_AND_GOTO (ret, out);
if (i+1 < count) {
- slave = get_struct_variable (13, status_values[i]);
- slave_next = get_struct_variable (13,
+ slave = get_struct_variable (14, status_values[i]);
+ slave_next = get_struct_variable (14,
status_values[i+1]);
volume = get_struct_variable (1, status_values[i]);
volume_next = get_struct_variable (1,