From 4930af608c6763a41eed4985bb5460a7bf8eb6b9 Mon Sep 17 00:00:00 2001 From: "Carl C. Trieloff" Date: Fri, 14 Dec 2007 20:22:30 +0000 Subject: patch from tross QPID-706 Added implementation for the "Call" command to invoke methods on management objects. Fixed a bug in qpid/management.py caused by replies to methods with no arguments. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@604286 13f79535-47bb-0310-9956-ffa450edef68 --- python/qpid/management.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'python/qpid/management.py') diff --git a/python/qpid/management.py b/python/qpid/management.py index 8373ecceb7..1c8b3cd840 100644 --- a/python/qpid/management.py +++ b/python/qpid/management.py @@ -108,7 +108,7 @@ class ManagementMetadata: configs = [] insts = [] - methods = [] + methods = {} events = [] configs.append (("id", 4, "", "", 1, 1, None, None, None, None, None)) @@ -195,7 +195,7 @@ class ManagementMetadata: arg = (name, type, dir, unit, desc, min, max, maxlen, default) args.append (arg) - methods.append ((mname, mdesc, args)) + methods[mname] = (mdesc, args) self.schema[(className,'C')] = configs @@ -297,18 +297,19 @@ class ManagedBroker: return (userSequence, className, methodName) = data + args = {} if status == 0: ms = self.metadata.schema[(className,'M')] arglist = None - for (mname, mdesc, margs) in ms: + for mname in ms: + (mdesc, margs) = ms[mname] if mname == methodName: arglist = margs if arglist == None: msg.complete () return - args = {} for arg in arglist: if arg[2].find("O") != -1: args[arg[0]] = self.metadata.decodeValue (codec, arg[1]) @@ -379,7 +380,8 @@ class ManagedBroker: ms = self.metadata.schema[(className,'M')] arglist = None - for (mname, mdesc, margs) in ms: + for mname in ms: + (mdesc, margs) = ms[mname] if mname == methodName: arglist = margs if arglist == None: -- cgit v1.2.1