BIND 10 trac384, updated. 05f49a93714de9a09ad1c0a9d6e2a7365e890232 [trac384] check if a list value exists with 'go'
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Feb 18 09:34:57 UTC 2011
The branch, trac384 has been updated
via 05f49a93714de9a09ad1c0a9d6e2a7365e890232 (commit)
from b6bce27baf454101b3755d46877ac84c5eef20f2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 05f49a93714de9a09ad1c0a9d6e2a7365e890232
Author: Jelte Jansen <jelte at isc.org>
Date: Fri Feb 18 10:34:36 2011 +0100
[trac384] check if a list value exists with 'go'
-----------------------------------------------------------------------
Summary of changes:
src/bin/bindctl/bindcmd.py | 11 +++++------
src/lib/python/isc/config/config_data.py | 9 +++++++++
2 files changed, 14 insertions(+), 6 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/bindctl/bindcmd.py b/src/bin/bindctl/bindcmd.py
index a9060e2..6ee9068 100644
--- a/src/bin/bindctl/bindcmd.py
+++ b/src/bin/bindctl/bindcmd.py
@@ -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
diff --git a/src/lib/python/isc/config/config_data.py b/src/lib/python/isc/config/config_data.py
index b2d71c4..582c11c 100644
--- a/src/lib/python/isc/config/config_data.py
+++ b/src/lib/python/isc/config/config_data.py
@@ -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:
More information about the bind10-changes
mailing list