2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Add support to show settings detail in nodeconfig

settings have lots of text, provide access through '-d' argument
This commit is contained in:
Jarrod Johnson 2018-02-06 16:52:13 -05:00
parent 8ef90a457a
commit 024d37d633
2 changed files with 16 additions and 0 deletions

View File

@ -47,6 +47,10 @@ argparser.add_option('-c', '--comparedefault', dest='comparedefault',
action='store_true', default=False,
help='Compare given settings to default or list settings '
'that are non default')
argparser.add_option('-d', '--detail', dest='detail',
action='store_true', default=False,
help='Provide verbose information as available, such as '
'help text and possible valid values')
(options, args) = argparser.parse_args()
cfgpaths = {

View File

@ -376,6 +376,18 @@ def print_attrib_path(path, session, requestargs, options, rename=None):
node, printattr, currattr['value'],
currattr['default']))
else:
try:
details = options.detail
except AttributeError:
details = False
if details:
if currattr.get('help', None):
attrtout += ' (Help: {0})'.format(
currattr['help'].encode('utf-8'))
if currattr.get('possible', None):
attrout += ' (Choices: {0})'.format(
','.join(currattr['possible']))
cprint(attrout)
if not exitcode:
if requestargs: