Merge "Fix uncaught DB exception when trying to get a spare amphora"
This commit is contained in:
commit
e0ae8a3cac
@ -529,10 +529,17 @@ class MapLoadbalancerToAmphora(BaseDatabaseTask):
|
|||||||
else:
|
else:
|
||||||
amp_az = CONF.nova.availability_zone
|
amp_az = CONF.nova.availability_zone
|
||||||
|
|
||||||
|
try:
|
||||||
amp = self.amphora_repo.allocate_and_associate(
|
amp = self.amphora_repo.allocate_and_associate(
|
||||||
db_apis.get_session(),
|
db_apis.get_session(),
|
||||||
loadbalancer_id,
|
loadbalancer_id,
|
||||||
amp_az)
|
amp_az)
|
||||||
|
except Exception as e:
|
||||||
|
LOG.error("Failed to get a spare amphora (AZ: {}) for "
|
||||||
|
"loadbalancer {} due to: {}".format(
|
||||||
|
amp_az, loadbalancer_id, e))
|
||||||
|
return None
|
||||||
|
|
||||||
if amp is None:
|
if amp is None:
|
||||||
LOG.debug("No Amphora available for load balancer with id %s",
|
LOG.debug("No Amphora available for load balancer with id %s",
|
||||||
loadbalancer_id)
|
loadbalancer_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user