summaryrefslogtreecommitdiffstats
path: root/cli/src
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2013-12-02 11:37:55 +0530
committergluster-ant <bugzilla-bot@gluster.org>2013-12-02 11:37:55 +0530
commitdcef8fa69c8b0aca6cced008dae4264004e1ae2c (patch)
tree7ac7263f2cba0daac768208b876bd61552d12664 /cli/src
parent09f678249e5e27b406415a2b3786befbb1c25588 (diff)
cli: Fail creation of bricks on root partition in script mode
Also added an option 'wignore' to save ourselves the trouble of modifying test scripts in our regression test suite as well as those that are still under review. Change-Id: Id320c03595506e9da187e766991c19640bd000c5 BUG: 1028281 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/6409 Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'cli/src')
-rw-r--r--cli/src/cli-cmd-volume.c6
-rw-r--r--cli/src/cli.c7
-rw-r--r--cli/src/cli.h1
3 files changed, 11 insertions, 3 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index f11fa21db9..f3b1828a0c 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -395,7 +395,7 @@ cli_cmd_volume_create_cbk (struct cli_state *state, struct cli_cmd_word *word,
}
}
- if (state->mode & GLUSTER_MODE_SCRIPT) {
+ if (state->mode & GLUSTER_MODE_WIGNORE) {
ret = dict_set_int32 (options, "force", _gf_true);
if (ret) {
gf_log ("cli", GF_LOG_ERROR, "Failed to set force "
@@ -981,7 +981,7 @@ cli_cmd_volume_add_brick_cbk (struct cli_state *state,
}
}
- if (state->mode & GLUSTER_MODE_SCRIPT) {
+ if (state->mode & GLUSTER_MODE_WIGNORE) {
ret = dict_set_int32 (options, "force", _gf_true);
if (ret) {
gf_log ("cli", GF_LOG_ERROR, "Failed to set force "
@@ -1552,7 +1552,7 @@ cli_cmd_volume_replace_brick_cbk (struct cli_state *state,
goto out;
}
- if (state->mode & GLUSTER_MODE_SCRIPT) {
+ if (state->mode & GLUSTER_MODE_WIGNORE) {
ret = dict_set_int32 (options, "force", _gf_true);
if (ret) {
gf_log ("cli", GF_LOG_ERROR, "Failed to set force"
diff --git a/cli/src/cli.c b/cli/src/cli.c
index 67f1ad2579..a77200c669 100644
--- a/cli/src/cli.c
+++ b/cli/src/cli.c
@@ -326,14 +326,21 @@ cli_opt_parse (char *opt, struct cli_state *state)
return 0;
}
+ if (strcmp (opt, "wignore") == 0) {
+ state->mode |= GLUSTER_MODE_WIGNORE;
+ return 0;
+ }
+
oarg = strtail (opt, "mode=");
if (oarg) {
if (strcmp (oarg, "script") == 0) {
state->mode |= GLUSTER_MODE_SCRIPT;
return 0;
}
+
if (strcmp (oarg, "interactive") == 0)
return 0;
+
return -1;
}
diff --git a/cli/src/cli.h b/cli/src/cli.h
index 1fe8ffff7f..f5db29383c 100644
--- a/cli/src/cli.h
+++ b/cli/src/cli.h
@@ -45,6 +45,7 @@ enum argp_option_keys {
#define GLUSTER_MODE_SCRIPT (1 << 0)
#define GLUSTER_MODE_ERR_FATAL (1 << 1)
#define GLUSTER_MODE_XML (1 << 2)
+#define GLUSTER_MODE_WIGNORE (1 << 3)
#define GLUSTERD_GET_QUOTA_AUX_MOUNT_PATH(abspath, volname, path) \