Merge "Refactor Ubuntu image stack"

This commit is contained in:
Zuul 2022-09-19 09:53:53 +00:00 committed by Gerrit Code Review
commit 9878bbf39b
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}'