Bug 1777512 - Cannot create OVS patch port via tripleo heat templates due to sed command in run-os-net-config.sh
Summary: Cannot create OVS patch port via tripleo heat templates due to sed command in...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates
Version: 13.0 (Queens)
Hardware: All
OS: All
medium
medium
Target Milestone: ---
: ---
Assignee: Nate Johnston
QA Contact: Sasha Smolyak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-27 16:41 UTC by david.waddell
Modified: 2020-03-10 11:23 UTC (History)
6 users (show)

Fixed In Version: openstack-tripleo-heat-templates-8.4.1-32.el7ost
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-10 11:23:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 696898 0 'None' MERGED Fix sed in run-os-net-config to only replace values, not keys 2020-03-09 14:05:00 UTC
OpenStack gerrit 697083 0 'None' MERGED Fix sed in run-os-net-config to only replace values, not keys 2020-03-09 14:05:00 UTC
Red Hat Product Errata RHBA-2020:0760 0 None None None 2020-03-10 11:23:50 UTC

Description david.waddell 2019-11-27 16:41:12 UTC
Description of problem:

An OVS patch port can specified in tripleo nic templates e.g

              - type: ovs_bridge
                name: br-tenant
                use_dhcp: false
              - type: ovs_patch_port
                name: patch-ex-tenant
                bridge_name: br-tenant
                peer: patch-tenant-ex
              - type: ovs_patch_port
                name: patch-tenant-ex
                bridge_name: br-ex
                peer: patch-tenant

which is rendered in json for os-net-config as this
    {
      "type": "ovs_patch_port",
      "peer": "patch-tenant-ex",
      "name": "patch-ex-tenant",
      "bridge_name": "br-tenant"
    },
    {
      "type": "ovs_patch_port",
      "peer": "patch-tenant",
      "name": "patch-tenant-ex",
      "bridge_name": "br-ex"
    }

however the tripleo script run-os-netconfig.sh script replaces 'bridge_name' with br-ex|br-storage using a sed command. this needs updating as follows to ensure it only selects bridge_name as a value, not as a key, in the json script. 

$ diff /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh.bak /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh
132c132
<     sed -i "s/bridge_name/${bridge_name:-''}/" /etc/os-net-config/config.json
---
>     sed -i "s/: bridge_name/: ${bridge_name:-''}/" /etc/os-net-config/config.json



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 david.waddell 2019-11-28 00:07:18 UTC
apologies slight typo in above - the required change is 
diff /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh.bak /usr/share/openstack-tripleo-heat-templates/network/scripts/run-os-net-config.sh
132c132
<     sed -i "s/bridge_name/${bridge_name:-''}/" /etc/os-net-config/config.json
---
>     sed -i "s/: \"bridge_name/: \"${bridge_name:-''}/" /etc/os-net-config/config.json

Comment 2 Nate Johnston 2019-12-02 15:23:12 UTC
Added upstream fix https://review.opendev.org/696898

Comment 3 Nate Johnston 2019-12-03 13:25:24 UTC
Fix merged in upstream master; backported it back to stable/queens.

Comment 11 errata-xmlrpc 2020-03-10 11:23:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0760


Note You need to log in before you can comment on or make changes to this bug.