diff options
| author | Ryan Lane <rlane@wikimedia.org> | 2011-01-20 01:34:54 +0000 |
|---|---|---|
| committer | Ryan Lane <rlane@wikimedia.org> | 2011-01-20 01:34:54 +0000 |
| commit | 36681f096574e5fdab26e6167a39e87df0f92fd4 (patch) | |
| tree | a66de5881c4acd2bd0699d337690b0335810589f | |
| parent | 4203bba809eec90dd8a176c2d4f8869ae748e8bc (diff) | |
| download | nova-36681f096574e5fdab26e6167a39e87df0f92fd4.tar.gz nova-36681f096574e5fdab26e6167a39e87df0f92fd4.tar.xz nova-36681f096574e5fdab26e6167a39e87df0f92fd4.zip | |
Passing in an elevated context instead of making the call non-elevated.
| -rw-r--r-- | nova/api/ec2/cloud.py | 2 | ||||
| -rw-r--r-- | nova/db/sqlalchemy/api.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index c94540793..a64c9fed8 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -133,7 +133,7 @@ class CloudController(object): return result def _get_availability_zone_by_host(self, context, host): - services = db.service_get_all_by_host(context, host) + services = db.service_get_all_by_host(context.elevated(), host) if len(services) > 0: return services[0]['availability_zone'] return 'unknown zone' diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 9825764bf..7b965f672 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -156,7 +156,7 @@ def service_get_all_by_topic(context, topic): all() -@require_context +@require_admin_context def service_get_all_by_host(context, host): session = get_session() return session.query(models.Service).\ |
