summaryrefslogtreecommitdiffstats
path: root/mcp
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-09-29 14:16:57 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-09-29 14:16:57 +0000
commitfb0a36154d6354348078b6a0972655b0bfc60af4 (patch)
tree8a59f330cbcd59537d29c1a58e2c1ba2bc032afc /mcp
parent896908d540334f7fda329b5666c7587bca94ef4c (diff)
parent51be444a4239ed10f47d4e63b70ac13d109f07cd (diff)
Merge "lib.sh: Use host bridge in favor of virsh network" into stable/euphrates
Diffstat (limited to 'mcp')
-rw-r--r--mcp/scripts/lib.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
index 4b88ab7bb..dc4d9dc2f 100644
--- a/mcp/scripts/lib.sh
+++ b/mcp/scripts/lib.sh
@@ -72,7 +72,7 @@ create_networks() {
virsh net-undefine "${net}"
fi
# in case of custom network, host should already have the bridge in place
- if [ -f "net_${net}.xml" ]; then
+ if [ -f "net_${net}.xml" ] && [ ! -d "/sys/class/net/${net}/bridge" ]; then
virsh net-define "net_${net}.xml"
virsh net-autostart "${net}"
virsh net-start "${net}"
@@ -103,10 +103,11 @@ create_vms() {
vnode_networks[2]="${vnode_networks[0]}"
fi
for net in "${vnode_networks[@]:1}"; do
- net_type="network"
+ net_type="bridge"
# in case of custom network, host should already have the bridge in place
- if [ ! -f "net_${net}.xml" ]; then
- net_type="bridge"
+ if [ -f "net_${net}.xml" ] && \
+ [ ! -d "/sys/class/net/${net}/bridge" ]; then
+ net_type="network"
fi
net_args="${net_args} --network ${net_type}=${net},model=virtio"
done