diff options
author | Tim Rozet <trozet@redhat.com> | 2015-08-19 16:20:01 -0400 |
---|---|---|
committer | Tim Rozet <trozet@redhat.com> | 2015-09-01 14:52:56 +0000 |
commit | 712a8e64a8836e664e714892f2ec610ce3d0a6f6 (patch) | |
tree | 13a0735754f66fc637e268837e1eff6a4a56cb26 /common/ci | |
parent | b0155412940f4a185b58ebd87761b8bdbfdeb6b1 (diff) |
Removes pxebr in clean.sh, updates setup.sh
pxebr bridge is needed by Fuel, but causes issues with Foreman. It is
now removed in clean.sh. setup.sh is also updated to be executable and
fixes a bug where grep was being used on output that is in stderr.
JIRA: OCTO-109
Change-Id: I037e168e40f3352a61a604ed6cea21d10250b434
Signed-off-by: Tim Rozet <trozet@redhat.com>
(cherry picked from commit 30361efb7d3bf9525e9d9aadd5c137e9a654d1a4)
Diffstat (limited to 'common/ci')
-rwxr-xr-x | common/ci/clean.sh | 20 | ||||
-rwxr-xr-x[-rw-r--r--] | common/ci/setup.sh | 6 |
2 files changed, 22 insertions, 4 deletions
diff --git a/common/ci/clean.sh b/common/ci/clean.sh index bb47479..da75205 100755 --- a/common/ci/clean.sh +++ b/common/ci/clean.sh @@ -14,7 +14,7 @@ reset=`tput sgr0` blue=`tput setaf 4` red=`tput setaf 1` green=`tput setaf 2` - +pxe_bridge='pxebr' vm_dir=/var/opt/opnfv ##END VARS @@ -234,3 +234,21 @@ for kernel_mod in vboxnetadp vboxnetflt vboxpci vboxdrv kvm_intel kvm; do echo "${blue}Removed Kernel Module: $kernel_mod ${reset}" fi done + +###remove pxebr +echo "${blue}Checking whether PXE bridge ${pxe_bridge} exists${reset}" +if ! brctl show ${pxe_bridge} 2>&1 | grep -i 'No such device'; then + echo "${blue}PXE bridge detected. Removing...${reset}" + if ifconfig | grep ${pxe_bridge}; then + ifdown ${pxe_bridge} + fi + brctl delbr ${pxe_bridge} + if ifconfig | grep ${pxe_bridge} || brctl show | grep ${pxe_bridge}; then + echo "${red}Error trying to remove ${pxe_bridge}${reset}" + exit 1 + else + echo "${blue}PXE bridge ${pxe_bridge} removed${reset}" + fi +else + echo "${blue}PXE bridge ${pxe_bridge} does not exist${reset}" +fi diff --git a/common/ci/setup.sh b/common/ci/setup.sh index 73b0aa6..3ffd36b 100644..100755 --- a/common/ci/setup.sh +++ b/common/ci/setup.sh @@ -128,7 +128,7 @@ setup_pxe_bridge() { #Check whether PXE bridge exists echo "${blue}Checking whether PXE bridge ${pxe_bridge} exists${reset}" - if brctl show ${pxe_bridge} | grep 'No such device'; then + if brctl show ${pxe_bridge} 2>&1 | grep 'No such device'; then echo "${blue}Creating PXE bridge ${pxe_bridge}${reset}" brctl addbr ${pxe_bridge} else @@ -140,10 +140,10 @@ setup_pxe_bridge() { #Add VLAN 0 (PXE) interface to PXE bridge echo "${blue}Checking whether VLAN 0 (PXE) interface ${pxe_interface} is added to PXE bridge ${pxe_bridge} exists${reset}" - if ! brctl show ${pxe_bridge} | grep ${pxe_interface}; then + if ! brctl show ${pxe_bridge} 2>&1 | grep ${pxe_interface}; then echo "${blue}Adding VLAN 0 (PXE) interface ${pxe_interface} to PXE bridge ${pxe_bridge}${reset}" brctl addif ${pxe_bridge} ${pxe_interface} - if ! brctl show ${pxe_bridge} | grep ${pxe_interface}; then + if ! brctl show ${pxe_bridge} 2>&1 | grep ${pxe_interface}; then echo "${red}Could not add VLAN 0 (PXE) interface ${pxe_interface} to PXE bridge ${pxe_bridge}${reset}" exit 1 fi |