Cannot create OVS patch port via tripleo heat templates due to sed command in run-os-net-config.sh

Bug #1854780 reported by Nate Johnston on 2019-12-02
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
High
Nate Johnston

Bug Description

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

Changed in tripleo:
assignee: nobody → Nate Johnston (nate-johnston)

Fix proposed to branch: master
Review: https://review.opendev.org/696898

Changed in tripleo:
status: New → In Progress
Changed in tripleo:
importance: Undecided → High
milestone: none → ussuri-1

Reviewed: https://review.opendev.org/696898
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=858cc6c54f690058ce28b0832870df875a7923e9
Submitter: Zuul
Branch: master

commit 858cc6c54f690058ce28b0832870df875a7923e9
Author: Nate Johnston <email address hidden>
Date: Mon Dec 2 10:12:46 2019 -0500

    Fix sed in run-os-net-config to only replace values, not keys

    The sed in run-os-net-config.sh replaces all instances of bridge_name
    but it should only replace values, not keys.

    Change-Id: Iaf19e1550bd7a5286b8512596efd84cf14c78f32
    Closes-bug: #1854780

Changed in tripleo:
status: In Progress → Fix Released

Reviewed: https://review.opendev.org/697079
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=eb9faedad5aa04a4abf3e589cf5f2f7def454ae6
Submitter: Zuul
Branch: stable/stein

commit eb9faedad5aa04a4abf3e589cf5f2f7def454ae6
Author: Nate Johnston <email address hidden>
Date: Mon Dec 2 10:12:46 2019 -0500

    Fix sed in run-os-net-config to only replace values, not keys

    The sed in run-os-net-config.sh replaces all instances of bridge_name
    but it should only replace values, not keys.

    Change-Id: Iaf19e1550bd7a5286b8512596efd84cf14c78f32
    Closes-bug: #1854780
    (cherry picked from commit 858cc6c54f690058ce28b0832870df875a7923e9)

tags: added: in-stable-stein
tags: added: in-stable-queens

Reviewed: https://review.opendev.org/697083
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=29d8b9364e79969047521c3ed55cd5b444c2238f
Submitter: Zuul
Branch: stable/queens

commit 29d8b9364e79969047521c3ed55cd5b444c2238f
Author: Nate Johnston <email address hidden>
Date: Mon Dec 2 10:12:46 2019 -0500

    Fix sed in run-os-net-config to only replace values, not keys

    The sed in run-os-net-config.sh replaces all instances of bridge_name
    but it should only replace values, not keys.

    Change-Id: Iaf19e1550bd7a5286b8512596efd84cf14c78f32
    Closes-bug: #1854780
    (cherry picked from commit 858cc6c54f690058ce28b0832870df875a7923e9)

Reviewed: https://review.opendev.org/697078
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=4bd8ecb5f4bee2885e57411c387c8bd3b71e5bda
Submitter: Zuul
Branch: stable/train

commit 4bd8ecb5f4bee2885e57411c387c8bd3b71e5bda
Author: Nate Johnston <email address hidden>
Date: Mon Dec 2 10:12:46 2019 -0500

    Fix sed in run-os-net-config to only replace values, not keys

    The sed in run-os-net-config.sh replaces all instances of bridge_name
    but it should only replace values, not keys.

    Change-Id: Iaf19e1550bd7a5286b8512596efd84cf14c78f32
    Closes-bug: #1854780
    (cherry picked from commit 858cc6c54f690058ce28b0832870df875a7923e9)

tags: added: in-stable-train
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers