summaryrefslogtreecommitdiffstats
path: root/src/software/lmi/software/core/Job.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/software/lmi/software/core/Job.py')
-rw-r--r--src/software/lmi/software/core/Job.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/software/lmi/software/core/Job.py b/src/software/lmi/software/core/Job.py
index b3ccd5d..0bf6faa 100644
--- a/src/software/lmi/software/core/Job.py
+++ b/src/software/lmi/software/core/Job.py
@@ -469,18 +469,20 @@ def make_method_params(job, class_name, include_input, include_output):
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 = util.new_instance_name(clsname)
- inst = pywbem.CIMInstance(classname=clsname, path=path)
+ path = util.new_instance_name(class_name)
+ inst = pywbem.CIMInstance(classname=class_name, path=path)
if include_input and "input_params" in job.metadata:
for (name, value) in job.metadata["input_params"].items():
inst[name] = value
if include_output:
if isinstance(job, jobs.YumCheckPackage):
# make sure, that output parameters are computed
- get_verification_out_params(job)
+ # TODO: uncomment this, when pegasus properly handles instances
+ # of unknown classes - we can not create Failed property, which
+ # is an array of references in association class representing
+ # result of asynchronous method
+ #get_verification_out_params(job)
+ pass
if "output_params" in job.metadata:
# overwrite any input parameter
for (name, value) in job.metadata["output_params"].iteritems():
@@ -585,12 +587,15 @@ def _fill_nonkeys(job, model):
type='uint16', value=None)
model['OperationalStatus'] = [Values.OperationalStatus.Unknown]
model['JobStatus'] = 'Unknown'
- model["JobInParameters"] = make_method_params(
- job, "__JobInParameters", True, False)
+ # TODO: uncomment this, when Pegasus propertly supports instances of
+ # unknown classes
+ #model["JobInParameters"] = make_method_params(
+ # job, "__JobInParameters", True, False)
+ method_name = JOB_METHOD_NAMES[job.metadata["method"]]
model["JobOutParameters"] = make_method_params(
- job, "__JobOutParameters", False, True)
+ job, "__MethodParameters_"+method_name+"_Result", False, True)
if 'method' in job.metadata:
- model['MethodName'] = JOB_METHOD_NAMES[job.metadata["method"]]
+ model['MethodName'] = method_name
else:
model["MethodName"] = pywbem.CIMProperty('MethodName',
type='string', value=None)
@@ -655,6 +660,7 @@ def job2model(job, class_name=None, keys_only=True, model=None):
model['InstanceID'] = 'LMI:%s:%d' % (class_name, jobid)
if isinstance(model, pywbem.CIMInstance):
model.path['InstanceID'] = model['InstanceID'] #pylint: disable=E1103
+
if not keys_only:
_fill_nonkeys(job, model)
return model