summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Bringard <kbringard@attinteractive.com>2011-06-17 17:12:50 +0000
committerTarmac <>2011-06-17 17:12:50 +0000
commit8e5b4ff6d53300ee03e3ef3b39f23d9b448c9471 (patch)
treebdb7b591b2c89766456acc7cfe289a0c2875cb0a
parent9152140e761786f7ac19ceac822a1d091684bc42 (diff)
parent6ce8a156ea4a40190dd2a71eeba67a101ae7370d (diff)
Updated "get_all_across_zones" in nova/compute/api.py to have "context = context.elevated()", allowing it to be run by non-admin users
-rw-r--r--nova/api/openstack/__init__.py3
-rw-r--r--nova/api/openstack/create_instance_helper.py7
-rw-r--r--nova/compute/api.py1
3 files changed, 4 insertions, 7 deletions
diff --git a/nova/api/openstack/__init__.py b/nova/api/openstack/__init__.py
index ddd9580d7..f24017df0 100644
--- a/nova/api/openstack/__init__.py
+++ b/nova/api/openstack/__init__.py
@@ -113,8 +113,7 @@ class APIRouter(base_wsgi.Router):
collection={'detail': 'GET',
'info': 'GET',
'select': 'POST',
- 'boot': 'POST'
- })
+ 'boot': 'POST'})
mapper.resource("console", "consoles",
controller=consoles.create_resource(),
diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py
index fbc6318ef..2501ed9fe 100644
--- a/nova/api/openstack/create_instance_helper.py
+++ b/nova/api/openstack/create_instance_helper.py
@@ -121,8 +121,7 @@ class CreateInstanceHelper(object):
extra_values = {
'instance_type': inst_type,
'image_ref': image_href,
- 'password': password
- }
+ 'password': password}
return (extra_values,
create_method(context,
@@ -138,9 +137,7 @@ class CreateInstanceHelper(object):
injected_files=injected_files,
admin_password=password,
zone_blob=zone_blob,
- reservation_id=reservation_id
- )
- )
+ reservation_id=reservation_id))
except quota.QuotaError as error:
self._handle_quota_error(error)
except exception.ImageNotFound as error:
diff --git a/nova/compute/api.py b/nova/compute/api.py
index e2c4cf8d7..f1c31a092 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -526,6 +526,7 @@ class API(base.Base):
"""Get all instances with this reservation_id, across
all available Zones (if any).
"""
+ context = context.elevated()
instances = self.db.instance_get_all_by_reservation(
context, reservation_id)