summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-08-14 05:10:49 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-15 11:28:45 -0700
commitc87c868f40f4c2f46892afebf9557cf3003dabe4 (patch)
tree56e840a4a94c46eb55550f0d307364ace86eff0c /cli
parent2b8545f1a21efe5e9944bccdebdff49e22fb6e6b (diff)
'gluster peer *' enhancement
now 'gluster probe' will be 'gluster peer probe' and 'gluster detach' will be 'gluster peer detach'. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1291 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1291
Diffstat (limited to 'cli')
-rw-r--r--cli/src/Makefile.am2
-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},