Revision f5d84060
b/src/Ganeti/DataCollectors/Lv.hs | ||
---|---|---|
97 | 97 |
-- | This function computes the JSON representation of the LV status |
98 | 98 |
buildJsonReport :: Maybe FilePath -> IO J.JSValue |
99 | 99 |
buildJsonReport inputFile = do |
100 |
let (cmd:params) = lvCommand |
|
100 |
let cmd = lvCommand |
|
101 |
params = lvParams |
|
101 | 102 |
fromLvs = |
102 | 103 |
((E.try $ readProcess cmd params "") :: IO (Either IOError String)) >>= |
103 | 104 |
exitIfBad "running command" . either (BT.Bad . show) BT.Ok |
b/src/Ganeti/Storage/Lvm/LVParser.hs | ||
---|---|---|
26 | 26 |
02110-1301, USA. |
27 | 27 |
|
28 | 28 |
-} |
29 |
module Ganeti.Storage.Lvm.LVParser (lvParser, lvCommand) where |
|
29 |
module Ganeti.Storage.Lvm.LVParser (lvParser, lvCommand, lvParams) where
|
|
30 | 30 |
|
31 | 31 |
import Control.Applicative ((<*>), (*>), (<*), (<$>), Applicative, ) |
32 | 32 |
import qualified Data.Attoparsec.Text as A |
... | ... | |
70 | 70 |
-- * Parser implementation |
71 | 71 |
|
72 | 72 |
-- | The command providing the data, in the format the parser expects |
73 |
lvCommand :: [String] |
|
74 |
lvCommand = |
|
75 |
[ "lvs" |
|
76 |
, "--noheadings" |
|
73 |
lvCommand :: String |
|
74 |
lvCommand = "lvs" |
|
75 |
|
|
76 |
-- | The parameters for getting the data in the format the parser expects |
|
77 |
lvParams :: [String] |
|
78 |
lvParams = |
|
79 |
[ "--noheadings" |
|
77 | 80 |
, "--units", "B" |
78 | 81 |
, "--separator", ";" |
79 | 82 |
, "-o", "lv_uuid,lv_name,lv_attr,lv_major,lv_minor,lv_kernel_major\ |
Also available in: Unified diff