diff options
| author | Trey Morris <trey.morris@rackspace.com> | 2010-12-29 18:34:49 -0600 |
|---|---|---|
| committer | Trey Morris <trey.morris@rackspace.com> | 2010-12-29 18:34:49 -0600 |
| commit | 74785bf8c070bf0760724b3412f4ee1bb05cf72b (patch) | |
| tree | bb41745367c62523a2f7e463e370f39571f6414a | |
| parent | 24e253a1feaa0a39e4095f447f62f7ea9b43c8bb (diff) | |
fixd variables being out of scope in lock decorator
| -rw-r--r-- | nova/compute/api.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index d720a8f2c..073129c13 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -47,6 +47,10 @@ def checks_instance_lock(function): @functools.wraps(function) def decorated_function(*args, **kwargs): + # assume worst case (have to declare so they are in scope) + admin = False + locked = True + # grab args to function try: if 'context' in kwargs: @@ -60,7 +64,7 @@ def checks_instance_lock(function): locked = ComputeAPI().get_lock(context, instance_id) admin = context.is_admin except: - logging.error(_("check_instance_lock: argument error: |%s|, |%s|"), + raise Exception(_("check_instance_lock argument error |%s|, |%s|"), args, kwargs) # if admin or unlocked call function, otherwise 405 |
