diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-03-22 12:02:16 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-03-22 12:02:16 +0000 |
commit | ab31c13580dc51bb95d07627da5b19216ef2edff (patch) | |
tree | 40b609af283ee1fb0f7efe7610130ec11cff454f /mcp/scripts/lib.sh | |
parent | f45309a760e04597bdb379f3c7a1c0a2b28e1f87 (diff) | |
parent | 7481c6f499ea9f7949f1c0d9343d4e96caea6095 (diff) |
Merge "lib.sh: Skip modprobing nbd, loop if inbuilt"
Diffstat (limited to 'mcp/scripts/lib.sh')
-rw-r--r-- | mcp/scripts/lib.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh index 7d57fcf5f..ce5db251f 100644 --- a/mcp/scripts/lib.sh +++ b/mcp/scripts/lib.sh @@ -38,10 +38,11 @@ function get_base_image { function __kernel_modules { # Load mandatory kernel modules: loop, nbd local image_dir=$1 - sudo modprobe loop + test -e /dev/loop-control || sudo modprobe loop if sudo modprobe nbd max_part=8 || sudo modprobe -f nbd max_part=8; then return 0 fi + if [ -e /dev/nbd0 ]; then return 0; fi # nbd might be inbuilt # CentOS (or RHEL family in general) do not provide 'nbd' out of the box echo "[WARN] 'nbd' kernel module cannot be loaded!" if [ ! -e /etc/redhat-release ]; then @@ -225,6 +226,7 @@ function cleanup_mounts { function cleanup_uefi { # Clean up Ubuntu boot entry if cfg01, kvm nodes online from previous deploy local cmd_str="ssh ${SSH_OPTS} ${SSH_SALT}" + ping -c 1 -w 1 "${SALT_MASTER}" || return 0 [ ! "$(hostname)" = 'cfg01' ] || cmd_str='eval' ${cmd_str} "sudo salt -C 'kvm* or cmp*' cmd.run \ \"which efibootmgr > /dev/null 2>&1 && \ |