Refactor Ubuntu image stack

So far users could name the Ubuntu interface in any way they wanted.

The ability to name Ubuntu interface allowed tobiko to run tests
successfully for each OSP version, but it required changing it every
time a different version is being run.

This issue was fixed by setting the Ubuntu interface name in the tobiko
code.

This patch removes the unnecessary remaining parts.

Change-Id: I0fcb4b9086bf8bbae5d98983971650a2244e52a1
This commit is contained in:
Omer 2022-08-03 18:44:35 +02:00
parent b303fa415e
commit e8eb7ab98d
4 changed files with 8 additions and 18 deletions

View File

@ -153,10 +153,6 @@ subparsers:
type: Value
help: user name to be used to connect to TripleO Overcloud hosts
ansible_variable: overcloud_ssh_username
ubuntu-interface-name:
type: Value
help: primary interface name obtained from the ubuntu instances
ansible_variable: ubuntu_interface_name
- title: Run stage
options:

View File

@ -13,8 +13,6 @@ test_default_conf:
tripleo:
undercloud_ssh_hostname: "{{ undercloud_ssh_hostname }}"
overcloud_ssh_username: "{{ overcloud_ssh_username }}"
ubuntu:
interface_name: "{{ ubuntu_interface_name }}"
test_log_debug: ''
@ -28,5 +26,3 @@ undercloud_hostname: '{{ groups.get("undercloud", []) | first | default("undercl
undercloud_ssh_hostname: ''
overcloud_ssh_username: ''
ubuntu_interface_name: ''

View File

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

View File

@ -132,14 +132,14 @@ class UbuntuImageFixture(UbuntuMinimalImageFixture,
@staticmethod
def _get_ethernet_device() -> str:
ethernet_device = CONF.tobiko.ubuntu.interface_name
if ethernet_device is None:
from tobiko import tripleo
if tripleo.has_overcloud(min_version='17.0'):
ethernet_device = 'enp3s0'
else:
ethernet_device = 'ens3'
return ethernet_device
"""From OSP17 and above, Ubuntu stack should use a different interface name.
This method returns the interface name, depending on the OSP version.
"""
from tobiko import tripleo
if tripleo.has_overcloud(min_version='17.0'):
return 'enp3s0'
else:
return 'ens3'
def _get_customized_suffix(self) -> str:
return f'{super()._get_customized_suffix()}-{self.ethernet_device}'