[rhmessaging-commits] rhmessaging commits: r2826 - mgmt/trunk/mint/python/mint.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Mon Nov 17 13:51:55 EST 2008


Author: eallen
Date: 2008-11-17 13:51:55 -0500 (Mon, 17 Nov 2008)
New Revision: 2826

Modified:
   mgmt/trunk/mint/python/mint/schema.py
Log:
Changed test for existence of arguments to be more explicit. An argument of False was not being passed to API.

Modified: mgmt/trunk/mint/python/mint/schema.py
===================================================================
--- mgmt/trunk/mint/python/mint/schema.py	2008-11-17 18:51:43 UTC (rev 2825)
+++ mgmt/trunk/mint/python/mint/schema.py	2008-11-17 18:51:55 UTC (rev 2826)
@@ -175,7 +175,7 @@
 
   def GetAd(self, model, callback, JobAd):
     actualArgs = list()
-    if JobAd:
+    if JobAd is not None:
         actualArgs.append(JobAd)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "GetAd",
@@ -183,9 +183,9 @@
 
   def SetAttribute(self, model, callback, Name, Value):
     actualArgs = list()
-    if Name:
+    if Name is not None:
         actualArgs.append(Name)
-    if Value:
+    if Value is not None:
         actualArgs.append(Value)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "SetAttribute",
@@ -193,7 +193,7 @@
 
   def Hold(self, model, callback, Reason):
     actualArgs = list()
-    if Reason:
+    if Reason is not None:
         actualArgs.append(Reason)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "Hold",
@@ -201,7 +201,7 @@
 
   def Release(self, model, callback, Reason):
     actualArgs = list()
-    if Reason:
+    if Reason is not None:
         actualArgs.append(Reason)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "Release",
@@ -209,7 +209,7 @@
 
   def Remove(self, model, callback, Reason):
     actualArgs = list()
-    if Reason:
+    if Reason is not None:
         actualArgs.append(Reason)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "Remove",
@@ -217,13 +217,13 @@
 
   def Fetch(self, model, callback, File, Start, End, Data):
     actualArgs = list()
-    if File:
+    if File is not None:
         actualArgs.append(File)
-    if Start:
+    if Start is not None:
         actualArgs.append(Start)
-    if End:
+    if End is not None:
         actualArgs.append(End)
-    if Data:
+    if Data is not None:
         actualArgs.append(Data)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "Fetch",
@@ -354,7 +354,7 @@
 
   def GetLimits(self, model, callback, Limits):
     actualArgs = list()
-    if Limits:
+    if Limits is not None:
         actualArgs.append(Limits)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "GetLimits",
@@ -362,9 +362,9 @@
 
   def SetLimit(self, model, callback, Name, Max):
     actualArgs = list()
-    if Name:
+    if Name is not None:
         actualArgs.append(Name)
-    if Max:
+    if Max is not None:
         actualArgs.append(Max)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "SetLimit",
@@ -456,7 +456,7 @@
 
   def Start(self, model, callback, Subsystem):
     actualArgs = list()
-    if Subsystem:
+    if Subsystem is not None:
         actualArgs.append(Subsystem)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "Start",
@@ -464,7 +464,7 @@
 
   def Stop(self, model, callback, Subsystem):
     actualArgs = list()
-    if Subsystem:
+    if Subsystem is not None:
         actualArgs.append(Subsystem)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "Stop",
@@ -651,7 +651,7 @@
   def expand(self, model, callback, by):
     """Increase number of files allocated for this journal"""
     actualArgs = list()
-    if by:
+    if by is not None:
         actualArgs.append(by)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "expand",
@@ -757,9 +757,9 @@
   def echo(self, model, callback, sequence, body):
     """Request a response to test the path to the management broker"""
     actualArgs = list()
-    if sequence:
+    if sequence is not None:
         actualArgs.append(sequence)
-    if body:
+    if body is not None:
         actualArgs.append(body)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "echo",
@@ -768,19 +768,19 @@
   def connect(self, model, callback, host, port, durable, authMechanism, username, password, transport):
     """Establish a connection to another broker"""
     actualArgs = list()
-    if host:
+    if host is not None:
         actualArgs.append(host)
-    if port:
+    if port is not None:
         actualArgs.append(port)
-    if durable:
+    if durable is not None:
         actualArgs.append(durable)
-    if authMechanism:
+    if authMechanism is not None:
         actualArgs.append(authMechanism)
-    if username:
+    if username is not None:
         actualArgs.append(username)
-    if password:
+    if password is not None:
         actualArgs.append(password)
-    if transport:
+    if transport is not None:
         actualArgs.append(transport)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "connect",
@@ -789,11 +789,11 @@
   def queueMoveMessages(self, model, callback, srcQueue, destQueue, qty):
     """Move messages from one queue to another"""
     actualArgs = list()
-    if srcQueue:
+    if srcQueue is not None:
         actualArgs.append(srcQueue)
-    if destQueue:
+    if destQueue is not None:
         actualArgs.append(destQueue)
-    if qty:
+    if qty is not None:
         actualArgs.append(qty)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "queueMoveMessages",
@@ -898,7 +898,7 @@
   def purge(self, model, callback, request):
     """Discard all or some messages on a queue"""
     actualArgs = list()
-    if request:
+    if request is not None:
         actualArgs.append(request)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "purge",
@@ -1093,23 +1093,23 @@
   def bridge(self, model, callback, durable, src, dest, key, tag, excludes, srcIsQueue, srcIsLocal, dynamic):
     """Bridge messages over the link"""
     actualArgs = list()
-    if durable:
+    if durable is not None:
         actualArgs.append(durable)
-    if src:
+    if src is not None:
         actualArgs.append(src)
-    if dest:
+    if dest is not None:
         actualArgs.append(dest)
-    if key:
+    if key is not None:
         actualArgs.append(key)
-    if tag:
+    if tag is not None:
         actualArgs.append(tag)
-    if excludes:
+    if excludes is not None:
         actualArgs.append(excludes)
-    if srcIsQueue:
+    if srcIsQueue is not None:
         actualArgs.append(srcIsQueue)
-    if srcIsLocal:
+    if srcIsLocal is not None:
         actualArgs.append(srcIsLocal)
-    if dynamic:
+    if dynamic is not None:
         actualArgs.append(dynamic)
     originalId = ObjectId(None, self.sourceScopeId, self.sourceObjectId)
     model.callMethod(self.managedBroker, originalId, self.qmfClassKey, "bridge",




More information about the rhmessaging-commits mailing list