Revision 643d7283 snf-image-host/common.sh.in
b/snf-image-host/common.sh.in | ||
---|---|---|
26 | 26 |
CURL="curl" |
27 | 27 |
|
28 | 28 |
|
29 |
pithos_backend_support="@pithos_backend_support@" |
|
30 | 29 |
network_backend_support="@network_backend_support@" |
31 | 30 |
|
32 | 31 |
CLEANUP=( ) |
... | ... | |
193 | 192 |
local id=$1 |
194 | 193 |
|
195 | 194 |
if [[ "$id" =~ ^pithos: ]]; then |
196 |
if [ "$pithos_backend_support" = "yes" ]; then |
|
197 |
echo "pithos" |
|
198 |
else |
|
199 |
log_error "Retrieving images from pithos is not supported" |
|
200 |
exit 1 |
|
201 |
fi |
|
195 |
echo "pithos" |
|
202 | 196 |
elif [[ "$id" =~ ^(http|ftp)s?: ]]; then |
203 | 197 |
if [ "$network_backend_support" = "yes" ]; then |
204 | 198 |
echo "network"; |
... | ... | |
303 | 297 |
# before we give up with an error. This is needed for kpartx when |
304 | 298 |
# dealing with ntfs partitions mounted through fuse. umount is not |
305 | 299 |
# synchronous and may return while the partition is still busy. A |
306 |
# premature attempt to delete partition mappings through kpartx on a |
|
307 |
# device that hosts previously mounted ntfs partition may fail with |
|
308 |
# an `device-mapper: remove ioctl failed: Device or resource busy' |
|
309 |
# error. A sensible workaround for this is to wait for a while and |
|
310 |
# then try again. |
|
300 |
# premature attempt to delete partition mappings through kpartx on |
|
301 |
# a device that hosts previously mounted ntfs partition may fail |
|
302 |
# with errors like this one: |
|
303 |
# `device-mapper: remove ioctl failed: Device or resource busy' |
|
304 |
# A sensible workaround for this is to wait for a while and then |
|
305 |
# retry it. |
|
311 | 306 |
local cmd=${CLEANUP[$i]} |
312 | 307 |
$cmd || for interval in 0.25 0.5 1 2 4; do |
313 | 308 |
echo "Command $cmd failed!" |
Also available in: Unified diff