Browse Source

[trac926] review comments

Jelte Jansen 13 years ago
parent
commit
ced9ddecf6

+ 2 - 2
src/bin/bindctl/bindcmd.py

@@ -398,8 +398,8 @@ class BindCmdInterpreter(Cmd):
                 print("Error: " + str(dte))
                 print("Error: " + str(dte))
             except isc.cc.data.DataNotFoundError as dnfe:
             except isc.cc.data.DataNotFoundError as dnfe:
                 print("Error: " + str(dnfe))
                 print("Error: " + str(dnfe))
-            except isc.cc.data.DataAlreadyPresentError as dnfe:
-                print("Error: " + str(dnfe))
+            except isc.cc.data.DataAlreadyPresentError as dape:
+                print("Error: " + str(dape))
             except KeyError as ke:
             except KeyError as ke:
                 print("Error: missing " + str(ke))
                 print("Error: missing " + str(ke))
         else:
         else:

+ 2 - 1
src/lib/config/module_spec.cc

@@ -327,7 +327,8 @@ ModuleSpec::validateItem(ConstElementPtr spec, ConstElementPtr data,
         }
         }
     }
     }
     if (data->getType() == Element::map) {
     if (data->getType() == Element::map) {
-        // either a 'normal' map or a 'named' set
+        // either a normal 'map' or a 'named set' (determined by which
+        // subspecification it has)
         if (spec->contains("map_item_spec")) {
         if (spec->contains("map_item_spec")) {
             if (!validateSpecList(spec->get("map_item_spec"), data, full, errors)) {
             if (!validateSpecList(spec->get("map_item_spec"), data, full, errors)) {
                 return (false);
                 return (false);

+ 6 - 1
src/lib/python/isc/config/config_data.py

@@ -196,7 +196,6 @@ def spec_name_list(spec, prefix="", recurse=False):
         elif 'named_set_item_spec' in spec:
         elif 'named_set_item_spec' in spec:
             # we added a '/' above, but in this one case we don't want it
             # we added a '/' above, but in this one case we don't want it
             result.append(prefix[:-1])
             result.append(prefix[:-1])
-            pass
         else:
         else:
             for name in spec:
             for name in spec:
                 result.append(prefix + name + "/")
                 result.append(prefix + name + "/")
@@ -420,6 +419,12 @@ class MultiConfigData:
                 id_prefix += "/" + id_part
                 id_prefix += "/" + id_part
                 part_spec = find_spec_part(self._specifications[module].get_config_spec(), id_prefix)
                 part_spec = find_spec_part(self._specifications[module].get_config_spec(), id_prefix)
                 if part_spec['item_type'] == 'named_set':
                 if part_spec['item_type'] == 'named_set':
+                    # For named sets, the identifier is partly defined
+                    # by which values are actually present, and not
+                    # purely by the specification.
+                    # So if there is a part of the identifier left,
+                    # we need to look up the value, then see if that
+                    # contains the next part of the identifier we got
                     if len(id_parts) == 0:
                     if len(id_parts) == 0:
                         if 'item_default' in part_spec:
                         if 'item_default' in part_spec:
                             return part_spec['item_default']
                             return part_spec['item_default']