summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorRick Harris <rick.harris@rackspace.com>2011-05-18 15:14:24 -0500
committerRick Harris <rick.harris@rackspace.com>2011-05-18 15:14:24 -0500
commitd44a4728c23cebd1eaa7615c3b439e44972750cc (patch)
tree59113328d73834ef8ad30f10c0c1060817f4f1da /nova/api
parent01f7b0aa8de984baa27be50171526696aac48c0c (diff)
downloadnova-d44a4728c23cebd1eaa7615c3b439e44972750cc.tar.gz
nova-d44a4728c23cebd1eaa7615c3b439e44972750cc.tar.xz
nova-d44a4728c23cebd1eaa7615c3b439e44972750cc.zip
On second thought, removing decorator
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/zones.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/nova/api/openstack/zones.py b/nova/api/openstack/zones.py
index 145b24347..af73d8f6d 100644
--- a/nova/api/openstack/zones.py
+++ b/nova/api/openstack/zones.py
@@ -52,14 +52,6 @@ def _scrub_zone(zone):
'deleted', 'deleted_at', 'updated_at'))
-def check_encryption_key(func):
- def wrapped(*args, **kwargs):
- if not FLAGS.build_plan_encryption_key:
- raise exception.FlagNotSet(flag='build_plan_encryption_key')
- return func(*args, **kwargs)
- return wrapped
-
-
class Controller(common.OpenstackController):
_serialization_metadata = {
@@ -117,7 +109,6 @@ class Controller(common.OpenstackController):
zone = api.zone_update(context, zone_id, env["zone"])
return dict(zone=_scrub_zone(zone))
- @check_encryption_key
def select(self, req):
"""Returns a weighted list of costs to create instances
of desired capabilities."""
@@ -138,6 +129,9 @@ class Controller(common.OpenstackController):
"""Remove all the confidential data and return a sanitized
version of the build plan. Include an encrypted full version
of the weighting entry so we can get back to it later."""
+ if not FLAGS.build_plan_encryption_key:
+ raise exception.FlagNotSet(flag='build_plan_encryption_key')
+
encryptor = crypto.encryptor(FLAGS.build_plan_encryption_key)
cooked = []
for entry in build_plan: