aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/scripts/lib.sh
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-12-09 02:39:33 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-12-30 23:58:17 +0000
commitbd8a1eee7204d3c51bf17adb950b8b02ab36649b (patch)
tree7abb5e9d4bcc8f6b2ae558396a4bb9e33ade90bd /mcp/scripts/lib.sh
parente3bc5ad8ab4ace79f79ca3492beb76e6af8e0369 (diff)
ci/deploy.sh: maas: cleanup_uefi on env erase
Running `ci/deploy.sh -EE` should also perform an UEFI boot option cleanup, otherwise we risk booting the previously installed OS. While at it, reduce delay between nodes removal and fix a rare failure for `-EE` when no nodes are defined in MaaS. Change-Id: I789ffd3e22545921216f7d5ee3509c76354542eb Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com> (cherry picked from commit 15173a83dba08729e62da277b9165677323675d8)
Diffstat (limited to 'mcp/scripts/lib.sh')
-rw-r--r--mcp/scripts/lib.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
index 93ee59d0b..cafa7d576 100644
--- a/mcp/scripts/lib.sh
+++ b/mcp/scripts/lib.sh
@@ -37,8 +37,9 @@ function get_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 \
+ local cmd_str="ssh ${SSH_OPTS} ${SSH_SALT}"
+ [ ! "$(hostname)" = 'cfg01' ] || cmd_str='eval'
+ ${cmd_str} "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 {}; \