diff options
author | Mohammed Junaid Ahmed <junaid@gluster.com> | 2011-02-14 01:01:19 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-02-14 14:02:36 -0800 |
commit | d6f065b350a72a34b9a435a89d9b7cb59081bb44 (patch) | |
tree | 35e9a3512aed17b6bfce22e9d770b931b6dbe358 /cli/src | |
parent | 0cc73c92734acc86cb559fc2d3b3ee8c834e5f63 (diff) |
syncdaemon: config-get-all option add to gsync cli.
Signed-off-by: Mohammed Junaid <junaid@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1570 (geosync related changes)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1570
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli3_1-cops.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cli/src/cli3_1-cops.c b/cli/src/cli3_1-cops.c index 612b04724..9aa4c2fb5 100644 --- a/cli/src/cli3_1-cops.c +++ b/cli/src/cli3_1-cops.c @@ -2397,6 +2397,39 @@ out: } 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; |