diff options
author | Pavel Moravec <pmoravec@apache.org> | 2014-07-30 12:44:16 +0000 |
---|---|---|
committer | Pavel Moravec <pmoravec@apache.org> | 2014-07-30 12:44:16 +0000 |
commit | bc817231ca76ba501e93e2db29a3d5101e1871a6 (patch) | |
tree | 11ed724046f1ee43ec80e0cd17fd78362175a20f /qpid/tools | |
parent | 5b965c1bd8161c143f500f8f1f30162728b29baa (diff) | |
download | qpid-python-bc817231ca76ba501e93e2db29a3d5101e1871a6.tar.gz |
[QPID-5945]: qpid-config to pass integer arguments whenever possible
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1614637 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/tools')
-rwxr-xr-x | qpid/tools/src/py/qpid-config | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/qpid/tools/src/py/qpid-config b/qpid/tools/src/py/qpid-config index c62fa195d7..3fc27ab241 100755 --- a/qpid/tools/src/py/qpid-config +++ b/qpid/tools/src/py/qpid-config @@ -82,6 +82,15 @@ Replication levels: REPLICATE_LEVELS= ["none", "configuration", "all"] DEFAULT_PROPERTIES = {"exchange":["name", "type", "durable"], "queue":["name", "durable", "autoDelete"]} +def get_value(r): + if len(r) == 2: + try: + value = int(r[1]) + except: + value = r[1] + else: value = None + return value + class Config: def __init__(self): self._recursive = False @@ -118,9 +127,7 @@ class Config: options = {} for a in self._extra_arguments: r = a.split("=", 1) - if len(r) == 2: value = r[1] - else: value = None - options[r[0]] = value + options[r[0]] = get_value(r) return options @@ -560,9 +567,7 @@ class BrokerManager: declArgs = {} for a in config._extra_arguments: r = a.split("=", 1) - if len(r) == 2: value = r[1] - else: value = None - declArgs[r[0]] = value + declArgs[r[0]] = get_value(r) if config._msgSequence: declArgs[MSG_SEQUENCE] = 1 @@ -591,9 +596,7 @@ class BrokerManager: declArgs = {} for a in config._extra_arguments: r = a.split("=", 1) - if len(r) == 2: value = r[1] - else: value = None - declArgs[r[0]] = value + declArgs[r[0]] = get_value(r) if config._durable: # allow the default fileCount and fileSize specified |