[svn] commit: r833 - in /branches/jelte-configuration/src: bin/auth/ bin/bind10/ bin/cmdctl/ bin/parkinglot/ lib/cc/cpp/ lib/config/cpp/ lib/config/python/isc/config/ lib/config/testdata/
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Feb 16 11:05:05 UTC 2010
Author: jelte
Date: Tue Feb 16 11:05:05 2010
New Revision: 833
Log:
refactoring;
renamed the DataDefinition class to the much more accurate ModuleSpec
also renamed some ambiguously named functions therein
Modified:
branches/jelte-configuration/src/bin/auth/auth.spec
branches/jelte-configuration/src/bin/bind10/bind10.py.in
branches/jelte-configuration/src/bin/bind10/bob.spec
branches/jelte-configuration/src/bin/cmdctl/b10-cmdctl.py.in
branches/jelte-configuration/src/bin/parkinglot/parkinglot.spec
branches/jelte-configuration/src/lib/cc/cpp/parkinglot.spec
branches/jelte-configuration/src/lib/config/cpp/ccsession.cc
branches/jelte-configuration/src/lib/config/cpp/data_def.cc
branches/jelte-configuration/src/lib/config/cpp/data_def_unittests.cc
branches/jelte-configuration/src/lib/config/python/isc/config/ccsession.py
branches/jelte-configuration/src/lib/config/python/isc/config/cfgmgr.py
branches/jelte-configuration/src/lib/config/python/isc/config/cfgmgr_test.py
branches/jelte-configuration/src/lib/config/python/isc/config/config_data.py
branches/jelte-configuration/src/lib/config/python/isc/config/config_data_test.py
branches/jelte-configuration/src/lib/config/python/isc/config/datadefinition.py
branches/jelte-configuration/src/lib/config/python/isc/config/datadefinition_test.py
branches/jelte-configuration/src/lib/config/testdata/spec1.spec
branches/jelte-configuration/src/lib/config/testdata/spec10.spec
branches/jelte-configuration/src/lib/config/testdata/spec11.spec
branches/jelte-configuration/src/lib/config/testdata/spec12.spec
branches/jelte-configuration/src/lib/config/testdata/spec13.spec
branches/jelte-configuration/src/lib/config/testdata/spec14.spec
branches/jelte-configuration/src/lib/config/testdata/spec15.spec
branches/jelte-configuration/src/lib/config/testdata/spec16.spec
branches/jelte-configuration/src/lib/config/testdata/spec17.spec
branches/jelte-configuration/src/lib/config/testdata/spec18.spec
branches/jelte-configuration/src/lib/config/testdata/spec19.spec
branches/jelte-configuration/src/lib/config/testdata/spec2.spec
branches/jelte-configuration/src/lib/config/testdata/spec20.spec
branches/jelte-configuration/src/lib/config/testdata/spec21.spec
branches/jelte-configuration/src/lib/config/testdata/spec22.spec
branches/jelte-configuration/src/lib/config/testdata/spec23.spec
branches/jelte-configuration/src/lib/config/testdata/spec3.spec
branches/jelte-configuration/src/lib/config/testdata/spec4.spec
branches/jelte-configuration/src/lib/config/testdata/spec5.spec
branches/jelte-configuration/src/lib/config/testdata/spec6.spec
branches/jelte-configuration/src/lib/config/testdata/spec7.spec
branches/jelte-configuration/src/lib/config/testdata/spec9.spec
Modified: branches/jelte-configuration/src/bin/auth/auth.spec
==============================================================================
--- branches/jelte-configuration/src/bin/auth/auth.spec (original)
+++ branches/jelte-configuration/src/bin/auth/auth.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Auth",
"config_data": [
{ "item_name": "default_name",
Modified: branches/jelte-configuration/src/bin/bind10/bind10.py.in
==============================================================================
--- branches/jelte-configuration/src/bin/bind10/bind10.py.in (original)
+++ branches/jelte-configuration/src/bin/bind10/bind10.py.in Tue Feb 16 11:05:05 2010
@@ -116,7 +116,7 @@
print("[XX] handling new config:")
print(new_config)
errors = []
- if self.ccs.get_config_data().get_specification().validate(False, new_config, errors):
+ if self.ccs.get_config_spec().get_module_spec().validate(False, new_config, errors):
print("[XX] new config validated")
self.ccs.set_config(new_config)
answer = isc.config.ccsession.create_answer(0)
Modified: branches/jelte-configuration/src/bin/bind10/bob.spec
==============================================================================
--- branches/jelte-configuration/src/bin/bind10/bob.spec (original)
+++ branches/jelte-configuration/src/bin/bind10/bob.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Boss",
"config_data": [
{
Modified: branches/jelte-configuration/src/bin/cmdctl/b10-cmdctl.py.in
==============================================================================
--- branches/jelte-configuration/src/bin/cmdctl/b10-cmdctl.py.in (original)
+++ branches/jelte-configuration/src/bin/cmdctl/b10-cmdctl.py.in Tue Feb 16 11:05:05 2010
@@ -188,7 +188,7 @@
self.config_data = self.get_config_data()
def get_cmd_specification(self):
- return self.send_command('ConfigManager', 'get_commands')
+ return self.send_command('ConfigManager', 'get_commands_spec')
def get_config_data(self):
return self.send_command('ConfigManager', 'get_config')
@@ -198,7 +198,7 @@
self.config_data = self.get_config_data()
def get_data_specification(self):
- return self.send_command('ConfigManager', 'get_data_spec')
+ return self.send_command('ConfigManager', 'get_module_spec')
def handle_recv_msg(self):
# Handle received message, if 'shutdown' is received, return False
Modified: branches/jelte-configuration/src/bin/parkinglot/parkinglot.spec
==============================================================================
--- branches/jelte-configuration/src/bin/parkinglot/parkinglot.spec (original)
+++ branches/jelte-configuration/src/bin/parkinglot/parkinglot.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "ParkingLot",
"config_data": [
{
Modified: branches/jelte-configuration/src/lib/cc/cpp/parkinglot.spec
==============================================================================
--- branches/jelte-configuration/src/lib/cc/cpp/parkinglot.spec (original)
+++ branches/jelte-configuration/src/lib/cc/cpp/parkinglot.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "ParkingLot",
"config_data": [
{
Modified: branches/jelte-configuration/src/lib/config/cpp/ccsession.cc
==============================================================================
--- branches/jelte-configuration/src/lib/config/cpp/ccsession.cc (original)
+++ branches/jelte-configuration/src/lib/config/cpp/ccsession.cc Tue Feb 16 11:05:05 2010
@@ -81,7 +81,7 @@
read_data_definition(spec_file_name);
sleep(1);
- module_name_ = data_definition_.getDefinition()->get("data_specification")->get("module_name")->stringValue();
+ module_name_ = data_definition_.getDefinition()->get("module_spec")->get("module_name")->stringValue();
config_handler_ = config_handler;
command_handler_ = command_handler;
Modified: branches/jelte-configuration/src/lib/config/cpp/data_def.cc
==============================================================================
--- branches/jelte-configuration/src/lib/config/cpp/data_def.cc (original)
+++ branches/jelte-configuration/src/lib/config/cpp/data_def.cc Tue Feb 16 11:05:05 2010
@@ -141,10 +141,10 @@
static void
check_definition(const ElementPtr& def)
{
- if (!def->contains("data_specification")) {
- throw DataDefinitionError("Data specification does not contain data_specification element");
+ if (!def->contains("module_spec")) {
+ throw DataDefinitionError("Data specification does not contain module_spec element");
} else {
- check_data_specification(def->get("data_specification"));
+ check_data_specification(def->get("module_spec"));
}
}
@@ -276,7 +276,7 @@
// form, we should do that in the constructor
bool
DataDefinition::validate(const ElementPtr data) {
- ElementPtr spec = definition->find("data_specification/config_data");
+ ElementPtr spec = definition->find("module_spec/config_data");
return validate_spec_list(spec, data);
}
Modified: branches/jelte-configuration/src/lib/config/cpp/data_def_unittests.cc
==============================================================================
--- branches/jelte-configuration/src/lib/config/cpp/data_def_unittests.cc (original)
+++ branches/jelte-configuration/src/lib/config/cpp/data_def_unittests.cc Tue Feb 16 11:05:05 2010
@@ -47,11 +47,11 @@
// Tests whether we can open specfiles and if we get the
// right parse errors
DataDefinition dd = DataDefinition(specfile("spec1.spec"));
- EXPECT_EQ(dd.getDefinition()->get("data_specification")
+ EXPECT_EQ(dd.getDefinition()->get("module_spec")
->get("module_name")
->stringValue(), "Spec1");
dd = DataDefinition(specfile("spec2.spec"));
- EXPECT_EQ(dd.getDefinition()->get("data_specification")
+ EXPECT_EQ(dd.getDefinition()->get("module_spec")
->get("config_data")->size(), 6);
data_def_error("doesnotexist",
"Error opening ",
@@ -61,7 +61,7 @@
std::ifstream file;
file.open(specfile("spec1.spec").c_str());
dd = DataDefinition(file);
- EXPECT_EQ(dd.getDefinition()->get("data_specification")
+ EXPECT_EQ(dd.getDefinition()->get("module_spec")
->get("module_name")
->stringValue(), "Spec1");
}
@@ -96,7 +96,7 @@
data_def_error("spec7.spec",
"module_name missing in {}");
data_def_error("spec8.spec",
- "Data specification does not contain data_specification element");
+ "Data specification does not contain module_spec element");
data_def_error("spec16.spec",
"config_data is not a list of elements");
data_def_error("spec21.spec",
Modified: branches/jelte-configuration/src/lib/config/python/isc/config/ccsession.py
==============================================================================
--- branches/jelte-configuration/src/lib/config/python/isc/config/ccsession.py (original)
+++ branches/jelte-configuration/src/lib/config/python/isc/config/ccsession.py Tue Feb 16 11:05:05 2010
@@ -80,7 +80,7 @@
config_handler and command_handler are callback functions,
see set_config_handler and set_command_handler for more
information on their signatures."""
- data_definition = isc.config.data_spec_from_file(spec_file_name)
+ data_definition = isc.config.module_spec_from_file(spec_file_name)
self._config_data = isc.config.config_data.ConfigData(data_definition)
self._module_name = data_definition.get_module_name()
@@ -121,9 +121,8 @@
"""Returns the current or non-default configuration"""
return self._config_data.get_full_config()
- def get_config_data(self):
- """Returns the config_data part of the specification"""
- return self._config_data
+ def get_module_spec(self):
+ return self._config_data.get_module_spec()
def close(self):
"""Close the session to the command channel"""
@@ -165,7 +164,7 @@
def __send_spec(self):
"""Sends the data specification to the configuration manager"""
print("[XX] send spec for " + self._module_name + " to ConfigManager")
- self._session.group_sendmsg({ "data_specification": self._config_data.get_specification().get_definition() }, "ConfigManager")
+ self._session.group_sendmsg({ "module_spec": self._config_data.get_module_spec().get_full_spec() }, "ConfigManager")
answer, env = self._session.group_recvmsg(False)
print("[XX] got answer from cfgmgr:")
print(answer)
@@ -176,7 +175,7 @@
answer, env = self._session.group_recvmsg(False)
rcode, value = parse_answer(answer)
if rcode == 0:
- if self._config_data.get_specification().validate(False, value):
+ if self._config_data.get_module_spec().validate(False, value):
self._config_data.set_local_config(value);
if self._config_handler:
self._config_handler(value)
Modified: branches/jelte-configuration/src/lib/config/python/isc/config/cfgmgr.py
==============================================================================
--- branches/jelte-configuration/src/lib/config/python/isc/config/cfgmgr.py (original)
+++ branches/jelte-configuration/src/lib/config/python/isc/config/cfgmgr.py Tue Feb 16 11:05:05 2010
@@ -106,12 +106,12 @@
The ability to specify a custom session is for testing purposes
and should not be needed for normal usage."""
def __init__(self, data_path, session = None):
- # remove these and use self.data_specs
+ # remove these and use self.module_specs
#self.commands = {}
self.data_definitions = {}
self.data_path = data_path
- self.data_specs = {}
+ self.module_specs = {}
self.config = ConfigManagerData(data_path)
if session:
self.cc = session
@@ -125,38 +125,38 @@
"""Notifies the Boss module that the Config Manager is running"""
self.cc.group_sendmsg({"running": "configmanager"}, "Boss")
- def set_data_spec(self, spec):
- #data_def = isc.config.DataDefinition(spec)
- self.data_specs[spec.get_module_name()] = spec
-
- def get_data_spec(self, module_name):
- if module_name in self.data_specs:
- return self.data_specs[module_name]
-
- def get_config_data(self, name = None):
+ def set_module_spec(self, spec):
+ #data_def = isc.config.ModuleSpec(spec)
+ self.module_specs[spec.get_module_name()] = spec
+
+ def get_module_spec(self, module_name):
+ if module_name in self.module_specs:
+ return self.module_specs[module_name]
+
+ def get_config_spec(self, name = None):
"""Returns a dict containing 'module_name': config_data for
all modules. If name is specified, only that module will
be included"""
config_data = {}
if name:
- if name in self.data_specs:
- config_data[name] = self.data_specs[name].get_data
- else:
- for module_name in self.data_specs.keys():
- config_data[module_name] = self.data_specs[module_name].get_config_data()
+ if name in self.module_specs:
+ config_data[name] = self.module_specs[name].get_data
+ else:
+ for module_name in self.module_specs.keys():
+ config_data[module_name] = self.module_specs[module_name].get_config_spec()
return config_data
- def get_commands(self, name = None):
+ def get_commands_spec(self, name = None):
"""Returns a dict containing 'module_name': commands_dict for
all modules. If name is specified, only that module will
be included"""
commands = {}
if name:
- if name in self.data_specs:
- commands[name] = self.data_specs[name].get_commands
- else:
- for module_name in self.data_specs.keys():
- commands[module_name] = self.data_specs[module_name].get_commands()
+ if name in self.module_specs:
+ commands[name] = self.module_specs[name].get_commands_spec
+ else:
+ for module_name in self.module_specs.keys():
+ commands[module_name] = self.module_specs[module_name].get_commands_spec()
return commands
def read_config(self):
@@ -173,19 +173,19 @@
at the path specificied at init()"""
self.config.write_to_file()
- def _handle_get_data_spec(self, cmd):
+ def _handle_get_module_spec(self, cmd):
answer = {}
if len(cmd) > 1:
if type(cmd[1]) == dict:
if 'module_name' in cmd[1] and cmd[1]['module_name'] != '':
module_name = cmd[1]['module_name']
- answer = isc.config.ccsession.create_answer(0, self.get_config_data(module_name))
+ answer = isc.config.ccsession.create_answer(0, self.get_config_spec(module_name))
else:
- answer = isc.config.ccsession.create_answer(1, "Bad module_name in get_data_spec command")
- else:
- answer = isc.config.ccsession.create_answer(1, "Bad get_data_spec command, argument not a dict")
- else:
- answer = isc.config.ccsession.create_answer(0, self.get_config_data())
+ answer = isc.config.ccsession.create_answer(1, "Bad module_name in get_module_spec command")
+ else:
+ answer = isc.config.ccsession.create_answer(1, "Bad get_module_spec command, argument not a dict")
+ else:
+ answer = isc.config.ccsession.create_answer(0, self.get_config_spec())
return answer
def _handle_get_config(self, cmd):
@@ -256,17 +256,17 @@
return answer
- def _handle_data_specification(self, spec):
+ def _handle_module_spec(self, spec):
# todo: validate? (no direct access to spec as
- # todo: use DataDefinition class
+ # todo: use ModuleSpec class
# todo: error checking (like keyerrors)
answer = {}
- self.set_data_spec(spec)
+ self.set_module_spec(spec)
# We should make one general 'spec update for module' that
# passes both specification and commands at once
- self.cc.group_sendmsg({ "specification_update": [ spec.get_module_name(), spec.get_config_data() ] }, "Cmd-Ctrld")
- self.cc.group_sendmsg({ "commands_update": [ spec.get_module_name(), spec.get_commands() ] }, "Cmd-Ctrld")
+ self.cc.group_sendmsg({ "specification_update": [ spec.get_module_name(), spec.get_config_spec() ] }, "Cmd-Ctrld")
+ self.cc.group_sendmsg({ "commands_update": [ spec.get_module_name(), spec.get_commands_spec() ] }, "Cmd-Ctrld")
answer = isc.config.ccsession.create_answer(0)
return answer
@@ -276,10 +276,10 @@
if "command" in msg:
cmd = msg["command"]
try:
- if cmd[0] == "get_commands":
- answer = isc.config.ccsession.create_answer(0, self.get_commands())
- elif cmd[0] == "get_data_spec":
- answer = self._handle_get_data_spec(cmd)
+ if cmd[0] == "get_commands_spec":
+ answer = isc.config.ccsession.create_answer(0, self.get_commands_spec())
+ elif cmd[0] == "get_module_spec":
+ answer = self._handle_get_module_spec(cmd)
elif cmd[0] == "get_config":
answer = self._handle_get_config(cmd)
elif cmd[0] == "set_config":
@@ -293,10 +293,10 @@
except IndexError as ie:
answer = isc.config.ccsession.create_answer(1, "Missing argument in command: " + str(ie))
raise ie
- elif "data_specification" in msg:
+ elif "module_spec" in msg:
try:
- answer = self._handle_data_specification(isc.config.DataDefinition(msg["data_specification"]))
- except isc.config.DataDefinitionError as dde:
+ answer = self._handle_module_spec(isc.config.ModuleSpec(msg["module_spec"]))
+ except isc.config.ModuleSpecError as dde:
answer = isc.config.ccsession.create_answer(1, "Error in data definition: " + str(dde))
elif 'result' in msg:
# this seems wrong, might start pingpong
Modified: branches/jelte-configuration/src/lib/config/python/isc/config/cfgmgr_test.py
==============================================================================
--- branches/jelte-configuration/src/lib/config/python/isc/config/cfgmgr_test.py (original)
+++ branches/jelte-configuration/src/lib/config/python/isc/config/cfgmgr_test.py Tue Feb 16 11:05:05 2010
@@ -109,10 +109,10 @@
self.fake_session = FakeCCSession()
self.cm = ConfigManager(self.data_path, self.fake_session)
self.name = "TestModule"
- self.spec = isc.config.data_spec_from_file(self.data_path + os.sep + "/spec2.spec")
+ self.spec = isc.config.module_spec_from_file(self.data_path + os.sep + "/spec2.spec")
def test_init(self):
- self.assert_(self.cm.data_specs == {})
+ self.assert_(self.cm.module_specs == {})
self.assert_(self.cm.data_path == self.data_path)
self.assert_(self.cm.config != None)
self.assert_(self.fake_session.has_subscription("ConfigManager"))
@@ -134,14 +134,14 @@
self._handle_msg_helper({}, { 'result': [ 1, 'Unknown message format: {}']})
self._handle_msg_helper("", { 'result': [ 1, 'Unknown message format: ']})
self._handle_msg_helper({ "command": [ "badcommand" ] }, { 'result': [ 1, "Unknown command: ['badcommand']"]})
- self._handle_msg_helper({ "command": [ "get_commands" ] }, { 'result': [ 0, {} ]})
- self._handle_msg_helper({ "command": [ "get_data_spec" ] }, { 'result': [ 0, {} ]})
- #self._handle_msg_helper({ "command": [ "get_data_spec", { "module_name": "nosuchmodule" } ] },
+ self._handle_msg_helper({ "command": [ "get_commands_spec" ] }, { 'result': [ 0, {} ]})
+ self._handle_msg_helper({ "command": [ "get_module_spec" ] }, { 'result': [ 0, {} ]})
+ #self._handle_msg_helper({ "command": [ "get_module_spec", { "module_name": "nosuchmodule" } ] },
# {'result': [1, 'No specification for module nosuchmodule']})
- self._handle_msg_helper({ "command": [ "get_data_spec", 1 ] },
- {'result': [1, 'Bad get_data_spec command, argument not a dict']})
- self._handle_msg_helper({ "command": [ "get_data_spec", { } ] },
- {'result': [1, 'Bad module_name in get_data_spec command']})
+ self._handle_msg_helper({ "command": [ "get_module_spec", 1 ] },
+ {'result': [1, 'Bad get_module_spec command, argument not a dict']})
+ self._handle_msg_helper({ "command": [ "get_module_spec", { } ] },
+ {'result': [1, 'Bad module_name in get_module_spec command']})
self._handle_msg_helper({ "command": [ "get_config" ] }, { 'result': [ 0, { 'version': 1} ]})
self._handle_msg_helper({ "command": [ "get_config", { "module_name": "nosuchmodule" } ] },
{'result': [0, {}]})
@@ -174,16 +174,16 @@
self.assertEqual({'config_update': {'test': 124}},
self.fake_session.get_message(self.name, None))
self.assertEqual({'version': 1, 'TestModule': {'test': 124}}, self.cm.config.data)
- self._handle_msg_helper({ "data_specification":
- self.spec.get_definition()
+ self._handle_msg_helper({ "module_spec":
+ self.spec.get_full_spec()
},
{'result': [0]})
- self._handle_msg_helper({ "data_specification":
+ self._handle_msg_helper({ "module_spec":
{ 'foo': 1 }
},
- {'result': [1, 'Error in data definition: no module_name in data_specification']})
- self._handle_msg_helper({ "command": [ "get_data_spec" ] }, { 'result': [ 0, { self.spec.get_module_name(): self.spec.get_config_spec() } ]})
- self._handle_msg_helper({ "command": [ "get_commands" ] }, { 'result': [ 0, { self.spec.get_module_name(): self.spec.get_commands() } ]})
+ {'result': [1, 'Error in data definition: no module_name in module_spec']})
+ self._handle_msg_helper({ "command": [ "get_module_spec" ] }, { 'result': [ 0, { self.spec.get_module_name(): self.spec.get_config_spec() } ]})
+ self._handle_msg_helper({ "command": [ "get_commands_spec" ] }, { 'result': [ 0, { self.spec.get_module_name(): self.spec.get_commands_spec() } ]})
# re-add this once we have new way to propagate spec changes (1 instead of the current 2 messages)
#self.assertEqual(len(self.fake_session.message_queue), 2)
# the name here is actually wrong (and hardcoded), but needed in the current version
Modified: branches/jelte-configuration/src/lib/config/python/isc/config/config_data.py
==============================================================================
--- branches/jelte-configuration/src/lib/config/python/isc/config/config_data.py (original)
+++ branches/jelte-configuration/src/lib/config/python/isc/config/config_data.py Tue Feb 16 11:05:05 2010
@@ -108,9 +108,9 @@
def __init__(self, specification):
"""Initialize a ConfigData instance. If specification is not
- of type DataDefinition, a ConfigDataError is raised."""
- if type(specification) != isc.config.DataDefinition:
- raise ConfigDataError("specification is of type " + str(type(specification)) + ", not DataDefinition")
+ of type ModuleSpec, a ConfigDataError is raised."""
+ if type(specification) != isc.config.ModuleSpec:
+ raise ConfigDataError("specification is of type " + str(type(specification)) + ", not ModuleSpec")
self.specification = specification
self.data = {}
@@ -127,14 +127,13 @@
value = isc.cc.data.find_no_exc(self.data, identifier)
if value:
return value, False
- spec = find_spec(self.specification.get_config_data(), identifier)
+ spec = find_spec(self.specification.get_config_spec(), identifier)
if spec and 'item_default' in spec:
return spec['item_default'], True
return None, False
- def get_specification(self):
- """Returns the datadefinition"""
- print(self.specification)
+ def get_module_spec(self):
+ """Returns the ModuleSpec object associated with this ConfigData"""
return self.specification
def set_local_config(self, data):
@@ -147,10 +146,10 @@
def get_full_config(self):
items = self.get_item_list(None, True)
- result = []
+ result = {}
for item in items:
value, default = self.get_value(item)
- result.append(item + ": " + str(value))
+ result[item] = value
return result
#def get_identifiers(self):
@@ -174,11 +173,11 @@
self._local_changes = {}
def set_specification(self, spec):
- if type(spec) != isc.config.DataDefinition:
+ if type(spec) != isc.config.ModuleSpec:
raise Exception("not a datadef")
self._specifications[spec.get_module_name()] = spec
- def get_specification(self, module):
+ def get_module_spec(self, module):
if module in self._specifications:
return self._specifications[module]
else:
@@ -191,7 +190,7 @@
identifier = identifier[1:]
module, sep, id = identifier.partition("/")
try:
- return find_spec(self._specifications[module].get_config_data(), id)
+ return find_spec(self._specifications[module].get_config_spec(), id)
except isc.cc.data.DataNotFoundError as dnfe:
return None
@@ -223,7 +222,7 @@
identifier = identifier[1:]
module, sep, id = identifier.partition("/")
try:
- spec = find_spec(self._specifications[module].get_config_data(), id)
+ spec = find_spec(self._specifications[module].get_config_spec(), id)
if 'item_default' in spec:
return spec['item_default']
else:
@@ -272,9 +271,9 @@
if identifier[0] == '/':
identifier = identifier[1:]
module, sep, id = identifier.partition('/')
- spec = self.get_specification(module)
+ spec = self.get_module_spec(module)
if spec:
- spec_part = find_spec(spec.get_config_data(), id)
+ spec_part = find_spec(spec.get_config_spec(), id)
print(spec_part)
if type(spec_part) == list:
for item in spec_part:
@@ -370,7 +369,7 @@
if module in commands and commands[module]:
cur_spec['commands'] = commands[module]
- self._data.set_specification(isc.config.DataDefinition(cur_spec))
+ self._data.set_specification(isc.config.ModuleSpec(cur_spec))
def request_current_config(self):
config = self._conn.send_GET('/config_data')
@@ -385,8 +384,8 @@
return self._data.set_value(identifier, value);
def add_value(self, identifier, value_str):
- data_spec = self._data.find_spec_part(identifier)
- if (type(data_spec) != dict or "list_item_spec" not in data_spec):
+ module_spec = self._data.find_spec_part(identifier)
+ if (type(module_spec) != dict or "list_item_spec" not in module_spec):
raise DataTypeError(identifier + " is not a list")
value = isc.cc.data.parse_value_str(value_str)
cur_list, status = self.get_value(identifier)
@@ -397,11 +396,11 @@
self.set_value(identifier, cur_list)
def remove_value(self, identifier, value_str):
- data_spec = find_spec(self.config.specification, identifier)
- if (type(data_spec) != dict or "list_item_spec" not in data_spec):
+ module_spec = find_spec(self.config.specification, identifier)
+ if (type(module_spec) != dict or "list_item_spec" not in module_spec):
raise DataTypeError(identifier + " is not a list")
value = parse_value_str(value_str)
- check_type(data_spec, [value])
+ check_type(module_spec, [value])
cur_list = isc.cc.data.find_no_exc(self.config_changes, identifier)
if not cur_list:
cur_list = isc.cc.data.find_no_exc(self.config.data, identifier)
@@ -434,28 +433,28 @@
def __init__(self, conn):
# the specs dict contains module: configdata elements
# these should all be replaced by the new stuff
- data_spec = self.get_data_specification(conn)
- self.config = data_spec
- self.get_config_data(conn)
+ module_spec = self.get_module_spec(conn)
+ self.config = module_spec
+ self.get_config_spec(conn)
self.config_changes = {}
#
self.config_
- self.specs = self.get_data_specifications(conn)
+ self.specs = self.get_module_specs(conn)
- def get_config_data(self, conn):
+ def get_config_spec(self, conn):
data = conn.send_GET('/config_data')
def send_changes(self, conn):
conn.send_POST('/ConfigManager/set_config', self.config_changes)
# Get latest config data
- self.get_config_data(conn)
+ self.get_config_spec(conn)
self.config_changes = {}
- def get_data_specification(self, conn):
+ def get_module_spec(self, conn):
return conn.send_GET('/config_spec')
- def get_data_specifications(self, conn):
+ def get_module_specs(self, conn):
specs = {}
allspecs = conn.send_GET('/config_spec')
@@ -551,11 +550,11 @@
return result
def add(self, identifier, value_str):
- data_spec = find_spec(self.config.specification, identifier)
- if (type(data_spec) != dict or "list_item_spec" not in data_spec):
+ module_spec = find_spec(self.config.specification, identifier)
+ if (type(module_spec) != dict or "list_item_spec" not in module_spec):
raise DataTypeError(identifier + " is not a list")
value = parse_value_str(value_str)
- check_type(data_spec, [value])
+ check_type(module_spec, [value])
cur_list = isc.cc.data.find_no_exc(self.config_changes, identifier)
if not cur_list:
cur_list = isc.cc.data.find_no_exc(self.config.data, identifier)
@@ -566,11 +565,11 @@
set(self.config_changes, identifier, cur_list)
def remove(self, identifier, value_str):
- data_spec = find_spec(self.config.specification, identifier)
- if (type(data_spec) != dict or "list_item_spec" not in data_spec):
+ module_spec = find_spec(self.config.specification, identifier)
+ if (type(module_spec) != dict or "list_item_spec" not in module_spec):
raise DataTypeError(identifier + " is not a list")
value = parse_value_str(value_str)
- check_type(data_spec, [value])
+ check_type(module_spec, [value])
cur_list = isc.cc.data.find_no_exc(self.config_changes, identifier)
if not cur_list:
cur_list = isc.cc.data.find_no_exc(self.config.data, identifier)
@@ -581,9 +580,9 @@
set(self.config_changes, identifier, cur_list)
def set(self, identifier, value_str):
- data_spec = find_spec(self.config.specification, identifier)
+ module_spec = find_spec(self.config.specification, identifier)
value = parse_value_str(value_str)
- check_type(data_spec, value)
+ check_type(module_spec, value)
set(self.config_changes, identifier, value)
def unset(self, identifier):
Modified: branches/jelte-configuration/src/lib/config/python/isc/config/config_data_test.py
==============================================================================
--- branches/jelte-configuration/src/lib/config/python/isc/config/config_data_test.py (original)
+++ branches/jelte-configuration/src/lib/config/python/isc/config/config_data_test.py Tue Feb 16 11:05:05 2010
@@ -29,8 +29,8 @@
else:
self.data_path = "../../../testdata"
- def test_data_spec_from_file(self):
- spec = isc.config.data_spec_from_file(self.data_path + os.sep + "spec1.spec")
+ def test_module_spec_from_file(self):
+ spec = isc.config.module_spec_from_file(self.data_path + os.sep + "spec1.spec")
cd = ConfigData(spec)
self.assertEqual(cd.specification, spec)
self.assertEqual(cd.data, {})
Modified: branches/jelte-configuration/src/lib/config/python/isc/config/datadefinition.py
==============================================================================
--- branches/jelte-configuration/src/lib/config/python/isc/config/datadefinition.py (original)
+++ branches/jelte-configuration/src/lib/config/python/isc/config/datadefinition.py Tue Feb 16 11:05:05 2010
@@ -24,31 +24,31 @@
# file objects are passed around as _io.TextIOWrapper objects
# import that so we can check those types
-class DataDefinitionError(Exception):
+class ModuleSpecError(Exception):
pass
-def data_spec_from_file(spec_file, check = True):
- data_spec = None
+def module_spec_from_file(spec_file, check = True):
+ module_spec = None
if hasattr(spec_file, 'read'):
- data_spec = ast.literal_eval(spec_file.read(-1))
+ module_spec = ast.literal_eval(spec_file.read(-1))
elif type(spec_file) == str:
file = open(spec_file)
- data_spec = ast.literal_eval(file.read(-1))
+ module_spec = ast.literal_eval(file.read(-1))
file.close()
else:
- raise DataDefinitionError("spec_file not a str or file-like object")
- if 'data_specification' not in data_spec:
- raise DataDefinitionError("Data definition has no data_specification element")
+ raise ModuleSpecError("spec_file not a str or file-like object")
+ if 'module_spec' not in module_spec:
+ raise ModuleSpecError("Data definition has no module_spec element")
- return DataDefinition(data_spec['data_specification'], check)
-
-class DataDefinition:
- def __init__(self, data_spec, check = True):
- if type(data_spec) != dict:
- raise DataDefinitionError("data_spec is of type " + str(type(data_spec)) + ", not dict")
+ return ModuleSpec(module_spec['module_spec'], check)
+
+class ModuleSpec:
+ def __init__(self, module_spec, check = True):
+ if type(module_spec) != dict:
+ raise ModuleSpecError("module_spec is of type " + str(type(module_spec)) + ", not dict")
if check:
- _check(data_spec)
- self._data_spec = data_spec
+ _check(module_spec)
+ self._module_spec = module_spec
def validate(self, full, data, errors = None):
"""Check whether the given piece of data conforms to this
@@ -60,7 +60,11 @@
non-optional missing values. Set this to False if you want to
validate only a part of a configuration tree (like a list of
non-default values)"""
- data_def = self.get_definition()
+ print("[XX] validate called with data:")
+ print(data)
+ data_def = self.get_config_spec()
+ print("[XX] data def:")
+ print(data_def)
if 'config_data' not in data_def:
if errors:
errors.append("The is no config_data for this specification")
@@ -69,111 +73,111 @@
def get_module_name(self):
- return self._data_spec['module_name']
-
- def get_definition(self):
- return self._data_spec
+ return self._module_spec['module_name']
+
+ def get_full_spec(self):
+ """Returns a dict representation of the full module specification"""
+ return self._module_spec
def get_config_spec(self):
- if 'config_data' in self._data_spec:
- return self._data_spec['config_data']
+ """Returns a dict representation of the configuration data part
+ of the specification, or None if there is none."""
+ if 'config_data' in self._module_spec:
+ return self._module_spec['config_data']
else:
return None
- def get_commands(self):
- if 'commands' in self._data_spec:
- return self._data_spec['commands']
+ def get_commands_spec(self):
+ """Returns a dict representation of the commands part of the
+ specification, or None if there is none."""
+ if 'commands' in self._module_spec:
+ return self._module_spec['commands']
else:
return None
- def get_config_data(self):
- if 'config_data' in self._data_spec:
- return self._data_spec['config_data']
- else:
- return None
-
def __str__(self):
- return self._data_spec.__str__()
-
-def _check(data_spec):
+ """Returns a string representation of the full specification"""
+ return self._module_spec.__str__()
+
+def _check(module_spec):
"""Checks the full specification. This is a dict that contains the
- element "data_specification", which is in itself a dict that
+ element "module_spec", which is in itself a dict that
must contain at least a "module_name" (string) and optionally
a "config_data" and a "commands" element, both of which are lists
- of dicts. Raises a DataDefinitionError if there is a problem."""
- if type(data_spec) != dict:
- raise DataDefinitionError("data specification not a dict")
- if "module_name" not in data_spec:
- raise DataDefinitionError("no module_name in data_specification")
- if "config_data" in data_spec:
- _check_config_spec(data_spec["config_data"])
- if "commands" in data_spec:
- _check_command_spec(data_spec["commands"])
+ of dicts. Raises a ModuleSpecError if there is a problem."""
+ if type(module_spec) != dict:
+ raise ModuleSpecError("data specification not a dict")
+ if "module_name" not in module_spec:
+ raise ModuleSpecError("no module_name in module_spec")
+ if "config_data" in module_spec:
+ _check_config_spec(module_spec["config_data"])
+ if "commands" in module_spec:
+ _check_command_spec(module_spec["commands"])
def _check_config_spec(config_data):
# config data is a list of items represented by dicts that contain
# things like "item_name", depending on the type they can have
# specific subitems
"""Checks a list that contains the configuration part of the
- specification. Raises a DataDefinitionError if there is a
+ specification. Raises a ModuleSpecError if there is a
problem."""
if type(config_data) != list:
- raise DataDefinitionError("config_data is of type " + str(type(config_data)) + ", not a list of items")
+ raise ModuleSpecError("config_data is of type " + str(type(config_data)) + ", not a list of items")
for config_item in config_data:
_check_item_spec(config_item)
def _check_command_spec(commands):
"""Checks the list that contains a set of commands. Raises a
- DataDefinitionError is there is an error"""
+ ModuleSpecError is there is an error"""
if type(commands) != list:
- raise DataDefinitionError("commands is not a list of commands")
+ raise ModuleSpecError("commands is not a list of commands")
for command in commands:
if type(command) != dict:
- raise DataDefinitionError("command in commands list is not a dict")
+ raise ModuleSpecError("command in commands list is not a dict")
if "command_name" not in command:
- raise DataDefinitionError("no command_name in command item")
+ raise ModuleSpecError("no command_name in command item")
command_name = command["command_name"]
if type(command_name) != str:
- raise DataDefinitionError("command_name not a string: " + str(type(command_name)))
+ raise ModuleSpecError("command_name not a string: " + str(type(command_name)))
if "command_description" in command:
if type(command["command_description"]) != str:
- raise DataDefinitionError("command_description not a string in " + command_name)
+ raise ModuleSpecError("command_description not a string in " + command_name)
if "command_args" in command:
if type(command["command_args"]) != list:
- raise DataDefinitionError("command_args is not a list in " + command_name)
+ raise ModuleSpecError("command_args is not a list in " + command_name)
for command_arg in command["command_args"]:
if type(command_arg) != dict:
- raise DataDefinitionError("command argument not a dict in " + command_name)
+ raise ModuleSpecError("command argument not a dict in " + command_name)
_check_item_spec(command_arg)
else:
- raise DataDefinitionError("command_args missing in " + command_name)
+ raise ModuleSpecError("command_args missing in " + command_name)
pass
def _check_item_spec(config_item):
"""Checks the dict that defines one config item
(i.e. containing "item_name", "item_type", etc.
- Raises a DataDefinitionError if there is an error"""
+ Raises a ModuleSpecError if there is an error"""
if type(config_item) != dict:
- raise DataDefinitionError("item spec not a dict")
+ raise ModuleSpecError("item spec not a dict")
if "item_name" not in config_item:
- raise DataDefinitionError("no item_name in config item")
+ raise ModuleSpecError("no item_name in config item")
if type(config_item["item_name"]) != str:
- raise DataDefinitionError("item_name is not a string: " + str(config_item["item_name"]))
+ raise ModuleSpecError("item_name is not a string: " + str(config_item["item_name"]))
item_name = config_item["item_name"]
if "item_type" not in config_item:
- raise DataDefinitionError("no item_type in config item")
+ raise ModuleSpecError("no item_type in config item")
item_type = config_item["item_type"]
if type(item_type) != str:
- raise DataDefinitionError("item_type in " + item_name + " is not a string: " + str(type(item_type)))
+ raise ModuleSpecError("item_type in " + item_name + " is not a string: " + str(type(item_type)))
if item_type not in ["integer", "real", "boolean", "string", "list", "map", "any"]:
- raise DataDefinitionError("unknown item_type in " + item_name + ": " + item_type)
+ raise ModuleSpecError("unknown item_type in " + item_name + ": " + item_type)
if "item_optional" in config_item:
if type(config_item["item_optional"]) != bool:
- raise DataDefinitionError("item_default in " + item_name + " is not a boolean")
+ raise ModuleSpecError("item_default in " + item_name + " is not a boolean")
if not config_item["item_optional"] and "item_default" not in config_item:
- raise DataDefinitionError("no default value for non-optional item " + item_name)
- else:
- raise DataDefinitionError("item_optional not in item " + item_name)
+ raise ModuleSpecError("no default value for non-optional item " + item_name)
+ else:
+ raise ModuleSpecError("item_optional not in item " + item_name)
if "item_default" in config_item:
item_default = config_item["item_default"]
if (item_type == "integer" and type(item_default) != int) or \
@@ -182,22 +186,22 @@
(item_type == "string" and type(item_default) != str) or \
(item_type == "list" and type(item_default) != list) or \
(item_type == "map" and type(item_default) != dict):
- raise DataDefinitionError("Wrong type for item_default in " + item_name)
+ raise ModuleSpecError("Wrong type for item_default in " + item_name)
# TODO: once we have check_type, run the item default through that with the list|map_item_spec
if item_type == "list":
if "list_item_spec" not in config_item:
- raise DataDefinitionError("no list_item_spec in list item " + item_name)
+ raise ModuleSpecError("no list_item_spec in list item " + item_name)
if type(config_item["list_item_spec"]) != dict:
- raise DataDefinitionError("list_item_spec in " + item_name + " is not a dict")
+ raise ModuleSpecError("list_item_spec in " + item_name + " is not a dict")
_check_item_spec(config_item["list_item_spec"])
if item_type == "map":
if "map_item_spec" not in config_item:
- raise DataDefinitionError("no map_item_sepc in map item " + item_name)
+ raise ModuleSpecError("no map_item_sepc in map item " + item_name)
if type(config_item["map_item_spec"]) != list:
- raise DataDefinitionError("map_item_spec in " + item_name + " is not a list")
+ raise ModuleSpecError("map_item_spec in " + item_name + " is not a list")
for map_item in config_item["map_item_spec"]:
if type(map_item) != dict:
- raise DataDefinitionError("map_item_spec element is not a dict")
+ raise ModuleSpecError("map_item_spec element is not a dict")
_check_item_spec(map_item)
@@ -261,8 +265,8 @@
else:
return True
-def _validate_spec_list(data_spec, full, data, errors):
- for spec_item in data_spec:
+def _validate_spec_list(module_spec, full, data, errors):
+ for spec_item in module_spec:
if not _validate_spec(spec_item, full, data, errors):
return False
return True
Modified: branches/jelte-configuration/src/lib/config/python/isc/config/datadefinition_test.py
==============================================================================
--- branches/jelte-configuration/src/lib/config/python/isc/config/datadefinition_test.py (original)
+++ branches/jelte-configuration/src/lib/config/python/isc/config/datadefinition_test.py Tue Feb 16 11:05:05 2010
@@ -19,10 +19,10 @@
import unittest
import os
-from isc.config import DataDefinition, DataDefinitionError
+from isc.config import ModuleSpec, ModuleSpecError
import isc.cc.data
-class TestDataDefinition(unittest.TestCase):
+class TestModuleSpec(unittest.TestCase):
def setUp(self):
if 'CONFIG_TESTDATA_PATH' in os.environ:
@@ -34,12 +34,12 @@
return(self.data_path + os.sep + filename)
def read_spec_file(self, filename):
- return isc.config.data_spec_from_file(self.spec_file(filename))
+ return isc.config.module_spec_from_file(self.spec_file(filename))
def spec1(self, dd):
- data_spec = dd.get_definition()
- self.assert_('module_name' in data_spec)
- self.assertEqual(data_spec['module_name'], "Spec1")
+ module_spec = dd.get_full_spec()
+ self.assert_('module_name' in module_spec)
+ self.assertEqual(module_spec['module_name'], "Spec1")
def test_open_file_name(self):
dd = self.read_spec_file("spec1.spec")
@@ -47,29 +47,29 @@
def test_open_file_obj(self):
file1 = open(self.spec_file("spec1.spec"))
- dd = isc.config.data_spec_from_file(file1)
+ dd = isc.config.module_spec_from_file(file1)
self.spec1(dd)
def test_bad_specfiles(self):
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec3.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec4.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec5.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec6.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec7.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec8.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec9.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec10.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec11.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec12.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec13.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec14.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec15.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec16.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec17.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec18.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec19.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec20.spec")
- self.assertRaises(DataDefinitionError, self.read_spec_file, "spec21.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec3.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec4.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec5.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec6.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec7.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec8.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec9.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec10.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec11.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec12.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec13.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec14.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec15.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec16.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec17.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec18.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec19.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec20.spec")
+ self.assertRaises(ModuleSpecError, self.read_spec_file, "spec21.spec")
def validate_data(self, specfile_name, datafile_name):
dd = self.read_spec_file(specfile_name);
Modified: branches/jelte-configuration/src/lib/config/testdata/spec1.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec1.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec1.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec1"
}
}
Modified: branches/jelte-configuration/src/lib/config/testdata/spec10.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec10.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec10.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "item1",
Modified: branches/jelte-configuration/src/lib/config/testdata/spec11.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec11.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec11.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "item1",
Modified: branches/jelte-configuration/src/lib/config/testdata/spec12.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec12.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec12.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "item1",
Modified: branches/jelte-configuration/src/lib/config/testdata/spec13.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec13.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec13.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "item1",
Modified: branches/jelte-configuration/src/lib/config/testdata/spec14.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec14.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec14.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "item1",
Modified: branches/jelte-configuration/src/lib/config/testdata/spec15.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec15.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec15.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "item1",
Modified: branches/jelte-configuration/src/lib/config/testdata/spec16.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec16.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec16.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": 1
}
Modified: branches/jelte-configuration/src/lib/config/testdata/spec17.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec17.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec17.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"commands": [
{
Modified: branches/jelte-configuration/src/lib/config/testdata/spec18.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec18.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec18.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"commands": [
{
Modified: branches/jelte-configuration/src/lib/config/testdata/spec19.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec19.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec19.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"commands": [
{
Modified: branches/jelte-configuration/src/lib/config/testdata/spec2.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec2.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec2.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "item1",
Modified: branches/jelte-configuration/src/lib/config/testdata/spec20.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec20.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec20.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"commands": [
{
Modified: branches/jelte-configuration/src/lib/config/testdata/spec21.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec21.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec21.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"commands": 1
}
Modified: branches/jelte-configuration/src/lib/config/testdata/spec22.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec22.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec22.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "value1",
Modified: branches/jelte-configuration/src/lib/config/testdata/spec23.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec23.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec23.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"commands": [
{
Modified: branches/jelte-configuration/src/lib/config/testdata/spec3.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec3.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec3.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec3",
"config_data": [
{
Modified: branches/jelte-configuration/src/lib/config/testdata/spec4.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec4.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec4.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "item1",
Modified: branches/jelte-configuration/src/lib/config/testdata/spec5.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec5.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec5.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "item1",
Modified: branches/jelte-configuration/src/lib/config/testdata/spec6.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec6.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec6.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "item1",
Modified: branches/jelte-configuration/src/lib/config/testdata/spec7.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec7.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec7.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
}
}
Modified: branches/jelte-configuration/src/lib/config/testdata/spec9.spec
==============================================================================
--- branches/jelte-configuration/src/lib/config/testdata/spec9.spec (original)
+++ branches/jelte-configuration/src/lib/config/testdata/spec9.spec Tue Feb 16 11:05:05 2010
@@ -1,5 +1,5 @@
{
- "data_specification": {
+ "module_spec": {
"module_name": "Spec2",
"config_data": [
{ "item_name": "item1",
More information about the bind10-changes
mailing list