2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-10-07 13:36:21 +00:00

added option to validate 'partial' data against a definition

added some more dummy specfile entries
creates two simple functions for making and reading answer messages
bindctl will parse command 'config set' values natively (i.e. for "config set my_item 3" the 3 is now read as an integer instead of a string)
added config diff option that shows a dict of the current uncommited changes


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/jelte-configuration@823 e5f2f494-b856-4b98-b285-d166d9295462
This commit is contained in:
Jelte Jansen
2010-02-15 13:30:39 +00:00
parent b302cfa381
commit bc69156fbd
11 changed files with 194 additions and 75 deletions

View File

@@ -31,6 +31,7 @@ import os, time, random, re
import getpass
from hashlib import sha1
import csv
import ast
try:
from collections import OrderedDict
@@ -445,13 +446,21 @@ class BindCmdInterpreter(Cmd):
elif cmd.command == "remove":
self.config_data.remove_value(identifier, cmd.params['value'])
elif cmd.command == "set":
self.config_data.set_value(identifier, cmd.params['value'])
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":
self.config_data.revert()
elif cmd.command == "commit":
self.config_data.commit()
elif cmd.command == "diff":
print(self.config_data.get_local_changes());
elif cmd.command == "go":
self.go(identifier)
except isc.cc.data.DataTypeError as dte: