rbd lock list test1 | wc -l | grep '^0$'
rbd lock add test1 id
rbd lock list test1 | grep ' 1 '
- LOCKER=$(rbd lock list test1 | tail -n 1 | cut -f 1)
+ LOCKER=$(rbd lock list test1 | tail -n 1 | awk '{print $1;}')
rbd lock remove test1 id $LOCKER
rbd lock list test1 | wc -l | grep '^0$'
rbd lock list test1 | grep ' 2 '
rbd lock add test1 id2 --shared tag
rbd lock list test1 | grep ' 3 '
- LOCKER=$(rbd lock list test1 | tail -n 1 | cut -f 1)
- ID=$(rbd lock list test1 | tail -n 1 | cut -f 2)
+ LOCKER=$(rbd lock list test1 | tail -n 1 | awk '{print $1;}')
+ ID=$(rbd lock list test1 | tail -n 1 | awk '{print $2;}')
rbd lock remove test1 $ID $LOCKER
# locks don't prevent you from removing an image,
# just from taking a lock