Merge "Fix using host_routes in VIP subnet with amphorav2" into stable/ussuri

This commit is contained in:
Zuul 2021-10-13 19:27:58 +00:00 committed by Gerrit Code Review
commit 178481be9a
3 changed files with 14 additions and 2 deletions

View File

@ -13,6 +13,7 @@
# under the License.
#
import copy
from cryptography import fernet
from oslo_config import cfg
from oslo_log import log as logging
@ -334,8 +335,9 @@ class AmphoraPostVIPPlug(BaseAmphoraTask):
**amphorae_network_config[
amphora.get(constants.ID)][constants.VRRP_PORT])
# Required for noop-case
vip_arg = amphorae_network_config[amphora.get(
constants.ID)][constants.VIP_SUBNET]
vip_arg = copy.deepcopy(
amphorae_network_config[
amphora.get(constants.ID)][constants.VIP_SUBNET])
if vip_arg:
host_routes = vip_arg.get('host_routes')
if host_routes:

View File

@ -630,6 +630,11 @@ class TestAmphoraDriverTasks(base.TestCase):
self.assertEqual(hr1['destination'], hr2.destination)
self.assertEqual(hr1['nexthop'], hr2.nexthop)
self.assertEqual(
host_routes,
amphorae_net_config_mock[AMP_ID][
constants.VIP_SUBNET]['host_routes'])
@mock.patch('octavia.db.repositories.LoadBalancerRepository.update')
@mock.patch('octavia.db.repositories.LoadBalancerRepository.get')
def test_amphorae_post_vip_plug(self, mock_lb_get,

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fix a serialization error when using host_routes in VIP subnets when
persistence in the amphorav2 driver is enabled.