]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Strip any trailing whitespace from rbd showmapped
authorJames Page <james.page@ubuntu.com>
Mon, 18 Feb 2013 16:24:54 +0000 (16:24 +0000)
committerSage Weil <sage@inktank.com>
Mon, 18 Feb 2013 22:41:26 +0000 (14:41 -0800)
More recent versions of ceph append a bit of whitespace to the line
after the name of the /dev/rbdX device; this causes the monitor check
to fail as it can't find the device name due to the whitespace.

This fix excludes any characters after the /dev/rbdN match.
(cherry picked from commit ad84ea07cac5096de38b51b8fc452c99f016b8d8)

src/ocf/rbd.in

index 041788d96fc901cae0412c354398c7552ba82f2b..150ad6e6b21b50dff969886ed0881ea9e96c5bc0 100644 (file)
@@ -134,7 +134,7 @@ find_rbd_dev() {
 
     # Build the sed pattern, substituting "-" for the snapshot name if
     # it's unset
-    sedpat="[0-9]\+[ \t]\+${OCF_RESKEY_pool}[ \t]\+${OCF_RESKEY_name}[ \t]\+${OCF_RESKEY_snap:--}[ \t]\+\(/dev/rbd[0-9]\+\)"
+    sedpat="[0-9]\+[ \t]\+${OCF_RESKEY_pool}[ \t]\+${OCF_RESKEY_name}[ \t]\+${OCF_RESKEY_snap:--}[ \t]\+\(/dev/rbd[0-9]\+\).*"
 
     # Run rbd showmapped, filter out the header line, then try to
     # extract the device name