Merge ~hopem/stsstack-bundles:add-data-port-bridge-name into stsstack-bundles:master

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 4f5182745e1ae52944051273f0ece2890318e8bf
Proposed branch: ~hopem/stsstack-bundles:add-data-port-bridge-name
Merge into: stsstack-bundles:master
Diff against target: 38 lines (+5/-4)
1 file modified
openstack/bin/add-data-ports.sh (+5/-4)
Reviewer Review Type Date Requested Status
Jolly Bundlers Pending
Review via email: mp+388667@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/openstack/bin/add-data-ports.sh b/openstack/bin/add-data-ports.sh
2index 9362d4f..6b4545f 100755
3--- a/openstack/bin/add-data-ports.sh
4+++ b/openstack/bin/add-data-ports.sh
5@@ -6,6 +6,7 @@
6 #
7 application=${1:-""}
8 (($#>1)) && network="$2" || network=""
9+(($#>2)) && bridge="$3" || bridge="br-data"
10
11 declare -A requires=()
12
13@@ -36,8 +37,8 @@ fi
14 require_count=0
15 echo "Checking $application unit instances: ${instances[@]}"
16 for inst in "${instances[@]}"; do
17- num_ports="`openstack port list --network $network --server $inst| grep ACTIVE| wc -l`"
18- if ((num_ports>1)); then
19+ num_ports="`openstack port list --network $network --server $inst| grep data-port| wc -l`"
20+ if ((num_ports)); then
21 requires[$inst]=false
22 else
23 requires[$inst]=true
24@@ -81,12 +82,12 @@ if ((require_count)); then
25 for mac in "${mac_addrs[@]}"; do
26 echo "$cfg"| grep -q "$mac" && continue
27 ! $first && cfg+=" " || first=false
28- cfg+="br-data:$mac"
29+ cfg+="$bridge:$mac"
30 done
31 echo "Setting $application ${optname}='$cfg'"
32 juju config $application ${optname}="$cfg"
33 else
34- echo "All instances have > 1 port already - nothing to do"
35+ echo "All instances have at least 1 port on network $network (bridge=$bridge) - nothing to do"
36 fi
37
38 echo "Done."

Subscribers

People subscribed via source and target branches