From 3f242c9592c683076e80a5aa9360e1457f7076ec Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Tue, 14 Aug 2012 12:12:27 -0700 Subject: 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 --- nova/compute/manager.py | 4 ++-- 1 file 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: -- cgit