2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-10-11 13:56:46 +00:00

type checking on client side

implemented sample print_settings command


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/jelte-configuration@831 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
Jelte Jansen
2010-02-16 09:50:03 +00:00
parent ae08d2a7bb
commit 7ccf5c90c2
5 changed files with 50 additions and 51 deletions

View File

@@ -446,13 +446,16 @@ class BindCmdInterpreter(Cmd):
elif cmd.command == "remove":
self.config_data.remove_value(identifier, cmd.params['value'])
elif cmd.command == "set":
parsed_value = None
try:
parsed_value = ast.literal_eval(cmd.params['value'])
except Exception as exc:
# ok could be an unquoted string, interpret as such
parsed_value = cmd.params['value']
self.config_data.set_value(identifier, parsed_value)
if 'identifier' not in cmd.params:
print("Error: missing identifier or value")
else:
parsed_value = None
try:
parsed_value = ast.literal_eval(cmd.params['value'])
except Exception as exc:
# ok could be an unquoted string, interpret as such
parsed_value = cmd.params['value']
self.config_data.set_value(identifier, parsed_value)
elif cmd.command == "unset":
self.config_data.unset(identifier)
elif cmd.command == "revert":