diff options
author | Nikolas Hermanns <nikolas.hermanns@ericsson.com> | 2017-04-06 15:54:59 +0200 |
---|---|---|
committer | Nikolas Hermanns <nikolas.hermanns@ericsson.com> | 2017-04-27 10:08:53 +0000 |
commit | ecb8fdae0ed86c64e504a47a381aebbaac3e42e4 (patch) | |
tree | 66dfcf67d99a102c1581e25ca55a863542e73cf4 | |
parent | 6788c3b0ad67b65c41bbf8bf23a6a97561cf6e3a (diff) |
Checking if hacked quagga bridge exsists and contiune
Change-Id: I8983ed687dabba0af2128c0ce06bd53aba22c819
Signed-off-by: Nikolas Hermanns <nikolas.hermanns@ericsson.com>
(cherry picked from commit 2bfbe25b1df24d562789faa641c41e9cafec7efa)
-rw-r--r-- | sdnvpn/lib/utils.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sdnvpn/lib/utils.py b/sdnvpn/lib/utils.py index eb59446..03fea54 100644 --- a/sdnvpn/lib/utils.py +++ b/sdnvpn/lib/utils.py @@ -488,13 +488,15 @@ def attach_instance_to_ext_br(instance, compute_node): bridge = "br-quagga" cmd = """ set -xe - sudo brctl addbr {bridge} && - sudo ip link set {bridge} up && - sudo ip link add quagga-tap type veth peer name ovs-quagga-tap && - sudo ip link set dev ovs-quagga-tap up && - sudo ip link set dev quagga-tap up && - sudo ovs-vsctl add-port br-ex ovs-quagga-tap && - sudo brctl addif {bridge} quagga-tap + if ! brctl show |grep -q ^br-quagga;then + sudo brctl addbr {bridge} && + sudo ip link set {bridge} up && + sudo ip link add quagga-tap type veth peer name ovs-quagga-tap && + sudo ip link set dev ovs-quagga-tap up && + sudo ip link set dev quagga-tap up && + sudo ovs-vsctl add-port br-ex ovs-quagga-tap && + sudo brctl addif {bridge} quagga-tap + fi """ compute_node.run_cmd(cmd.format(bridge=bridge)) |