From: Xing Yang Date: Tue, 18 Aug 2015 18:13:36 +0000 (-0400) Subject: Create CG needs extra specs X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=eec3512f66e9771ede5443ec374a595281517108;p=openstack-build%2Fcinder-build.git Create CG needs extra specs Get volume types no longer returns extra specs for non-admin users. This breaks CG creation which needs extra specs. This patch fixes it by elevating the context when getting volume types for CG creation. Change-Id: I610149e8bf9a067f78a9ad52eb02b2da41dc64f6 Closes-Bug: #1495758 --- diff --git a/cinder/consistencygroup/api.py b/cinder/consistencygroup/api.py index 77d1d7f7c..ebf4d8cc8 100644 --- a/cinder/consistencygroup/api.py +++ b/cinder/consistencygroup/api.py @@ -115,8 +115,9 @@ class API(base.Base): volume_type_list = cg_volume_types.split(',') req_volume_types = [] + # NOTE: Admin context is required to get extra_specs of volume_types. req_volume_types = (self.db.volume_types_get_by_name_or_id( - context, volume_type_list)) + context.elevated(), volume_type_list)) req_volume_type_ids = "" for voltype in req_volume_types: