Comment 1 for bug 1548120

Revision history for this message
Manoj Iyer (manjo) wrote :

This patch fixes this issue. I tested the functionality of this function by creating a script invoking this function as standalone.

$ sudo ./test.sh
+ resolve_device PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d
+ DEV=PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d
+ case "$DEV" in
+ case "$DEV" in
++ echo PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d
++ cut -f 1 -d =
+ local type=PARTUUID
++ echo PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d
++ tr '[:upper:]' '[:lower:]'
++ cut -f 2 -d =
+ local value=275f782b-3c55-4b3f-acb2-c17db0eaee8d
+ DEV=PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d
+ command -v blkid
++ blkid -l -t PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d -o device
+ DEV=/dev/sda2
+ '[' -e /dev/sda2 ']'
+ echo /dev/sda2
/dev/sda2
+ resolve_device PARTUUID=275F782B-3C55-4B3F-ACB2-C17DB0EAEE8D
+ DEV=PARTUUID=275F782B-3C55-4B3F-ACB2-C17DB0EAEE8D
+ case "$DEV" in
+ case "$DEV" in
++ echo PARTUUID=275F782B-3C55-4B3F-ACB2-C17DB0EAEE8D
++ cut -f 1 -d =
+ local type=PARTUUID
++ echo PARTUUID=275F782B-3C55-4B3F-ACB2-C17DB0EAEE8D
++ cut -f 2 -d =
++ tr '[:upper:]' '[:lower:]'
+ local value=275f782b-3c55-4b3f-acb2-c17db0eaee8d
+ DEV=PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d
+ command -v blkid
++ blkid -l -t PARTUUID=275f782b-3c55-4b3f-acb2-c17db0eaee8d -o device
+ DEV=/dev/sda2
+ '[' -e /dev/sda2 ']'
+ echo /dev/sda2
/dev/sda2