Don't fail host cleanup if bridge does not exist 47/4247/2
authorTodd Malsbary <todd.malsbary@intel.com>
Thu, 13 May 2021 23:18:02 +0000 (16:18 -0700)
committerKuralamudhan Ramakrishnan <kuralamudhan.ramakrishnan@intel.com>
Thu, 20 May 2021 23:04:25 +0000 (23:04 +0000)
When host cleanup is run after a failed install, the provisioning and
dhcp0 bridges may not exist.  Continue with cleanup steps when they do
not.

Issue-ID: ICN-525
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: Ia9ed6024f823d9398696c0cbcb7cd3c03a7c19d7

env/metal3/06_host_cleanup.sh

index f82636a..f206d92 100755 (executable)
@@ -11,16 +11,10 @@ for name in ironic ironic-inspector dnsmasq httpd mariadb ipa-downloader; do
     sudo docker ps --all | grep -w "$name$" && sudo docker rm "$name" -f
 done
 
-ip link set provisioning down
-brctl delbr provisioning
+ip link set provisioning down || true
+brctl delbr provision || true
 
-ip link set dhcp0 down
-brctl delbr dhcp0
+ip link set dhcp0 down || true
+brctl delbr dhcp0 || true
 
 rm -rf ${IRONIC_DATA_DIR}
-
-#Kubeadm usage is deprecated in v1.0.0
-#kubeadm reset -f
-#iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
-#rm -rf $HOME/.kube/config
-#rm -rf /var/lib/etcd