Repository : http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
commit fbe7401351d53fabf03c632bb72d4cf4589cc13d Author: Peter Hatina phatina@redhat.com Date: Wed Feb 13 12:39:15 2013 +0100
fix _LmiInstanceMethod::__call__ errorstr propagation
cli-tools/lmi/lmi_client_shell.py | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/cli-tools/lmi/lmi_client_shell.py b/cli-tools/lmi/lmi_client_shell.py index e089a94..a40ab0f 100644 --- a/cli-tools/lmi/lmi_client_shell.py +++ b/cli-tools/lmi/lmi_client_shell.py @@ -546,34 +546,34 @@ class _LmiInstanceMethod(BaseObject): return LmiReturnValue(rval = -1, rparams = {}, errorstr = errorstr, hostname = self._client.hostname, use_display_hook = True) - (rval, rparams, errorstr) = self._client._call_method_raw(self._lmi_instance, + (rval, call_rparams, call_errorstr) = self._client._call_method_raw(self._lmi_instance, self._method.name, **kwargs) if isinstance(rval, pywbem.CIMInt): rval = int(rval) elif isinstance(rval, pywbem.CIMFloat): rval = float(rval) - if rparams: - rparams = self.__transform_return_values(rparams) - if not rparams: + if call_rparams: + call_rparams = self.__transform_return_values(call_rparams) + if not call_rparams: # NOTE: this is wrong! What should we do? if LmiBaseClient._get_use_exceptions(): raise LmiMethodCallError("Could not perform CIM -> LMI object transformation") return LmiReturnValue(rval = rval, rparams = {}, errorstr = errorstr) - (new_inst, _, errorstr) = self._client._get_instance( + (new_inst, _, inst_errorstr) = self._client._get_instance( self._lmi_instance.path, LocalOnly = False) if not new_inst: # NOTE: this is wrong! What should we do? if LmiBaseClient._get_use_exceptions(): raise LmiMethodCallError("Could not update an LMI object after a method call") - return LmiReturnValue(rval = rval, rparams = {}, errorstr = errorstr) + return LmiReturnValue(rval = rval, rparams = {}, errorstr = inst_errorstr) self._lmi_instance._cim_instance = new_inst return LmiReturnValue( hostname = self._client.hostname, instance = self._lmi_instance, use_display_hook = True, rval = rval, - rparams = rparams, - errorstr = errorstr) + rparams = call_rparams, + errorstr = call_errorstr)
@property def return_type(self):
cura-tools-devel@lists.fedorahosted.org