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
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: