Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
---------------------------------------------------------------
commit aad139f3bb44177eb4f6cc78e9c90b48d674a54f
Author: Peter Hatina <phatina(a)redhat.com>
Date: Tue Aug 6 10:40:34 2013 +0200
code cleanup, drop _return_value in LMIConnection::subscribe_indication()
---------------------------------------------------------------
cli/lmi/shell/LMIConnection.py | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/cli/lmi/shell/LMIConnection.py b/cli/lmi/shell/LMIConnection.py
index dec3f6c..c1ecaea 100644
--- a/cli/lmi/shell/LMIConnection.py
+++ b/cli/lmi/shell/LMIConnection.py
@@ -231,7 +231,6 @@ class LMIConnection(object):
Destination -- string representing destination uri, where the indications
should
be delivered
"""
- _return_value = lambda rval, errorstr="": LMIReturnValue(rval=rval,
errorstr=errorstr)
try:
cim_filter_provided = "Filter" in kwargs
if cim_filter_provided:
@@ -244,7 +243,7 @@ class LMIConnection(object):
else:
errorstr = "Filter argument accepts instances of CIMInstance or
LMIInstance"
lmi_raise_or_dump_exception(LMIIndicationError(errorstr))
- return _return_value(False, errorstr)
+ return LMIReturnValue(rval=False, errorstr=errorstr)
else:
cim_filter_props = {
"CreationClassName" :
kwargs["FilterCreationClassName"],
@@ -260,7 +259,7 @@ class LMIConnection(object):
cim_filter_props)
if not cim_filter:
lmi_raise_or_dump_exception(LMIIndicationError(errorstr))
- return _return_value(False, errorstr)
+ return LMIReturnValue(rval=False, errorstr=errorstr)
cim_handler_provided = "Handler" in kwargs
if cim_handler_provided:
cim_handler = kwargs["Handler"]._cim_instance
@@ -279,7 +278,7 @@ class LMIConnection(object):
if not "Filter" in kwargs:
self._client._delete_instance(cim_filter.path)
lmi_raise_or_dump_exception(LMIIndicationError(errorstr))
- return _return_value(False, errorstr)
+ return LMIReturnValue(rval=False, errorstr=errorstr)
cim_subscription_props = {
"Filter" : cim_filter.path,
"Handler" : cim_handler.path
@@ -293,7 +292,7 @@ class LMIConnection(object):
if not "Handler" in kwargs:
self._client._delete_instance(cim_handler.path)
lmi_raise_or_dump_exception(LMIIndicationError(errorstr))
- return _return_value(False, errorstr)
+ return LMIReturnValue(rval=False, errorstr=errorstr)
# XXX: Should we auto-delete all the indications?
permanent = lmi_get_item_or_default(kwargs, "Permanent", True)
self._indications[kwargs["Name"]] = LMISubscription(
@@ -305,8 +304,8 @@ class LMIConnection(object):
except KeyError, e:
errorstr = "Not all necessary parameters provided, missing: %s" %
e
lmi_raise_or_dump_exception(LMIIndicationError(errorstr))
- return _return_value(False, errorstr)
- return _return_value(True)
+ return LMIReturnValue(rval=False, errorstr=errorstr)
+ return LMIReturnValue(rval=True)
def unsubscribe_indication(self, name):
"""