From a509710a7faf5c643377d1593a2591d37f3e8390 Mon Sep 17 00:00:00 2001 From: Gregory Thiemonge Date: Wed, 17 Apr 2019 10:46:07 +0200 Subject: [PATCH] Fix spare amphora failover Failover of spare amphorae failed with an exception, because they're not attached to any loadbalancer. This commit fixes this issue, allowing to rotate/update spare amphora images. Story: 2005470 Task: 30549 Change-Id: I9c9002486a9a547a215514c24ccb95f039b23ec2 --- octavia/controller/worker/controller_worker.py | 2 +- .../notes/fixed-spare-amphora-rotation-007ba406411a313d.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/fixed-spare-amphora-rotation-007ba406411a313d.yaml diff --git a/octavia/controller/worker/controller_worker.py b/octavia/controller/worker/controller_worker.py index b428132986..4c011e2ff5 100644 --- a/octavia/controller/worker/controller_worker.py +++ b/octavia/controller/worker/controller_worker.py @@ -823,7 +823,7 @@ class ControllerWorker(base_taskflow.BaseTaskFlowEngine): db_apis.get_session(), amp.id) if CONF.nova.enable_anti_affinity and lb: stored_params[constants.SERVER_GROUP_ID] = lb.server_group_id - if lb.flavor_id: + if lb and lb.flavor_id: stored_params[constants.FLAVOR] = ( self._flavor_repo.get_flavor_metadata_dict( db_apis.get_session(), lb.flavor_id)) diff --git a/releasenotes/notes/fixed-spare-amphora-rotation-007ba406411a313d.yaml b/releasenotes/notes/fixed-spare-amphora-rotation-007ba406411a313d.yaml new file mode 100644 index 0000000000..9c337376f9 --- /dev/null +++ b/releasenotes/notes/fixed-spare-amphora-rotation-007ba406411a313d.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fixed a bug that prevents spare amphora rotation.