Skip to content

Commit

Permalink
change terminology from plumb
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdmcleod committed Sep 26, 2019
1 parent 48a4101 commit 028602f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions zaza/openstack/configure/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,17 @@ def setup_gateway_ext_port(network_config, keystone_session=None):
if current_release >= bionic_queens:
logging.warn("Adding second interface for dataport to guest netplan "
"for bionic-queens and later")
plumb_guest_nic = True
add_dataport_to_netplan = True
else:
plumb_guest_nic = False
add_dataport_to_netplan = False

logging.info("Configuring network for OpenStack undercloud/provider")
openstack_utils.configure_gateway_ext_port(
nova_client,
neutron_client,
dvr_mode=network_config.get("dvr_enabled", False),
net_id=net_id,
plumb_guest_nic=plumb_guest_nic)
add_dataport_to_netplan=add_dataport_to_netplan)


def run_from_cli(**kwargs):
Expand Down
13 changes: 7 additions & 6 deletions zaza/openstack/utilities/openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,8 @@ def get_admin_net(neutron_client):
return net


def _plumb_guest_nic(server_name, mac_address, dvr_mode=None):
"""In guest server_name, add port with mac_address to netplan.
def add_interface_to_netplan(server_name, mac_address, dvr_mode=None):
"""In guest server_name, add nic with mac_address to netplan.
:param server_name: Hostname of instance
:type server_name: string
Expand Down Expand Up @@ -545,7 +545,7 @@ def _plumb_guest_nic(server_name, mac_address, dvr_mode=None):

def configure_gateway_ext_port(novaclient, neutronclient,
dvr_mode=None, net_id=None,
plumb_guest_nic=False):
add_dataport_to_netplan=False):
"""Configure the neturong-gateway external port.
:param novaclient: Authenticated novaclient
Expand Down Expand Up @@ -592,9 +592,10 @@ def configure_gateway_ext_port(novaclient, neutronclient,
port = neutronclient.create_port(body=body_value)
server.interface_attach(port_id=port['port']['id'],
net_id=None, fixed_ip=None)
if plumb_guest_nic:
_plumb_guest_nic(server.name, mac_address=port['mac_address'],
dvr_mode=dvr_mode)
if add_dataport_to_netplan:
add_interface_to_netplan(server.name,
mac_address=port['mac_address'],
dvr_mode=dvr_mode)
ext_br_macs = []
for port in neutronclient.list_ports(network_id=net_id)['ports']:
if 'ext-port' in port['name']:
Expand Down

0 comments on commit 028602f

Please sign in to comment.