BIND 10 trac1678, updated. d125d7da8b990b238993f59353e8a11832785706 [1678] updated filtering expression for non-json garbage, based on discussion on jabber.
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Feb 27 19:20:06 UTC 2012
The branch, trac1678 has been updated
via d125d7da8b990b238993f59353e8a11832785706 (commit)
from 280742f34c2471024aebdf2736edf5570f1f3da2 (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 d125d7da8b990b238993f59353e8a11832785706
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Mon Feb 27 11:19:47 2012 -0800
[1678] updated filtering expression for non-json garbage, based on
discussion on jabber.
-----------------------------------------------------------------------
Summary of changes:
tests/lettuce/features/terrain/bind10_control.py | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
-----------------------------------------------------------------------
diff --git a/tests/lettuce/features/terrain/bind10_control.py b/tests/lettuce/features/terrain/bind10_control.py
index 2a2383a..227d654 100644
--- a/tests/lettuce/features/terrain/bind10_control.py
+++ b/tests/lettuce/features/terrain/bind10_control.py
@@ -177,13 +177,13 @@ def parse_bindctl_output_as_data_structure():
If it is valid, it is parsed and returned as whatever data
structure it represented.
"""
- # strip any extra output after the last valid JSON character (it
- # would contain 'Exit from bindctl' message, and depending on
- # environment some other control-like characters).
- # Why is this message even there?
- output = world.last_bindctl_stdout.replace("Exit from bindctl", "")
- # And remove any other non-json junk at the end
- output = output.replace("[^el\d}\"\]]*$", "")
+ # strip any extra output after a charater that commonly terminates a valid
+ # JSON expression, i.e., ']', '}' and '"'. (The extra output would
+ # contain 'Exit from bindctl' message, and depending on environment some
+ # other control-like characters...but why is this message even there?)
+ # Note that this filter is not perfect. For example, it cannot recognize
+ # a simple expression of true/false/null.
+ output = re.sub("(.*)([^]}\"]*$)", r"\1", world.last_bindctl_stdout)
try:
return json.loads(output)
except ValueError as ve:
More information about the bind10-changes
mailing list