]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits: fixed mon address parsing for rbd-mirror 26521/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 19 Feb 2019 19:19:29 +0000 (14:19 -0500)
committerJason Dillaman <dillaman@redhat.com>
Tue, 19 Feb 2019 19:22:34 +0000 (14:22 -0500)
The test extracts the mon addresses from the monmap, but with the
recent v2 format change it extracted an invalid address.

Fixes: http://tracker.ceph.com/issues/38385
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
qa/workunits/rbd/rbd_mirror_helpers.sh

index ea50078ddc2e1344a7a12d3652525bef64a69ede..7d874d900e379150cb22193174a799abe3a47714 100755 (executable)
@@ -263,13 +263,14 @@ setup_pools()
     else
       mon_map_file=${TEMPDIR}/${remote_cluster}.monmap
       ceph --cluster ${remote_cluster} mon getmap > ${mon_map_file}
-      mon_addr=$(monmaptool --print ${mon_map_file} | grep -E 'mon\.' | head -n 1 | sed -E 's/^[0-9]+: ([^/]+).+$/\1/')
+      mon_addr=$(monmaptool --print ${mon_map_file} | grep -E 'mon\.' |
+        head -n 1 | sed -E 's/^[0-9]+: ([^ ]+).+$/\1/' | sed -E 's/\/[0-9]+//g')
 
       admin_key_file=${TEMPDIR}/${remote_cluster}.client.${CEPH_ID}.key
       CEPH_ARGS='' ceph --cluster ${remote_cluster} auth get-key client.${CEPH_ID} > ${admin_key_file}
 
       rbd --cluster ${cluster} mirror pool peer add ${POOL} client.${CEPH_ID}@${remote_cluster}-DNE \
-          --remote-mon-host ${mon_addr} --remote-key-file ${admin_key_file}
+          --remote-mon-host "${mon_addr}" --remote-key-file ${admin_key_file}
 
       uuid=$(rbd --cluster ${cluster} mirror pool peer add ${PARENT_POOL} client.${CEPH_ID}@${remote_cluster}-DNE)
       rbd --cluster ${cluster} mirror pool peer set ${PARENT_POOL} ${uuid} mon-host ${mon_addr}