[cinder-lvm] Resolve issue when there are multiple loop devices

If a deployment fails, there may end up being multiple loopback
devices pointing to the same image file. This currently breaks
the systemd unit file because it cannot handle starting two
devices properly.

We only need one device, so just in case this situation arises,
we now ensure that anything more than the first device is ignored
when running 'Get or create LVM loopback device'.

Change-Id: I012ee9c60bce4148da8ec6fe077ee20cfe34d555
Related-bug: #1873899
This commit is contained in:
Jesse Pretorius (odyssey4me) 2020-04-23 15:18:48 +01:00
parent 4354a96787
commit d9152a601e
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ outputs:
losetup -f /var/lib/cinder/cinder-volumes --show
exit_code=2
else
echo ${existing_device}
echo ${existing_device%$'\n'*}
fi
exit ${exit_code}
args: