summaryrefslogtreecommitdiffstats
path: root/tools/glusterfind/src/utils.py
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2020-07-07 21:49:50 +0300
committerMOHIT AGRAWAL <moagrawa@redhat.com>2020-07-10 05:15:16 +0000
commitf3df1a5d6e44f70c51a3cdbb4873c1c5a2fd0771 (patch)
tree5a7eb8f00221c0bef6b32aa8d3b099182ea783d2 /tools/glusterfind/src/utils.py
parent906154bf2e5a65c438cb09fd318ca5f2f301b738 (diff)
[RFC]glusterd-utils.c: display which options have changed
Display which options were not changed from the default. The user may have opted to change some global or volume options from the default they were initially. Display '(DEFAULT)' if the values used are those that were not explicitly set by the user. Example output: Option Value ------ ----- cluster.server-quorum-ratio 50 cluster.enable-shared-storage disable (DEFAULT) cluster.op-version 80000 cluster.max-op-version 90000 cluster.brick-multiplex disable (DEFAULT) cluster.max-bricks-per-process 250 (DEFAULT) glusterd.vol_count_per_thread 100 (DEFAULT) cluster.localtime-logging disable (DEFAULT) cluster.daemon-log-level INFO (DEFAULT) Since glusterfind uses the value, it is now filtering the value and only picking the 1st word (which is the value itself) and ignores the rest, which may now be '(DEFAULT)'. Fixes: #1357 Change-Id: I7c59055158d099a5de38943f2169fd02c77f5d09 Signed-off-by: Yaniv Kaul <ykaul@redhat.com>
Diffstat (limited to 'tools/glusterfind/src/utils.py')
-rw-r--r--tools/glusterfind/src/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/glusterfind/src/utils.py b/tools/glusterfind/src/utils.py
index cc099031ef8..906ebd8f252 100644
--- a/tools/glusterfind/src/utils.py
+++ b/tools/glusterfind/src/utils.py
@@ -230,7 +230,11 @@ def get_changelog_rollover_time(volumename):
try:
tree = etree.fromstring(out)
- return int(tree.find('volGetopts/Opt/Value').text)
+ val = tree.find('volGetopts/Opt/Value').text
+ if val is not None:
+ # Filter the value by split, as it may be 'X (DEFAULT)'
+ # and we only need 'X'
+ return int(val.split(' ', 1)[0])
except ParseError:
return DEFAULT_CHANGELOG_INTERVAL