From: Jelte Jansen Date: Wed, 15 Feb 2012 13:53:13 +0000 (+0100) Subject: [1649] address review comments X-Git-Tag: trac2351_base~247^2~11^2~1^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ee4edb317a513bcc1230a4edb8edcd91b8a796ca;p=thirdparty%2Fkea.git [1649] address review comments --- diff --git a/src/lib/python/isc/config/config_data.py b/src/lib/python/isc/config/config_data.py index 62a45561f0..f8da086616 100644 --- a/src/lib/python/isc/config/config_data.py +++ b/src/lib/python/isc/config/config_data.py @@ -150,13 +150,13 @@ def _find_spec_part_single(cur_spec, id_part): # list or a map, which is internally represented by a dict with # an element 'map_item_spec', a dict with an element 'list_item_spec', # or a list (when it is the 'main' config_data element of a module). - if type(cur_spec) == dict and spec_part_is_map(cur_spec): + if spec_part_is_map(cur_spec): for cur_spec_item in cur_spec['map_item_spec']: if cur_spec_item['item_name'] == id: return cur_spec_item # not found raise isc.cc.data.DataNotFoundError(id + " not found") - elif type(cur_spec) == dict and spec_part_is_list(cur_spec): + elif spec_part_is_list(cur_spec): if cur_spec['item_name'] == id: return cur_spec['list_item_spec'] # not found @@ -203,7 +203,7 @@ def find_spec_part(element, identifier, strict_identifier = True): if strict_identifier and spec_part_is_list(cur_el) and\ not isc.cc.data.identifier_has_list_index(id_part): raise isc.cc.data.DataNotFoundError(id_part + - " is a list and needs index") + " is a list and needs an index") cur_el = _get_map_or_list(cur_el) cur_el = _find_spec_part_single(cur_el, id_parts[-1])