summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2012-08-14 12:12:27 -0700
committerVishvananda Ishaya <vishvananda@gmail.com>2012-08-14 12:18:25 -0700
commit3f242c9592c683076e80a5aa9360e1457f7076ec (patch)
treed3d0be5c6a052640b41da59c5272f075cc847333
parent9deb489a8ba5ca2417787ba5e5429a60cf1712c2 (diff)
Return values from wrapped functions in decorators
Calling compute manager methods requires that the decorators return the value from the underlying function. This doesn't actually change any return values from methods, because all existing methods effectively return None. Fixes bug 1036793 Change-Id: I64eea506ee1395678a7de3c6963a3da8e40d6962
-rw-r--r--nova/compute/manager.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index fe2040d1b..dfa4cf0a1 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -180,7 +180,7 @@ def checks_instance_lock(function):
# if admin or unlocked call function otherwise log error
if admin or not locked:
- function(self, context, *args, **kwargs)
+ return function(self, context, *args, **kwargs)
else:
LOG.error(_("check_instance_lock: not executing |%s|"),
function, context=context, instance_uuid=instance_uuid)
@@ -200,7 +200,7 @@ def reverts_task_state(function):
instance_uuid = kwargs['instance_uuid']
try:
- function(self, context, *args, **kwargs)
+ return function(self, context, *args, **kwargs)
except Exception:
with excutils.save_and_reraise_exception():
try: