Merge "Don't fail getting flavors if extra_specs is off"

This commit is contained in:
Jenkins 2016-05-11 15:44:16 +00:00 committed by Gerrit Code Review
commit 2a0c4c7bb8

View File

@ -1373,8 +1373,14 @@ class OpenStackCloud(object):
flavor.extra_specs = flavor.get(
'OS-FLV-WITH-EXT-SPECS:extra_specs')
elif get_extra:
flavor.extra_specs = self.manager.submitTask(
_tasks.FlavorGetExtraSpecs(id=flavor.id))
try:
flavor.extra_specs = self.manager.submitTask(
_tasks.FlavorGetExtraSpecs(id=flavor.id))
except keystoneauth1.exceptions.http.HttpError as e:
flavor.extra_specs = []
self.log.debug(
'Fetching extra specs for flavor failed:'
' {msg}'.format(msg=str(e)))
return _utils.normalize_flavors(flavors)