Make ubuntu VM interface name configurable

Depending on the hypervisor/compute were the Ubuntu VM instances are
spawned, their interface names are created following differnt
conventions. Tobiko decides which is the expected name depending on the
OSP version, but that is not a valid method to decide it in some cases.
This patch allows to configure the expected Ubuntu interface name.

Change-Id: I6d876c73d883dc588360d6f6bc54f952d0fa9e84
This commit is contained in:
Eduardo Olivares 2023-10-27 12:22:48 +02:00
parent 2e5a23e95c
commit bb712907d4
2 changed files with 6 additions and 0 deletions

View File

@ -58,6 +58,9 @@ def get_images_options():
help="Default " + name + " username"),
cfg.StrOpt('password',
help="Default " + name + " password"),
cfg.StrOpt('interface_name',
default=None,
help="Default " + name + " interface name"),
cfg.FloatOpt('connection_timeout',
default=None,
help=("Default " + name +

View File

@ -134,6 +134,9 @@ class UbuntuImageFixture(UbuntuMinimalImageFixture,
"""From OSP17 and above, Ubuntu stack should use a different interface name.
This method returns the interface name, depending on the OSP version.
"""
if_name = CONF.tobiko.ubuntu.interface_name
if if_name is not None:
return if_name
from tobiko import tripleo
if tripleo.has_overcloud(min_version='17.0'):
return 'enp3s0'