Skip to content

Commit

Permalink
Strip any trailing whitespace from rbd showmapped
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
javacruft committed Feb 18, 2013
1 parent 133d0ea commit ad84ea0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ocf/rbd.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ad84ea0

Please sign in to comment.