summaryrefslogtreecommitdiffstats
path: root/cli/src
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src')
-rw-r--r--cli/src/cli-cmd-parser.c5
-rw-r--r--cli/src/cli-cmd-volume.c7
-rw-r--r--cli/src/cli.h2
3 files changed, 9 insertions, 5 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 7c03ae228fd..a334fd931bf 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -1441,7 +1441,7 @@ out:
int32_t
cli_cmd_volume_add_brick_parse (const char **words, int wordcount,
- dict_t **options)
+ dict_t **options, int *ret_type)
{
dict_t *dict = NULL;
char *volname = NULL;
@@ -1559,6 +1559,9 @@ parse_bricks:
*options = dict;
out:
+ if (ret_type)
+ *ret_type = type;
+
if (ret) {
gf_log ("cli", GF_LOG_ERROR, "Unable to parse add-brick CLI");
if (dict)
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 5436c76bcc2..9c61c3f541f 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -787,7 +787,7 @@ cli_cmd_volume_add_brick_cbk (struct cli_state *state,
if (!frame)
goto out;
- ret = cli_cmd_volume_add_brick_parse (words, wordcount, &options);
+ ret = cli_cmd_volume_add_brick_parse (words, wordcount, &options, 0);
if (ret) {
cli_usage_out (word->pattern);
parse_error = 1;
@@ -847,12 +847,13 @@ cli_cmd_volume_attach_tier_cbk (struct cli_state *state,
int parse_error = 0;
gf_answer_t answer = GF_ANSWER_NO;
cli_local_t *local = NULL;
+ int type = 0;
frame = create_frame (THIS, THIS->ctx->pool);
if (!frame)
goto out;
- ret = cli_cmd_volume_add_brick_parse (words, wordcount, &options);
+ ret = cli_cmd_volume_add_brick_parse (words, wordcount, &options, &type);
if (ret) {
cli_usage_out (word->pattern);
parse_error = 1;
@@ -872,7 +873,7 @@ cli_cmd_volume_attach_tier_cbk (struct cli_state *state,
if (ret)
goto out;
- ret = dict_set_int32 (options, "type", GF_CLUSTER_TYPE_TIER);
+ ret = dict_set_int32 (options, "type", type);
if (ret)
goto out;
diff --git a/cli/src/cli.h b/cli/src/cli.h
index ed2bc4aba8a..60bbcb9f620 100644
--- a/cli/src/cli.h
+++ b/cli/src/cli.h
@@ -249,7 +249,7 @@ cli_cmd_ganesha_parse (struct cli_state *state, const char **words,
int32_t
cli_cmd_volume_add_brick_parse (const char **words, int wordcount,
- dict_t **options);
+ dict_t **options, int *type);
int32_t
cli_cmd_volume_remove_brick_parse (const char **words, int wordcount,