From fb357bd7edec2ef72e6d655acb5f8b7e8e786a14 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 10 May 2016 11:40:35 -0400 Subject: [PATCH] Don't fail getting flavors if extra_specs is off Clouds can turn off extra specs. They're extra - we should not fail on getting flavors if they're not there. Change-Id: I6352fa2d64d3e92f823004a5b9f4cbfe61f11403 --- shade/openstackcloud.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shade/openstackcloud.py b/shade/openstackcloud.py index f86d4d141..877d8ed8a 100644 --- a/shade/openstackcloud.py +++ b/shade/openstackcloud.py @@ -1359,8 +1359,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)