Skip to content

Commit

Permalink
Merge pull request #176 from stackhpc/upstream/yoga-2023-09-25
Browse files Browse the repository at this point in the history
Synchronise yoga with upstream
  • Loading branch information
priteau authored Sep 28, 2023
2 parents 9c7ebd6 + 6613edf commit 6041ae0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion kayobe/plugins/action/kolla_ansible_host_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ def _get_external_interface_facts(self, external_interfaces):
# For a bridge, use a veth pair connected to the bridge. Otherwise
# use the interface directly.
if is_bridge:
external_interface = patch_prefix + interface + patch_suffix
# interface names can't be longer than 15 characters
char_limit = 15 - len(patch_prefix) - len(patch_suffix)
external_interface = patch_prefix + interface[:char_limit] + \
patch_suffix
else:
external_interface = interface
neutron_external_interfaces.append(external_interface)
Expand Down
10 changes: 8 additions & 2 deletions kayobe/plugins/filter/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ def _get_veth_interface(context, bridge, inventory_hostname):
inventory_hostname)
suffix = utils.get_hostvar(context, 'network_patch_suffix_phy',
inventory_hostname)
return prefix + bridge + suffix

# interface names can't be longer than 15 characters
char_limit = 15 - len(prefix) - len(suffix)
return prefix + bridge[:char_limit] + suffix


def _get_veth_peer(context, bridge, inventory_hostname):
Expand All @@ -64,7 +67,10 @@ def _get_veth_peer(context, bridge, inventory_hostname):
inventory_hostname)
suffix = utils.get_hostvar(context, 'network_patch_suffix_ovs',
inventory_hostname)
return prefix + bridge + suffix

# interface names can't be longer than 15 characters
char_limit = 15 - len(prefix) - len(suffix)
return prefix + bridge[:char_limit] + suffix


def get_ovs_veths(context, names, inventory_hostname):
Expand Down

0 comments on commit 6041ae0

Please sign in to comment.