Commit 05f49a93 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

[trac384] check if a list value exists with 'go'

parent b6bce27b
......@@ -387,7 +387,6 @@ class BindCmdInterpreter(Cmd):
print("Error: " + str(dnfe))
except KeyError as ke:
print("Error: missing " + str(ke))
raise ke
else:
self.apply_cmd(cmd)
......@@ -669,11 +668,11 @@ class BindCmdInterpreter(Cmd):
new_location, a, b = new_location.rpartition("/")
else:
new_location += "/" + id_part
# check if exists, if not, revert and error
v = self.config_data.find_spec_part(new_location)
if v is None:
print("Error: " + identifier + " not found")
return
# check if exists, if not, revert and error
v,d = self.config_data.get_value(new_location)
if v is None:
print("Error: " + identifier + " not found")
return
self.location = new_location
......
......@@ -405,6 +405,15 @@ class MultiConfigData:
return isc.cc.data.find(list_value, rest_of_id)
else:
return list_value
else:
# we do have a non-default list, see if our indices
# exist
for i in list_indices:
if i < len(list_value):
list_value = list_value[i]
else:
# out of range, return None
return None
spec = find_spec_part(self._specifications[module].get_config_spec(), id)
if 'item_default' in spec:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment