X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=common%2Fci%2Fclean.sh;h=caaf88fe852b739a7ed16d8cdde7db0cbebfbf6c;hb=e50bd70324f20949098c082b560536047b435027;hp=da7520584a324d28bf49aa75ff36d681c93aa5cf;hpb=d72aa3b7da9f9e2eb5bd0690be58365027a70f0a;p=genesis.git diff --git a/common/ci/clean.sh b/common/ci/clean.sh index da75205..caaf88f 100755 --- a/common/ci/clean.sh +++ b/common/ci/clean.sh @@ -239,8 +239,15 @@ done 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} + link_state=$(ip link show ${pxe_bridge} | grep -oP 'state \K[^ ]+') + if [[ ${link_state} != 'DOWN' ]]; then + ip link set dev ${pxe_bridge} down + sleep 5 + link_state=$(ip link show ${pxe_bridge} | grep -oP 'state \K[^ ]+') + if [[ ${link_state} != 'DOWN' ]]; then + echo "${red}Could not bring DOWN bridge ${pxe_bridge} link state is ${link_state}${reset}" + exit 1 + fi fi brctl delbr ${pxe_bridge} if ifconfig | grep ${pxe_bridge} || brctl show | grep ${pxe_bridge}; then