diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/Makefile.am | 2 | ||||
-rw-r--r-- | cli/src/cli-cmd-peer.c (renamed from cli/src/cli-cmd-probe.c) | 30 |
2 files changed, 16 insertions, 16 deletions
diff --git a/cli/src/Makefile.am b/cli/src/Makefile.am index 93372235e08..e8cabfb8c8b 100644 --- a/cli/src/Makefile.am +++ b/cli/src/Makefile.am @@ -1,7 +1,7 @@ sbin_PROGRAMS = gluster gluster_SOURCES = cli.c registry.c input.c cli-cmd.c cli-rl.c \ - cli-cmd-volume.c cli-cmd-probe.c cli3_1-cops.c cli-cmd-parser.c\ + cli-cmd-volume.c cli-cmd-peer.c cli3_1-cops.c cli-cmd-parser.c\ cli-cmd-misc.c cli-cmd-log.c gluster_LDADD = $(top_builddir)/libglusterfs/src/libglusterfs.la $(GF_LDADD)\ diff --git a/cli/src/cli-cmd-probe.c b/cli/src/cli-cmd-peer.c index 7d1c6eee7da..2959444fe81 100644 --- a/cli/src/cli-cmd-probe.c +++ b/cli/src/cli-cmd-peer.c @@ -56,7 +56,7 @@ cli_cmd_peer_status_usage () } int -cli_cmd_probe_cbk (struct cli_state *state, struct cli_cmd_word *word, +cli_cmd_peer_probe_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount) { int ret = -1; @@ -64,7 +64,7 @@ cli_cmd_probe_cbk (struct cli_state *state, struct cli_cmd_word *word, call_frame_t *frame = NULL; dict_t *dict = NULL; - if (!((wordcount == 3) || (wordcount == 2))) { + if (!((wordcount == 4) || (wordcount == 3))) { cli_cmd_probe_usage (); goto out; } @@ -79,12 +79,12 @@ cli_cmd_probe_cbk (struct cli_state *state, struct cli_cmd_word *word, if (!dict) goto out; - ret = dict_set_str (dict, "hostname", (char *)words[1]); + ret = dict_set_str (dict, "hostname", (char *)words[2]); if (ret) goto out; - if (words[2]) { - ret = dict_set_str (dict, "port", (char *)words[2]); + if (words[3]) { + ret = dict_set_str (dict, "port", (char *)words[3]); if (ret) goto out; } @@ -101,15 +101,15 @@ out: int -cli_cmd_deprobe_cbk (struct cli_state *state, struct cli_cmd_word *word, - const char **words, int wordcount) +cli_cmd_peer_deprobe_cbk (struct cli_state *state, struct cli_cmd_word *word, + const char **words, int wordcount) { int ret = -1; rpc_clnt_procedure_t *proc = NULL; call_frame_t *frame = NULL; dict_t *dict = NULL; - if (!((wordcount == 2) || (wordcount == 3))) { + if (!((wordcount == 3) || (wordcount == 4))) { cli_cmd_deprobe_usage (); goto out; } @@ -122,12 +122,12 @@ cli_cmd_deprobe_cbk (struct cli_state *state, struct cli_cmd_word *word, dict = dict_new (); - ret = dict_set_str (dict, "hostname", (char *)words[1]); + ret = dict_set_str (dict, "hostname", (char *)words[2]); if (ret) goto out; - if (words[2]) { - ret = dict_set_str (dict, "port", (char *)words[2]); + if (words[3]) { + ret = dict_set_str (dict, "port", (char *)words[3]); if (ret) goto out; } @@ -173,11 +173,11 @@ out: } struct cli_cmd cli_probe_cmds[] = { - { "probe <HOSTNAME> [PORT]", - cli_cmd_probe_cbk }, + { "peer probe <HOSTNAME> [PORT]", + cli_cmd_peer_probe_cbk }, - { "detach <HOSTNAME>", - cli_cmd_deprobe_cbk }, + { "peer detach <HOSTNAME>", + cli_cmd_peer_deprobe_cbk }, { "peer status", cli_cmd_peer_status_cbk}, |