Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
---------------------------------------------------------------
commit bd09abb9b7b7a48eb1c062500a881183a0e3ae3e
Author: Peter Hatina <phatina(a)redhat.com>
Date: Wed Oct 23 13:21:53 2013 +0200
fix return value, when JobOutParameters is None
---------------------------------------------------------------
cli/lmi/shell/LMIMethod.py | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/cli/lmi/shell/LMIMethod.py b/cli/lmi/shell/LMIMethod.py
index ea97ae0..034c55d 100644
--- a/cli/lmi/shell/LMIMethod.py
+++ b/cli/lmi/shell/LMIMethod.py
@@ -189,11 +189,14 @@ class LMIMethod(LMIWrapperBaseObject):
# Adjust return value from the job object
if job_refresh:
job_inst.refresh()
- rparams = pywbem.NocaseDict({
+ rval = None
+ rparams = pywbem.NocaseDict()
+ if not job_inst.JobOutParameters is None:
+ rparams = pywbem.NocaseDict({
k: x.value
- for k, x in job_inst.JobOutParameters.properties.iteritems()})
- rval = rparams["__ReturnValue"]
- del rparams["__ReturnValue"] # NocaseDict has no pop()
+ for k, x in job_inst.JobOutParameters.properties.iteritems()})
+ rval = rparams["__ReturnValue"]
+ del rparams["__ReturnValue"] # NocaseDict has no pop()
errorstr = ""
# Is job in exception state? If so, adjust corresponding error string