ganeti

Safe HaskellSafe-Infered

Ganeti.Storage.Drbd.Parser

Description

DRBD proc file parser

This module holds the definition of the parser that extracts status information from the DRBD proc file.

Synopsis

Documentation

skipSpaces :: Parser ()Source

skipSpacesAndString :: Text -> Parser a -> Parser aSource

isBadEndOfLine :: Char -> BoolSource

optional :: Parser a -> Parser (Maybe a)Source

drbdStatusParser :: [DrbdInstMinor] -> Parser DRBDStatusSource

The parser for a whole DRBD status file.

localRemoteParser :: Parser a -> Parser (LocalRemote a)Source

ioFlagsParser :: Parser StringSource

commaIntParser :: Parser IntSource

Haskell does not recognise ',' as the thousands separator every 3 digits but DRBD uses it, so we need an ah-hoc parser. If a number beginning with more than 3 digits without a comma is parsed, only the first 3 digits are considered to be valid, the rest is not consumed, and left for further parsing.

commaIntHelper :: Int -> Parser IntSource