summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-handler.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 3ebe5f51f42..247c655b031 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -1669,8 +1669,14 @@ glusterd_handle_gsync_set (rpcsvc_request_t *req)
char *slave = NULL;
char operation[256] = {0,};
int type = 0;
+ glusterd_conf_t *priv = NULL;
+ char *host_uuid = NULL;
GF_ASSERT (req);
+ GF_ASSERT (THIS);
+ GF_ASSERT (THIS->private);
+
+ priv = THIS->private;
ret = glusterd_op_set_cli_op (cli_op);
if (ret) {
@@ -1701,20 +1707,32 @@ glusterd_handle_gsync_set (rpcsvc_request_t *req)
} else {
dict->extra_stdfree = cli_req.dict.dict_val;
}
+
+ host_uuid = gf_strdup (uuid_utoa(priv->uuid));
+ if (host_uuid == NULL) {
+ gf_log ("glusterd", GF_LOG_ERROR, "failed to get"
+ "the uuid of the host machine");
+ ret = -1;
+ goto out;
+ }
+ ret = dict_set_dynstr (dict, "host-uuid", host_uuid);
+ if (ret)
+ goto out;
+
}
ret = dict_get_str (dict, "master", &master);
if (ret < 0) {
- gf_log ("", GF_LOG_WARNING, "master not found, while handling"
+ gf_log ("", GF_LOG_INFO, "master not found, while handling"
"gsync options");
- goto out;
+ master = "(No Master)";
}
ret = dict_get_str (dict, "slave", &slave);
if (ret < 0) {
- gf_log ("", GF_LOG_WARNING, "slave not not found, while"
+ gf_log ("", GF_LOG_INFO, "slave not not found, while"
"handling gsync options");
- goto out;
+ slave = "(No Slave)";
}
ret = dict_get_int32 (dict, "type", &type);
@@ -1737,6 +1755,10 @@ glusterd_handle_gsync_set (rpcsvc_request_t *req)
case GF_GSYNC_OPTION_TYPE_CONFIGURE:
strncpy (operation, "configure", sizeof (operation));
break;
+
+ case GF_GSYNC_OPTION_TYPE_STATUS:
+ strncpy (operation, "status", sizeof (operation));
+ break;
}
gf_cmd_log ("volume gsync", " %s command on %s,%s", operation, master,