You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ch...@apache.org on 2018/04/30 20:37:29 UTC

qpid-dispatch git commit: DISPATCH-984: strip whole-line comments only in json config files

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 623f4e67a -> b00283fd4


DISPATCH-984: strip whole-line comments only in json config files


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/b00283fd
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/b00283fd
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/b00283fd

Branch: refs/heads/master
Commit: b00283fd42e7908e3688f8107448e60fc1e8e2e7
Parents: 623f4e6
Author: Chuck Rolke <cr...@redhat.com>
Authored: Mon Apr 30 16:37:20 2018 -0400
Committer: Chuck Rolke <cr...@redhat.com>
Committed: Mon Apr 30 16:37:20 2018 -0400

----------------------------------------------------------------------
 python/qpid_dispatch_internal/management/config.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/b00283fd/python/qpid_dispatch_internal/management/config.py
----------------------------------------------------------------------
diff --git a/python/qpid_dispatch_internal/management/config.py b/python/qpid_dispatch_internal/management/config.py
index cd60b2f..303609e 100644
--- a/python/qpid_dispatch_internal/management/config.py
+++ b/python/qpid_dispatch_internal/management/config.py
@@ -94,8 +94,8 @@ class Config(object):
     def _parserawjson(lines):
         """Parse raw json config file format into a section list"""
         def sub(line):
-            """Do substitutions to make line json-friendly"""
-            line = line.split('#')[0].strip() # Strip comments
+            # ignore comment lines that start with "[whitespace] #"
+            line = "" if line.strip().startswith('#') else line
             return line
         js_text = "%s"%("\n".join([sub(l) for l in lines]))
         sections = json.loads(js_text)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org