Don't catch exceptions in quota manager

For these exceptions it is probably safer to actually
raise them and throw a 500. That way a notification
goes out, and we deal with it and potentially rerun the
actions.

The responsibility is on the deployer to correctly configure
the QUOTA_SERVICES setting, and eventually we will also add
checking against the catalog for service types in a given
region.

Change-Id: I3fa6013cb3dd02ae40109a10c79211e55cb73ef8
This commit is contained in:
Adrian Turjak 2018-02-12 15:18:41 +13:00
parent 8d72c920dc
commit 053ec934ce
1 changed files with 3 additions and 14 deletions

View File

@ -232,11 +232,8 @@ class QuotaManager(object):
region_helpers = self.helpers.get(region_id, self.default_helpers)
for name, service in region_helpers.items():
try:
helper = service(region_id, self.project_id)
current_usage[name] = helper.get_usage()
except Exception:
pass
helper = service(region_id, self.project_id)
current_usage[name] = helper.get_usage()
return current_usage
def set_region_quota(self, region_id, quota_dict):
@ -249,15 +246,7 @@ class QuotaManager(object):
service_name)
continue
try:
service_helper = updater_class(region_id, self.project_id)
except Exception:
# NOTE(amelia): We will assume if there are issues connecting
# to a service that it will be due to the
# service not existing in this region.
notes.append("Couldn't access %s client, region %s" %
(service_name, region_id))
continue
service_helper = updater_class(region_id, self.project_id)
service_helper.set_quota(values)
return notes