]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa scripts: Replace cut -f 1 with awk '{print $1;}'
authorDan Mick <dan.mick@inktank.com>
Thu, 4 Oct 2012 23:56:53 +0000 (16:56 -0700)
committerDan Mick <dan.mick@inktank.com>
Fri, 5 Oct 2012 00:04:09 +0000 (17:04 -0700)
This is to handle TextTable output, which doesn't use tabs

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
qa/workunits/rbd/copy.sh
qa/workunits/rbd/kernel.sh

index 7878e78a6437c4aa4436ccf2d0bfea434da50011..2ba3945e4c64443f55ee955f6b6c13bb06c2f498 100755 (executable)
@@ -163,7 +163,7 @@ test_locking() {
     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$'
 
@@ -173,8 +173,8 @@ test_locking() {
     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
index bf8452aa578729a842e13f5aa79be312384c361e..73f3dcb6b41422f3575916eb93619b154e4b346b 100755 (executable)
@@ -13,7 +13,7 @@ function get_device_dir {
        local POOL=$1
        local IMAGE=$2
        local SNAP=$3
-       rbd showmapped | tail -n +2 | egrep "\s+$POOL\s+$IMAGE\s+$SNAP\s+" | cut -f 1
+       rbd showmapped | tail -n +2 | egrep "\s+$POOL\s+$IMAGE\s+$SNAP\s+" | awk '{print $1;}'
 }
 
 function clean_up {