Author: justi9
Date: 2008-02-27 16:04:57 -0500 (Wed, 27 Feb 2008)
New Revision: 1733
Modified:
mgmt/cumin/python/cumin/broker.py
mgmt/cumin/python/cumin/model.py
Log:
Change the add model method to require a None object arg and to return
the newly created object.
Change the broker add form accordingly.
Modified: mgmt/cumin/python/cumin/broker.py
===================================================================
--- mgmt/cumin/python/cumin/broker.py 2008-02-27 20:41:15 UTC (rev 1732)
+++ mgmt/cumin/python/cumin/broker.py 2008-02-27 21:04:57 UTC (rev 1733)
@@ -651,7 +651,7 @@
"port": port
}
- reg = BrokerRegistration()
+ reg = action.invoke(None, args);
if len(groups) > i:
group = groups[i]
@@ -659,8 +659,6 @@
if group:
reg.addBrokerGroup(group)
- action.invoke(reg, args);
-
self.process_cancel(session, model)
# XXX I would like to move this to brokergroup.py, once I fix the
Modified: mgmt/cumin/python/cumin/model.py
===================================================================
--- mgmt/cumin/python/cumin/model.py 2008-02-27 20:41:15 UTC (rev 1732)
+++ mgmt/cumin/python/cumin/model.py 2008-02-27 21:04:57 UTC (rev 1733)
@@ -95,7 +95,7 @@
try:
try:
- self.do_invoke(object, args, completion)
+ return self.do_invoke(object, args, completion)
except Exception, e:
invoc.status = "failed"
invoc.exception = e
@@ -305,16 +305,16 @@
return "Add"
def do_invoke(self, object, args, completion):
+ assert object is None
+
try:
- if not object:
- object = self.cumin_class.mint_class()
+ object = self.cumin_class.mint_class(**args)
- object.set(**args)
- object.syncUpdate()
-
self.model.app.broker_connect_thread.prompt()
completion("OK")
+
+ return object
except Exception, e:
completion(e.message or "failed")
Show replies by date