summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@apache.org>2014-07-30 12:44:16 +0000
committerPavel Moravec <pmoravec@apache.org>2014-07-30 12:44:16 +0000
commit458f96a5576ab157f5babe75ccc2dd5134f41bdd (patch)
treef28cbe5c5d580f7a7234c699570ec4a23904e490 /tools
parenta5ea46e0bfdccfefe4b5a64aa0070e21cad9c1e1 (diff)
downloadqpid-python-458f96a5576ab157f5babe75ccc2dd5134f41bdd.tar.gz
[QPID-5945]: qpid-config to pass integer arguments whenever possible
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1614637 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'tools')
-rwxr-xr-xtools/src/py/qpid-config21
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/src/py/qpid-config b/tools/src/py/qpid-config
index c62fa195d7..3fc27ab241 100755
--- a/tools/src/py/qpid-config
+++ b/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