summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-10-30 17:16:07 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-10-30 17:16:07 +0000
commitb93f6c997d9e5c174a1ddaec1c73dedfcdf7c106 (patch)
tree43b8b5e261618856d00646b5eae1202405732f17
parent4c0e4186721a2315ac316f5170c6cd3a8199eb6a (diff)
parent4e2c736cce578d1073dab0e0960b524b1dcc663a (diff)
Merge "lib.sh: rm Ubuntu boot entry on EFI systems"
-rw-r--r--mcp/scripts/lib.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
index b4d45ddd6..6b7193b3f 100644
--- a/mcp/scripts/lib.sh
+++ b/mcp/scripts/lib.sh
@@ -35,6 +35,15 @@ function get_base_image {
wget -P "${image_dir}" -N "${base_image}"
}
+function cleanup_uefi {
+ # Clean up Ubuntu boot entry if cfg01, kvm nodes online from previous deploy
+ # shellcheck disable=SC2086
+ ssh ${SSH_OPTS} "${SSH_SALT}" "sudo salt -C 'kvm* or cmp*' cmd.run \
+ \"which efibootmgr > /dev/null 2>&1 && \
+ efibootmgr | grep -oP '(?<=Boot)[0-9]+(?=.*ubuntu)' | \
+ xargs -I{} efibootmgr --delete-bootnum --bootnum {}\"" || true
+}
+
function cleanup_vms {
# clean up existing nodes
for node in $(virsh list --name | grep -P '\w{3}\d{2}'); do
@@ -52,6 +61,7 @@ function prepare_vms {
local image_dir=$1; shift
local vnodes=("$@")
+ cleanup_uefi
cleanup_vms
get_base_image "${base_image}" "${image_dir}"
# shellcheck disable=SC2016