Parcourir la source

refactoring;
renamed the DataDefinition class to the much more accurate ModuleSpec
also renamed some ambiguously named functions therein



git-svn-id: svn://bind10.isc.org/svn/bind10/branches/jelte-configuration@833 e5f2f494-b856-4b98-b285-d166d9295462

Jelte Jansen il y a 15 ans
Parent
commit
b8b0f55e1a
38 fichiers modifiés avec 232 ajouts et 230 suppressions
  1. 1 1
      src/bin/auth/auth.spec
  2. 1 1
      src/bin/bind10/bind10.py.in
  3. 1 1
      src/bin/bind10/bob.spec
  4. 2 2
      src/bin/cmdctl/b10-cmdctl.py.in
  5. 1 1
      src/bin/parkinglot/parkinglot.spec
  6. 1 1
      src/lib/cc/cpp/parkinglot.spec
  7. 1 1
      src/lib/config/cpp/ccsession.cc
  8. 4 4
      src/lib/config/cpp/data_def.cc
  9. 4 4
      src/lib/config/cpp/data_def_unittests.cc
  10. 5 6
      src/lib/config/python/isc/config/ccsession.py
  11. 35 35
      src/lib/config/python/isc/config/cfgmgr.py
  12. 15 15
      src/lib/config/python/isc/config/cfgmgr_test.py
  13. 36 37
      src/lib/config/python/isc/config/config_data.py
  14. 2 2
      src/lib/config/python/isc/config/config_data_test.py
  15. 75 71
      src/lib/config/python/isc/config/datadefinition.py
  16. 26 26
      src/lib/config/python/isc/config/datadefinition_test.py
  17. 1 1
      src/lib/config/testdata/spec1.spec
  18. 1 1
      src/lib/config/testdata/spec10.spec
  19. 1 1
      src/lib/config/testdata/spec11.spec
  20. 1 1
      src/lib/config/testdata/spec12.spec
  21. 1 1
      src/lib/config/testdata/spec13.spec
  22. 1 1
      src/lib/config/testdata/spec14.spec
  23. 1 1
      src/lib/config/testdata/spec15.spec
  24. 1 1
      src/lib/config/testdata/spec16.spec
  25. 1 1
      src/lib/config/testdata/spec17.spec
  26. 1 1
      src/lib/config/testdata/spec18.spec
  27. 1 1
      src/lib/config/testdata/spec19.spec
  28. 1 1
      src/lib/config/testdata/spec2.spec
  29. 1 1
      src/lib/config/testdata/spec20.spec
  30. 1 1
      src/lib/config/testdata/spec21.spec
  31. 1 1
      src/lib/config/testdata/spec22.spec
  32. 1 1
      src/lib/config/testdata/spec23.spec
  33. 1 1
      src/lib/config/testdata/spec3.spec
  34. 1 1
      src/lib/config/testdata/spec4.spec
  35. 1 1
      src/lib/config/testdata/spec5.spec
  36. 1 1
      src/lib/config/testdata/spec6.spec
  37. 1 1
      src/lib/config/testdata/spec7.spec
  38. 1 1
      src/lib/config/testdata/spec9.spec

+ 1 - 1
src/bin/auth/auth.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Auth",
     "config_data": [
       { "item_name": "default_name",

+ 1 - 1
src/bin/bind10/bind10.py.in

@@ -116,7 +116,7 @@ class BoB:
             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)

+ 1 - 1
src/bin/bind10/bob.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Boss",
     "config_data": [
       {

+ 2 - 2
src/bin/cmdctl/b10-cmdctl.py.in

@@ -188,7 +188,7 @@ class CommandControl():
         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 @@ class CommandControl():
             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

+ 1 - 1
src/bin/parkinglot/parkinglot.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "ParkingLot",
     "config_data": [
       {

+ 1 - 1
src/lib/cc/cpp/parkinglot.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "ParkingLot",
     "config_data": [
       {

+ 1 - 1
src/lib/config/cpp/ccsession.cc

@@ -81,7 +81,7 @@ CommandSession::CommandSession(std::string spec_file_name,
     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;
 

+ 4 - 4
src/lib/config/cpp/data_def.cc

@@ -141,10 +141,10 @@ check_data_specification(const ElementPtr& spec) {
 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 @@ DataDefinition::validate_spec_list(const ElementPtr spec, const ElementPtr data)
 // 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);
 }
 

+ 4 - 4
src/lib/config/cpp/data_def_unittests.cc

@@ -47,11 +47,11 @@ TEST(DataDefinition, ReadingSpecfiles) {
     // 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 @@ TEST(DataDefinition, ReadingSpecfiles) {
     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 @@ TEST(DataDefinition, SpecfileConfigData)
     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",

+ 5 - 6
src/lib/config/python/isc/config/ccsession.py

@@ -80,7 +80,7 @@ class CCSession:
            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 @@ class CCSession:
         """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 @@ class CCSession:
     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 @@ class CCSession:
         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)

+ 35 - 35
src/lib/config/python/isc/config/cfgmgr.py

@@ -106,12 +106,12 @@ class ConfigManager:
        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 @@ class ConfigManager:
         """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 set_module_spec(self, spec):
+        #data_def = isc.config.ModuleSpec(spec)
+        self.module_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_module_spec(self, module_name):
+        if module_name in self.module_specs:
+            return self.module_specs[module_name]
 
-    def get_config_data(self, name = None):
+    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
+            if name in self.module_specs:
+                config_data[name] = self.module_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()
+            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
+            if name in self.module_specs:
+                commands[name] = self.module_specs[name].get_commands_spec
         else:
-            for module_name in self.data_specs.keys():
-                commands[module_name] = self.data_specs[module_name].get_commands()
+            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 @@ class ConfigManager:
            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")
+                    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_data_spec command, argument not a dict")
+                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_data())
+            answer = isc.config.ccsession.create_answer(0, self.get_config_spec())
         return answer
 
     def _handle_get_config(self, cmd):
@@ -256,17 +256,17 @@ class ConfigManager:
             
         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 @@ class ConfigManager:
         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 @@ class ConfigManager:
             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

+ 15 - 15
src/lib/config/python/isc/config/cfgmgr_test.py

@@ -109,10 +109,10 @@ class TestConfigManager(unittest.TestCase):
         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 @@ class TestConfigManager(unittest.TestCase):
         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 @@ class TestConfigManager(unittest.TestCase):
         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

+ 36 - 37
src/lib/config/python/isc/config/config_data.py

@@ -108,9 +108,9 @@ class ConfigData:
    
     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 @@ class ConfigData:
         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 @@ class ConfigData:
 
     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 @@ class MultiConfigData:
         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 @@ class MultiConfigData:
             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 @@ class MultiConfigData:
             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 @@ class MultiConfigData:
             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 @@ class UIConfigData():
             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 @@ class UIConfigData():
         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 @@ class UIConfigData():
         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 @@ class OUIConfigData():
     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 @@ class OUIConfigData():
         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 @@ class OUIConfigData():
         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 @@ class OUIConfigData():
         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):

+ 2 - 2
src/lib/config/python/isc/config/config_data_test.py

@@ -29,8 +29,8 @@ class TestConfigData(unittest.TestCase):
         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, {})

+ 75 - 71
src/lib/config/python/isc/config/datadefinition.py

@@ -24,31 +24,31 @@ import isc.cc.data
 # 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)
+    return ModuleSpec(module_spec['module_spec'], 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")
+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 @@ class DataDefinition:
            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 @@ class DataDefinition:
 
 
     def get_module_name(self):
-        return self._data_spec['module_name']
+        return self._module_spec['module_name']
 
-    def get_definition(self):
-        return self._data_spec
+    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__()
+        """Returns a string representation of the full specification"""
+        return self._module_spec.__str__()
 
-def _check(data_spec):
+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)
+            raise ModuleSpecError("no default value for non-optional item " + item_name)
     else:
-        raise DataDefinitionError("item_optional not in item " + item_name)
+        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 @@ def _check_item_spec(config_item):
            (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 @@ def _validate_spec(spec, full, data, errors):
     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

+ 26 - 26
src/lib/config/python/isc/config/datadefinition_test.py

@@ -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 @@ class TestDataDefinition(unittest.TestCase):
         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 @@ class TestDataDefinition(unittest.TestCase):
 
     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);

+ 1 - 1
src/lib/config/testdata/spec1.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec1"
   }
 }

+ 1 - 1
src/lib/config/testdata/spec10.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "item1",

+ 1 - 1
src/lib/config/testdata/spec11.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "item1",

+ 1 - 1
src/lib/config/testdata/spec12.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "item1",

+ 1 - 1
src/lib/config/testdata/spec13.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "item1",

+ 1 - 1
src/lib/config/testdata/spec14.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "item1",

+ 1 - 1
src/lib/config/testdata/spec15.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "item1",

+ 1 - 1
src/lib/config/testdata/spec16.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": 1
   }

+ 1 - 1
src/lib/config/testdata/spec17.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "commands": [
       {

+ 1 - 1
src/lib/config/testdata/spec18.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "commands": [
       {

+ 1 - 1
src/lib/config/testdata/spec19.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "commands": [
       {

+ 1 - 1
src/lib/config/testdata/spec2.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "item1",

+ 1 - 1
src/lib/config/testdata/spec20.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "commands": [
       {

+ 1 - 1
src/lib/config/testdata/spec21.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "commands": 1
   }

+ 1 - 1
src/lib/config/testdata/spec22.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "value1",

+ 1 - 1
src/lib/config/testdata/spec23.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "commands": [
       {

+ 1 - 1
src/lib/config/testdata/spec3.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec3",
     "config_data": [
       {

+ 1 - 1
src/lib/config/testdata/spec4.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "item1",

+ 1 - 1
src/lib/config/testdata/spec5.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "item1",

+ 1 - 1
src/lib/config/testdata/spec6.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "item1",

+ 1 - 1
src/lib/config/testdata/spec7.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
   }
 }
 

+ 1 - 1
src/lib/config/testdata/spec9.spec

@@ -1,5 +1,5 @@
 {
-  "data_specification": {
+  "module_spec": {
     "module_name": "Spec2",
     "config_data": [
       { "item_name": "item1",