diff options
-rw-r--r-- | src/python/lmi/providers/JobManager.py | 38 |
1 files changed, 25 insertions, 13 deletions
diff --git a/src/python/lmi/providers/JobManager.py b/src/python/lmi/providers/JobManager.py index 24c909c..a0283fb 100644 --- a/src/python/lmi/providers/JobManager.py +++ b/src/python/lmi/providers/JobManager.py @@ -489,8 +489,10 @@ class Job(object): inst['SourceInstance'] = src_instance inst['SourceInstanceModelPath'] = str(src_instance.path) inst['MethodName'] = self.method_name - inst['MethodParameters'] = self.get_method_params( - '__MethodParameters', True, False) + # TODO: uncomment when Pegasus can correctly handle instances + # of unregistered classes + # inst['MethodParameters'] = self.get_method_params( + # '__MethodParameters', True, False) inst['PreCall'] = True return inst @@ -532,8 +534,13 @@ class Job(object): inst['SourceInstance'] = src_instance inst['SourceInstanceModelPath'] = str(src_instance.path) inst['MethodName'] = self.method_name - inst['MethodParameters'] = self.get_method_params( - '__MethodParameters', True, True) + # TODO: add input parameters too when Pegasus can correctly handle + # instances of unregistered classes + # TODO: also fix the class name to __MethodParameters + params = self.get_method_params( + '__MethodParameters_' + self.method_name, False, True) + if params: + inst['MethodParameters'] = params inst['PreCall'] = False if self.return_value_type is not None: @@ -569,13 +576,10 @@ class Job(object): included in the returned class :rtype: CIMInstance of the created class. """ - # TODO: this is workaround for bug #920763, use class_name - # when it's fixed - clsname = "CIM_ManagedElement" path = pywbem.CIMInstanceName( - classname=clsname, + classname=class_name, namespace=self.job_manager.namespace) - inst = pywbem.CIMInstance(classname=clsname, path=path) + inst = pywbem.CIMInstance(classname=class_name, path=path) if include_input and self.input_arguments: for (name, value) in self.input_arguments.iteritems(): inst[name] = value @@ -585,6 +589,7 @@ class Job(object): inst[name] = value return inst + @cmpi_logging.trace_method def wait_for_job(self, timeout=None): """ @@ -1084,13 +1089,20 @@ class LMI_ConcreteJob(CIMProvider2): value=None, type='datetime') - if job.input_arguments: - model['JobInParameters'] = job.get_method_params( - "__JobInParameters", True, False) + # TODO: uncomment when Pegasus can correctly handle instances + # of unregistered classes + # if job.input_arguments: + # model['JobInParameters'] = job.get_method_params( + # "__JobInParameters", True, False) if job.job_state in Job.FINAL_STATES: # assemble output parameters with return value - outparams = job.get_method_params("__JobOutParameters", False, True) + # TODO: use __JobOutParameters when Pegasus can create instances + # of unregistered classes + outparams = job.get_method_params( + "__MethodParameters_" + job.method_name + "_Result", + False, + True) if job.return_value is not None: outparams['__ReturnValue'] = job.return_value model['JobOutParameters'] = outparams |