Author: justi9
Date: 2010-06-07 17:33:00 -0400 (Mon, 07 Jun 2010)
New Revision: 4014
Modified:
mgmt/newdata/cumin/python/cumin/session.py
Log:
A new approach to making a method call
Modified: mgmt/newdata/cumin/python/cumin/session.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/session.py 2010-06-07 17:36:52 UTC (rev 4013)
+++ mgmt/newdata/cumin/python/cumin/session.py 2010-06-07 21:33:00 UTC (rev 4014)
@@ -57,18 +57,24 @@
def call_method(self, callback, obj, name, args):
assert isinstance(obj, RosemaryObject)
+
+ agent = self.qmf_session._getAgentForAgentAddr(obj._qmf_agent_id)
+
+ assert agent
+
+ oid = ObjectId({"_agent_name": obj._qmf_agent_id,
+ "_object_name": obj._qmf_object_id})
+
+ objs = agent.getObjects(_objectId=oid)
- oid_args = {"_agent_name": obj._qmf_agent_id,
- "_object_name": obj._qmf_object_id}
+ try:
+ obj = objs[0]
+ except IndexError:
+ raise Exception("XXX no object!")
- broker = self.qmf_brokers[0]
- ck = ClassKey(obj._qmf_class_key)
- oid = ObjectId(oid_args)
-
self.lock.acquire()
try:
- seq = self.qmf_session._sendMethodRequest \
- (broker, ck, oid, name, args)
+ seq = obj._invoke(name, args, {"_async": True})
if seq is not None:
self.outstanding_method_calls[seq] = callback
Show replies by date