You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by pm...@apache.org on 2014/07/30 14:44:17 UTC

svn commit: r1614637 - /qpid/trunk/qpid/tools/src/py/qpid-config

Author: pmoravec
Date: Wed Jul 30 12:44:16 2014
New Revision: 1614637

URL: http://svn.apache.org/r1614637
Log:
[QPID-5945]: qpid-config to pass integer arguments whenever possible

Modified:
    qpid/trunk/qpid/tools/src/py/qpid-config

Modified: qpid/trunk/qpid/tools/src/py/qpid-config
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/tools/src/py/qpid-config?rev=1614637&r1=1614636&r2=1614637&view=diff
==============================================================================
--- qpid/trunk/qpid/tools/src/py/qpid-config (original)
+++ qpid/trunk/qpid/tools/src/py/qpid-config Wed Jul 30 12:44:16 2014
@@ -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 



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