From 28d15c27988df9167779539d043b6e6017da211d Mon Sep 17 00:00:00 2001 From: Bogdan Dobrelya Date: Mon, 5 Dec 2022 16:37:02 +0100 Subject: [PATCH] Also export OVN DBs IPs for multi-stack inputs When cell computes do not have external_ids:ovn-remote configured for OVN, it breaks. Running manually: ovs-vsctl set open . external_ids:ovn-remote="ssl::6642" (or by DBs IPs) fixes it and ovn-controller connects the db and adds the Chassis. Fix multi-cell/multi-stack exports by also exporting ovn_dbs_node_ips. So that when there is no ovn_dbs_vip data in hiera (i.e. no value for t-h-t OVNDBsVirtualFixedIPs), there are still ovn_dbs_node_ips data to have things configured properly for OVN on computes. Change-Id: Ib49156d49a7f8e4544f5b73d15a4ad32dba77c98 Related: rhbz#2137904 Signed-off-by: Bogdan Dobrelya --- tripleoclient/constants.py | 1 + tripleoclient/tests/test_export.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tripleoclient/constants.py b/tripleoclient/constants.py index 0fbe5e0ea..62baa638e 100644 --- a/tripleoclient/constants.py +++ b/tripleoclient/constants.py @@ -250,6 +250,7 @@ EXPORT_DATA = { "oslo_messaging_rpc_node_names", "memcached_node_ips", "ovn_dbs_vip", + "ovn_dbs_node_ips", "redis_vip"]}, } diff --git a/tripleoclient/tests/test_export.py b/tripleoclient/tests/test_export.py index d192351bf..c4d6a7527 100644 --- a/tripleoclient/tests/test_export.py +++ b/tripleoclient/tests/test_export.py @@ -128,13 +128,15 @@ class TestExport(TestCase): working_dir = utils.get_default_working_dir('overcloud') mock_stack_output.side_effect = self._get_stack_saved_output_item self.mock_open = mock.mock_open( - read_data='{"an_key":"an_value","ovn_dbs_vip":"vip"}') + read_data=('{"an_key":"an_value","ovn_dbs_vip":"vip",' + '"ovn_dbs_node_ips":[1,2]}')) with mock.patch('builtins.open', self.mock_open): data = export.export_stack( working_dir, "overcloud", should_filter=True) expected = \ - {'AllNodesExtraMapData': {u'ovn_dbs_vip': u'vip'}, + {'AllNodesExtraMapData': {u'ovn_dbs_vip': u'vip', + u'ovn_dbs_node_ips': [1, 2]}, 'AuthCloudName': 'central', 'EndpointMapOverride': {'em_key': 'em_value'}, 'ExtraHostFileEntries': 'hosts entry',