2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-10-19 14:36:24 +00:00

update for showing of list contents

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac384@3962 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
Jelte Jansen
2010-12-22 14:38:47 +00:00
parent 7099d4df87
commit ff385d569e
4 changed files with 92 additions and 74 deletions

View File

@@ -552,13 +552,30 @@ class BindCmdInterpreter(Cmd):
return
if cmd.command == "show":
values = self.config_data.get_value_maps(identifier)
# check if we have the 'all' argument
show_all = False
if 'argument' in cmd.params:
if cmd.params['argument'] == 'all':
show_all = True
elif 'identifier' not in cmd.params:
# no 'all', no identifier, assume this is the
#identifier
identifier += cmd.params['argument']
else:
print("Error: unknown argument " + cmd.params['argument'] + ", or multiple identifiers given")
return
values = self.config_data.get_value_maps(identifier, show_all)
for value_map in values:
line = value_map['name']
if value_map['type'] in [ 'module', 'map', 'list' ]:
if value_map['type'] in [ 'module', 'map' ]:
line += "/"
elif len(value_map) > 1 and value_map['type'] == 'list' \
and (value_map['value'] != []):
# do not print content of non-empty lists if
# we have more data to show
line += "/"
else:
line += ":\t" + json.dumps(value_map['value'])
line += "\t" + json.dumps(value_map['value'])
line += "\t" + value_map['type']
line += "\t"
if value_map['default']: