Repository : http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
commit d0a8482ba935c510e9e51e6e97bf82cfd04aaa91 Author: Peter Hatina phatina@redhat.com Date: Fri Feb 14 10:07:15 2014 +0100
make synchro-calls available to all methods, which return a job
cli/lmi/shell/LMIClass.py | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/cli/lmi/shell/LMIClass.py b/cli/lmi/shell/LMIClass.py index f156cf6..f8a0a69 100644 --- a/cli/lmi/shell/LMIClass.py +++ b/cli/lmi/shell/LMIClass.py @@ -315,9 +315,14 @@ class LMIClass(LMIWrapperBaseObject): """ (class_names, _, _) = self._conn._client._get_class_names(self.namespace) methods_lst = self._cim_class.methods.keys() - for method in self._cim_class.methods.keys(): - if "__MethodParameters_" + method in class_names: - methods_lst.append("Sync" + method) + # Iterate through a list of all CIM methods and append any method which + # can be called in the synchronous way. One type of such method is the + # method, which has its "counterpart" class __MethodParameters_<Method>. + # The other one is the method, which defines a Job return paremeter. + for (name, method) in self._cim_class.methods.iteritems(): + if "__MethodParameters_" + name in class_names or \ + "Job" in method.parameters: + methods_lst.append("Sync" + name) return methods_lst
cura-tools-devel@lists.fedorahosted.org