rbd showmapped has trailing whitespace which break rbd monitor
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ceph (Ubuntu) |
Fix Released
|
High
|
Unassigned |
Bug Description
Taken from rbd RA
find_rbd_dev() {
local sedpat
# Example output from "rbd showmapped" (tab separated):
# id pool image snap device
# 0 rbd test - /dev/rbd0
# Build the sed pattern, substituting "-" for the snapshot name if
# it's unset
sedpat=
# Run rbd showmapped, filter out the header line, then try to
# extract the device name
rbd showmapped | tail -n +2 | sed -n -e "s,$sedpat,\1,p"
}
rbd showmapped is outputing a trailing whitespace character at the end of the block device which means that the monitor check can't find the mapped block device
add | tr -d ' ' fixes the problem
ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: ceph-resource-
ProcVersionSign
Uname: Linux 3.8.0-6-generic x86_64
ApportVersion: 2.8-0ubuntu4
Architecture: amd64
Date: Mon Feb 18 10:47:14 2013
MarkForUpload: True
PackageArchitec
SourcePackage: ceph
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
Changed in ceph (Ubuntu): | |
importance: | Undecided → High |
status: | New → Triaged |
Alternatively:
sedpat= "[0-9]\ +[ \t]\+${ OCF_RESKEY_ pool}[ \t]\+${ OCF_RESKEY_ name}[ \t]\+${ OCF_RESKEY_ snap:-- }[ \t]\+\( /dev/rbd[ 0-9]\+\ ).*"
Trims the whitespace as well.