[svn] commit: r3752 - in /branches/trac384/src/lib/python/isc/config: config_data.py tests/config_data_test.py

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Dec 7 13:42:51 UTC 2010


Author: jelte
Date: Tue Dec  7 13:42:51 2010
New Revision: 3752

Log:
update; show map contents

Modified:
    branches/trac384/src/lib/python/isc/config/config_data.py
    branches/trac384/src/lib/python/isc/config/tests/config_data_test.py

Modified: branches/trac384/src/lib/python/isc/config/config_data.py
==============================================================================
--- branches/trac384/src/lib/python/isc/config/config_data.py (original)
+++ branches/trac384/src/lib/python/isc/config/config_data.py Tue Dec  7 13:42:51 2010
@@ -461,6 +461,16 @@
                                         li_spec['item_type'],
                                         value, status)
                             result.append(entry)
+                    elif item['item_type'] == 'map':
+                        map_name = item['item_name'] + '/'
+                        for map_item in item['map_item_spec']:
+                            value, status =  self.get_value('/' + identifier + '/' + map_item['item_name'])
+                            entry = _create_value_map_entry(
+                                        map_name + map_item['item_name'],
+                                        map_item['item_type'],
+                                        value,
+                                        status)
+                            result.append(entry)
                     else:
                         value, status = self.get_value("/" + identifier)
                         if value is not None:

Modified: branches/trac384/src/lib/python/isc/config/tests/config_data_test.py
==============================================================================
--- branches/trac384/src/lib/python/isc/config/tests/config_data_test.py (original)
+++ branches/trac384/src/lib/python/isc/config/tests/config_data_test.py Tue Dec  7 13:42:51 2010
@@ -461,15 +461,19 @@
         module_spec = isc.config.module_spec_from_file(self.data_path + os.sep + "spec22.spec")
         self.mcd.set_specification(module_spec)
         expected = [{'default': True,
+                     'modified': False,
+                     'name': 'value9/v91',
+                     'type': 'string',
+                     'value': 'def'},
+                    {'default': True,
+                     'modified': False,
+                     'name': 'value9/v92',
                      'type': 'map',
-                     'name': 'value9',
-                     'value': {'v92': {}, 'v91': 'def'},
-                     'modified': False}]
-
+                     'value': {}
+                    }
+                   ]
         maps = self.mcd.get_value_maps("/Spec22/value9")
         self.assertEqual(expected, maps)
-
-
 
     def test_set_value(self):
         module_spec = isc.config.module_spec_from_file(self.data_path + os.sep + "spec2.spec")




More information about the bind10-changes mailing list