summaryrefslogtreecommitdiff
path: root/nova/context.py
diff options
context:
space:
mode:
authorJoe Gordon <jogo@cloudscaling.com>2013-01-22 13:21:57 -0500
committerJoe Gordon <jogo@cloudscaling.com>2013-01-28 13:40:42 -0800
commit9983d07d056f064da96fe46790573be7ff90677f (patch)
tree4d32f01f7fc0582a6c9d858927cdd65207ab423c /nova/context.py
parentf5a5ba84757a85836d78cc3d8a4f62f5ada2ac65 (diff)
downloadnova-9983d07d056f064da96fe46790573be7ff90677f.tar.gz
Stop including full service catalog in each RPC msg
The service catalog is included in the context to get the cinder API endpoints. Instead of passing entire service catalog just for cinder endpoint, just include cinder endpoint in context.service_catalog Change-Id: Ic39173f0a2f330dbd78daa786b269f29ac4abf33
Diffstat (limited to 'nova/context.py')
-rw-r--r--nova/context.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/nova/context.py b/nova/context.py
index 1a566cb5a6..8731e012d0 100644
--- a/nova/context.py
+++ b/nova/context.py
@@ -46,7 +46,7 @@ class RequestContext(object):
roles=None, remote_address=None, timestamp=None,
request_id=None, auth_token=None, overwrite=True,
quota_class=None, user_name=None, project_name=None,
- service_catalog=None, instance_lock_checked=False, **kwargs):
+ service_catalog=[], instance_lock_checked=False, **kwargs):
"""
:param read_deleted: 'no' indicates deleted records are hidden, 'yes'
indicates deleted records are visible, 'only' indicates that
@@ -79,7 +79,9 @@ class RequestContext(object):
request_id = generate_request_id()
self.request_id = request_id
self.auth_token = auth_token
- self.service_catalog = service_catalog
+ # Only include required parts of service_catalog
+ self.service_catalog = [s for s in service_catalog
+ if s.get('type') in ('volume')]
self.instance_lock_checked = instance_lock_checked
# NOTE(markmc): this attribute is currently only used by the