summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2018-10-26 17:51:38 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2018-11-26 08:36:13 +0000
commitfc9889d0373c323aab0d93f8ca31d2d8151bd041 (patch)
treedba250cf1a43b737f41c6f009040446e9fcd16f4 /cli/src/cli-cmd-volume.c
parentb346c84ad5f090c3d99dc1cb80f24ca10747a085 (diff)
glfsheal: add a '--nolog' flag
....and if set, change the log level to GF_LOG_NONE. This is useful for monitoring applications which invoke the heal info set of commands once every minute, leading to un-necessary glfsheal* logs in /var/log/glusterfs/. For example, we can now run `gluster volume heal <VOLNAME> info --nolog` `gluster volume heal <VOLNAME> info split-brain --nolog` etc. The default log level is still retained at GF_LOG_INFO. The patch also changes glfsheal internally to accept '--xml' instead of 'xml'. Note: The --nolog flag is *not* displayed in the help anywhere, for the sake of consistency in how the other flags are not displayed anywhere in the help. fixes: bz#1643519 Change-Id: Ia08b6aa6e4a0548379db7e313dd4411ebc66f206 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 4b5af6bd707..a7723be86b8 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -2844,7 +2844,7 @@ cli_launch_glfs_heal(int heal_op, dict_t *options)
switch (heal_op) {
case GF_SHD_OP_INDEX_SUMMARY:
if (global_state->mode & GLUSTER_MODE_XML) {
- runner_add_args(&runner, "xml", NULL);
+ runner_add_args(&runner, "--xml", NULL);
}
break;
case GF_SHD_OP_SBRAIN_HEAL_FROM_BIGGER_FILE:
@@ -2866,7 +2866,7 @@ cli_launch_glfs_heal(int heal_op, dict_t *options)
case GF_SHD_OP_SPLIT_BRAIN_FILES:
runner_add_args(&runner, "split-brain-info", NULL);
if (global_state->mode & GLUSTER_MODE_XML) {
- runner_add_args(&runner, "xml", NULL);
+ runner_add_args(&runner, "--xml", NULL);
}
break;
case GF_SHD_OP_GRANULAR_ENTRY_HEAL_ENABLE:
@@ -2876,13 +2876,15 @@ cli_launch_glfs_heal(int heal_op, dict_t *options)
case GF_SHD_OP_HEAL_SUMMARY:
runner_add_args(&runner, "info-summary", NULL);
if (global_state->mode & GLUSTER_MODE_XML) {
- runner_add_args(&runner, "xml", NULL);
+ runner_add_args(&runner, "--xml", NULL);
}
break;
default:
ret = -1;
goto out;
}
+ if (global_state->mode & GLUSTER_MODE_GLFSHEAL_NOLOG)
+ runner_add_args(&runner, "--nolog", NULL);
ret = runner_start(&runner);
if (ret == -1)
goto out;