summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-03-24 20:44:07 +0000
committerJeff Darcy <jdarcy@redhat.com>2014-03-24 20:44:07 +0000
commitefbb23837761bda6c526baca1b5ea72d227e2ae3 (patch)
tree728199c73595103d7561dd9d441bdbe1845c6331 /cli
parenta58b023443b7a2ec089c45bf35bde2b0108aa19b (diff)
parent17454dfea9f3c4d47fcf0b5370a6155f639c8aeb (diff)
Merge branch 'upstream'
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c5
-rw-r--r--cli/src/cli-cmd-volume.c18
-rw-r--r--cli/src/cli-rpc-ops.c14
3 files changed, 26 insertions, 11 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 7a2ff026d..1513e0c5e 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -1605,7 +1605,10 @@ cli_cmd_log_rotate_parse (const char **words, int wordcount, dict_t **options)
if (!dict)
goto out;
- volname = (char *)words[3];
+ if (strcmp ("rotate", words[3]) == 0)
+ volname = (char *)words[2];
+ else if (strcmp ("rotate", words[2]) == 0)
+ volname = (char *)words[3];
GF_ASSERT (volname);
ret = dict_set_str (dict, "volname", volname);
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index fc3b7229a..e334ddc84 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -992,7 +992,7 @@ cli_cmd_volume_add_brick_cbk (struct cli_state *state,
}
/* TODO: there are challenges in supporting changing of
- stripe-count, untill it is properly supported give warning to user */
+ stripe-count, until it is properly supported give warning to user */
if (dict_get (options, "stripe-count")) {
answer = cli_cmd_get_confirmation (state, question);
@@ -1450,7 +1450,7 @@ cli_cmd_quota_cbk (struct cli_state *state, struct cli_cmd_word *word,
goto out;
}
- //create auxillary mount need for quota commands that operate on path
+ //create auxiliary mount need for quota commands that operate on path
ret = cli_stage_quota_op (volname, type);
if (ret)
goto out;
@@ -1691,6 +1691,13 @@ cli_cmd_log_rotate_cbk (struct cli_state *state, struct cli_cmd_word *word,
goto out;
}
+ if (!((strcmp ("rotate", words[2]) == 0) ||
+ (strcmp ("rotate", words[3]) == 0))) {
+ cli_usage_out (word->pattern);
+ parse_error = 1;
+ goto out;
+ }
+
proc = &cli_rpc_prog->proctable[GLUSTER_CLI_LOG_ROTATE];
frame = create_frame (THIS, THIS->ctx->pool);
@@ -2316,10 +2323,15 @@ struct cli_cmd volume_cmds[] = {
cli_cmd_volume_help_cbk,
"display help for the volume command"},
- { "volume log rotate <VOLNAME> [BRICK]",
+ { "volume log <VOLNAME> rotate [BRICK]",
cli_cmd_log_rotate_cbk,
"rotate the log file for corresponding volume/brick"},
+ { "volume log rotate <VOLNAME> [BRICK]",
+ cli_cmd_log_rotate_cbk,
+ "rotate the log file for corresponding volume/brick"
+ " NOTE: This is an old syntax, will be deprecated from next release."},
+
{ "volume sync <HOSTNAME> [all|<VOLNAME>]",
cli_cmd_sync_volume_cbk,
"sync the volume information from a peer"},
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index bef70357a..239a29ba8 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -1686,7 +1686,7 @@ gf_cli_set_volume_cbk (struct rpc_req *req, struct iovec *iov,
ret = dict_unserialize (rsp.dict.dict_val, rsp.dict.dict_len, &dict);
/* For brick processes graph change does not happen on the fly.
- * The proces has to be restarted. So this is a check from the
+ * The process has to be restarted. So this is a check from the
* volume set option such that if debug xlators such as trace/errorgen
* are provided in the set command, warn the user.
*/
@@ -4201,7 +4201,7 @@ write_contents_to_common_pem_file (dict_t *dict, int output_count)
char common_pem_file[PATH_MAX] = "";
char *output = NULL;
char output_name[PATH_MAX] = "";
- int bytes_writen = 0;
+ int bytes_written = 0;
int fd = -1;
int ret = -1;
int i = -1;
@@ -4239,16 +4239,16 @@ write_contents_to_common_pem_file (dict_t *dict, int output_count)
cli_out ("Unable to fetch output.");
}
if (output) {
- bytes_writen = write (fd, output, strlen(output));
- if (bytes_writen != strlen(output)) {
+ bytes_written = write (fd, output, strlen(output));
+ if (bytes_written != strlen(output)) {
gf_log ("", GF_LOG_ERROR, "Failed to write "
"to %s", common_pem_file);
ret = -1;
goto out;
}
/* Adding the new line character */
- bytes_writen = write (fd, "\n", strlen("\n"));
- if (bytes_writen != strlen("\n")) {
+ bytes_written = write (fd, "\n", strlen("\n"));
+ if (bytes_written != strlen("\n")) {
gf_log ("", GF_LOG_ERROR,
"Failed to add new line char");
ret = -1;
@@ -6621,7 +6621,7 @@ gf_cli_status_cbk (struct rpc_req *req, struct iovec *iov,
if (ret)
continue;
- /* Brick/not-brick is handled seperately here as all
+ /* Brick/not-brick is handled separately here as all
* types of nodes are contained in the default output
*/
memset (status.brick, 0, PATH_MAX + 255);