From d6f065b350a72a34b9a435a89d9b7cb59081bb44 Mon Sep 17 00:00:00 2001 From: Mohammed Junaid Ahmed Date: Mon, 14 Feb 2011 01:01:19 +0000 Subject: syncdaemon: config-get-all option add to gsync cli. Signed-off-by: Mohammed Junaid Signed-off-by: Anand V. Avati BUG: 1570 (geosync related changes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1570 --- cli/src/cli3_1-cops.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'cli') diff --git a/cli/src/cli3_1-cops.c b/cli/src/cli3_1-cops.c index 612b04724b0..9aa4c2fb505 100644 --- a/cli/src/cli3_1-cops.c +++ b/cli/src/cli3_1-cops.c @@ -2396,6 +2396,39 @@ out: return ret; } +int +gsync_get_command (gf1_cli_gsync_set_rsp rsp) +{ + char cmd[1024] = {0,}; + + if (rsp.op_ret < 0) + return 0; + + if (!rsp.gsync_prefix || !rsp.master || !rsp.slave) + return -1; + + if (rsp.type == GF_GSYNC_OPTION_TYPE_CONFIG_GET) { + if (!rsp.op_name) + return -1; + + snprintf (cmd, 1024, "%s/gsyncd.py %s %s --config-get %s ", + rsp.gsync_prefix, rsp.master, rsp.slave, + rsp.op_name); + system (cmd); + goto out; + } + if (rsp.type == GF_GSYNC_OPTION_TYPE_CONFIG_GET_ALL) { + snprintf (cmd, 1024, "%s/gsyncd.py %s %s --config-get-all ", + rsp.gsync_prefix, rsp.master, rsp.slave); + + system (cmd); + + goto out; + } +out: + return 0; +} + int gf_cli3_1_gsync_set_cbk (struct rpc_req *req, struct iovec *iov, int count, void *myframe) @@ -2422,6 +2455,7 @@ gf_cli3_1_gsync_set_cbk (struct rpc_req *req, struct iovec *iov, else cli_out ("command executed successfully"); + gsync_get_command (rsp); out: ret = rsp.op_ret; -- cgit