[fix] Detect virtio-scsi volumes correctly
When the Cinder volume is presented as a virtio-scsi volume, the device_name detection fails. This change allows the device name to be retrieved correctly for both virtio-pci and virtio-scsi cases. Story: 2008618 Task: 41808 Change-Id: Ia6a848eae11bc38ff71ef4575247010a8ffaa47b (cherry picked from commit68e6c0e48d
) (cherry picked from commit31b0aec56b
)
This commit is contained in:
parent
79ced32d31
commit
7b6c844d92
|
@ -13,7 +13,7 @@ if [ -n "$DOCKER_VOLUME_SIZE" ] && [ "$DOCKER_VOLUME_SIZE" -gt 0 ]; then
|
||||||
else
|
else
|
||||||
attempts=60
|
attempts=60
|
||||||
while [ ${attempts} -gt 0 ]; do
|
while [ ${attempts} -gt 0 ]; do
|
||||||
device_name=$($ssh_cmd ls /dev/disk/by-id | grep ${DOCKER_VOLUME:0:20}$)
|
device_name=$($ssh_cmd ls /dev/disk/by-id | grep ${DOCKER_VOLUME:0:20} | head -n1)
|
||||||
if [ -n "${device_name}" ]; then
|
if [ -n "${device_name}" ]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -20,7 +20,7 @@ if [ -n "$ETCD_VOLUME_SIZE" ] && [ "$ETCD_VOLUME_SIZE" -gt 0 ]; then
|
||||||
|
|
||||||
attempts=60
|
attempts=60
|
||||||
while [ ${attempts} -gt 0 ]; do
|
while [ ${attempts} -gt 0 ]; do
|
||||||
device_name=$($ssh_cmd ls /dev/disk/by-id | grep ${ETCD_VOLUME:0:20}$)
|
device_name=$($ssh_cmd ls /dev/disk/by-id | grep ${ETCD_VOLUME:0:20} | head -n1)
|
||||||
if [ -n "${device_name}" ]; then
|
if [ -n "${device_name}" ]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue