summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/cinder-volume/files/losetup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/cinder-volume/files/losetup.sh')
-rw-r--r--deploy/adapters/ansible/roles/cinder-volume/files/losetup.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/cinder-volume/files/losetup.sh b/deploy/adapters/ansible/roles/cinder-volume/files/losetup.sh
new file mode 100644
index 00000000..d0e6c776
--- /dev/null
+++ b/deploy/adapters/ansible/roles/cinder-volume/files/losetup.sh
@@ -0,0 +1,7 @@
+loop_dev=`losetup -a |grep "/var/cinder.img"|awk -F':' '{print $1}'`
+if [[ -z $loop_dev ]]; then
+ losetup -f --show /var/cinder.img
+else
+ echo $loop_dev
+fi
+