Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
---------------------------------------------------------------
commit 4059d9d468124792323aa0db642150b11e701b55
Author: Peter Hatina <phatina(a)redhat.com>
Date: Fri Sep 20 14:30:57 2013 +0200
make instance refreshing after method call optional
---------------------------------------------------------------
cli/lmi/shell/LMIMethod.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/cli/lmi/shell/LMIMethod.py b/cli/lmi/shell/LMIMethod.py
index 80f422e..92faf65 100644
--- a/cli/lmi/shell/LMIMethod.py
+++ b/cli/lmi/shell/LMIMethod.py
@@ -351,8 +351,14 @@ class LMIMethod(LMIWrapperBaseObject):
Arguments:
method_args -- dictionary containing CIMMethod arguments
kwargs -- CIMMethod keyword arguments (method_args preffered)
+
+ Keyword Arguments:
+ RefreshInstance -- bool flag, which tells the LMIShell, whether
+ the instance should be refreshed after a method call. Default
+ value is False.
"""
synchro_method_polling = kwargs.pop("PreferPolling", False)
+ refresh_requested = kwargs.pop("RefreshInstance", False)
if method_args is None:
method_args = {}
method_args.update(kwargs)
@@ -408,7 +414,7 @@ class LMIMethod(LMIWrapperBaseObject):
lmi_raise_or_dump_exception(e)
return LMIReturnValue(rval=-1, errorstr=e.message)
call_rparams = lmi_transform_to_lmi(self._conn, call_rparams)
- if not self._lmi_instance.refresh():
+ if refresh_requested and not self._lmi_instance.refresh():
# NOTE: this is wrong! What should we do?
errorstr = "Could not update an LMI object after a method call"
lmi_raise_or_dump_exception(LMIMethodCallError(errorstr))