Commit 40d79e73 authored by Apollon Oikonomopoulos's avatar Apollon Oikonomopoulos Committed by Klaus Aehlig

DRBD parser: consume initial empty resource lines

When a DRBD resource is taken down, its minor number is freed and its
place in /proc/drbd is taken by an empty line. Currently the parser is
able to consume any empty lines appearing inside the resource stanza,
but cannot handle the first resource being empty.

We fix this by consuming all EOL characters appearing before the device
number. A test for this case should also be added.

This fixes issue #869.
Signed-off-by: default avatarApollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 540f468c
......@@ -114,6 +114,7 @@ versionInfoParser = do
-- | The parser for a (multi-line) string representing a device.
deviceParser :: [DrbdInstMinor] -> Parser DeviceInfo
deviceParser instMinor = do
_ <- additionalEOL
deviceNum <- skipSpaces *> A.decimal <* A.char ':'
cs <- skipSpacesAndString "cs:" connStateParser
if cs == Unconfigured
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment