Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
---------------------------------------------------------------
commit 2be055dbbac25124193066d5896eceff50144b48
Author: Peter Hatina <phatina(a)redhat.com>
Date: Fri Jul 19 12:22:40 2013 +0200
replace wrong check in _LmiInstance::push() with lmi_return_val_if_fail decorator
---------------------------------------------------------------
cli-tools/lmi/lmi_client_shell.py | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/cli-tools/lmi/lmi_client_shell.py b/cli-tools/lmi/lmi_client_shell.py
index cff35f2..a611d11 100644
--- a/cli-tools/lmi/lmi_client_shell.py
+++ b/cli-tools/lmi/lmi_client_shell.py
@@ -2456,6 +2456,14 @@ class _LmiInstance(BaseObject):
rval = False, \
errorstr = "This instance has been deleted from a CIM broker") \
)
+ @lmi_return_val_if_fail(lambda obj: obj._cim_instance.path, \
+ LmiReturnValue( \
+ rval = False, \
+ errorstr = "Can't push this instance", \
+ use_display_hook = True, \
+ hostname = lambda obj: obj._client.hostname \
+ ) \
+ )
def push(self):
"""
Pushes the modified object to the CIMOM. Returns LmiReturnValue with rval set to
@@ -2465,21 +2473,14 @@ class _LmiInstance(BaseObject):
Note: If the method _LmiInstance.delete() was called, this method will not
execute
its code and will return LmiReturnValue containing None as a return value.
"""
- if not self._lmi_class._namespace:
- return LmiReturnValue(
- hostname = self._client.hostname,
- use_display_hook = True,
- rval = False,
- errorstr = "Can't push this instance"
- )
- return_value = self._client._modify_instance(self._cim_instance)
+ (rval, rparams, errorstr) = self._client._modify_instance(self._cim_instance)
return LmiReturnValue(
hostname = self._client.hostname,
instance = self._cim_instance,
use_display_hook = True,
- rval = return_value.rval,
- rparams = return_value.rparams,
- errorstr = return_value.errorstr)
+ rval = rval,
+ rparams = rparams,
+ errorstr = errorstr)
@lmi_possibly_deleted(None)
@lmi_return_if_fail(lambda obj: obj._lmi_class._namespace)