Browse Source

Reworked 'unless' for adding ports to bridge

Previous implementation was not able to add port 'dpdk0' to bridge
'br-dpdk0' since both matches 'grep' condition. To fix this we need to
look for port in a particular bridge

Change-Id: Ie83cebc3ab73c45a48f68fae2d6f474743215908
pull/170/head
Dmitry Ukov 6 years ago
parent
commit
ff331d84bf
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      linux/network/dpdk.sls

+ 2
- 2
linux/network/dpdk.sls View File

linux_network_dpdk_bond_interface_{{ interface_name }}: linux_network_dpdk_bond_interface_{{ interface_name }}:
cmd.run: cmd.run:
- name: "ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} add-bond {{ interface.bridge }} {{ interface_name }} {{ bond_interfaces.keys()|join(' ') }}" - name: "ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} add-bond {{ interface.bridge }} {{ interface_name }} {{ bond_interfaces.keys()|join(' ') }}"
- unless: "ovs-vsctl show | grep {{ interface_name }}"
- unless: "ovs-vsctl list-ports {{ interface.bridge }} | grep -w {{ interface_name }}"
- require: - require:
- cmd: linux_network_dpdk_bridge_interface_{{ interface.bridge }} - cmd: linux_network_dpdk_bridge_interface_{{ interface.bridge }}


linux_network_dpdk_bridge_port_interface_{{ interface_name }}: linux_network_dpdk_bridge_port_interface_{{ interface_name }}:
cmd.run: cmd.run:
- name: "ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} add-port {{ interface.bridge }} {{ interface_name }} -- set Interface {{ interface_name }} type=dpdk options:dpdk-devargs={{ interface.pci }}" - name: "ovs-vsctl{%- if network.ovs_nowait %} --no-wait{%- endif %} add-port {{ interface.bridge }} {{ interface_name }} -- set Interface {{ interface_name }} type=dpdk options:dpdk-devargs={{ interface.pci }}"
- unless: "ovs-vsctl show | grep {{ interface_name }}"
- unless: "ovs-vsctl list-ports {{ interface.bridge }} | grep -w {{ interface_name }}"
- require: - require:
- cmd: linux_network_dpdk_bridge_interface_{{ interface.bridge }} - cmd: linux_network_dpdk_bridge_interface_{{ interface.bridge }}



Loading…
Cancel
Save