diff options
author | Michael Schroeder <mls@suse.de> | 2017-08-04 16:17:53 +0200 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2017-08-04 16:17:53 +0200 |
commit | 72068ee8852784c1f23d627e351d025d2bbec74c (patch) | |
tree | e29f73b0427c41a874c0e2958ee247e5c61849f0 /build-vm-openstack | |
parent | 6f8d25ebca443329904b802355c05e6a95c3a0e1 (diff) |
Openstack: wait for device to appear
Diffstat (limited to 'build-vm-openstack')
-rw-r--r-- | build-vm-openstack | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/build-vm-openstack b/build-vm-openstack index e627272..516d0df 100644 --- a/build-vm-openstack +++ b/build-vm-openstack @@ -79,6 +79,15 @@ cloud_volume_attach_openstack() { done test "${device_path:0:5}" = "/dev/" || cleanup_and_exit 3 "device path not starting with /dev/: $device_path" + if ! test -e "$device_path" ; then + echo "waiting for $device_path to appear" + for i in 1 2 3 4 5 6 7 8 9 10 ; do + sleep 1 + test -e "$device_path" && break + done + test -e "$device_path" || cleanup_and_exit 3 "$device_path did not appear" + fi + # return attach info. Example: # 793e9a04-7068-4cf1-86e7-26509f709b54:175e470c-5869-4425-988a-6b334a2fa655:/dev/vdb OPENSTACK_ATTACH_INFO="$VM_VOL_ID:$serverId:$device_path" |