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
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
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)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (master)

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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/697078

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/697079

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/697082

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/697083

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/stein)

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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (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)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/train)

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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 11.3.1

This issue was fixed in the openstack/tripleo-heat-templates 11.3.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/rocky)

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

commit e3a9b32677df72a7e9c46558dbc9c487053c818c
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-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 12.1.0

This issue was fixed in the openstack/tripleo-heat-templates 12.1.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates rocky-eol

This issue was fixed in the openstack/tripleo-heat-templates rocky-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates queens-eol

This issue was fixed in the openstack/tripleo-heat-templates queens-eol release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates stein-eol

This issue was fixed in the openstack/tripleo-heat-templates stein-eol release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.