Fix is_dvr_enabled method when OVN is configured

The configuration parameter that provides the information about DVR when
ML2/OVN is used is different from the parameter used by ML2/OVS.
1) In case of OVS:
/etc/neutron/neutron.conf
[DEFAULT]
enable_dvr
2) In case of OVN:
/etc/neutron/plugins/ml2/ml2_conf.ini
[ovn]
enable_distributed_floating_ip

Change-Id: Id5e099a3fea21261339e049b53063613ea4667c2
This commit is contained in:
Eduardo Olivares 2023-10-02 12:16:28 +02:00
parent 6009ff1e79
commit f5796f650f

View File

@ -451,8 +451,16 @@ def setup_overcloud_keystone_credentials():
def is_dvr_enabled():
controller0 = topology.list_openstack_nodes(group='controller')[0]
container_runtime = tripleo.get_container_runtime_name()
command = (f"{container_runtime} exec neutron_api crudini --get "
"/etc/neutron/neutron.conf DEFAULT enable_dvr")
neutron_crudini_get = f"{container_runtime} exec neutron_api crudini --get"
if neutron.has_ovn():
filename = "/etc/neutron/plugins/ml2/ml2_conf.ini"
section = "ovn"
param = "enable_distributed_floating_ip"
else:
filename = "/etc/neutron/neutron.conf"
section = "DEFAULT"
param = "enable_dvr"
command = ' '.join((neutron_crudini_get, filename, section, param))
enable_dvr = sh.execute(command,
ssh_client=controller0.ssh_client,
sudo=True).stdout.lower()