summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Propellor/Property/Parted.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Propellor/Property/Parted.hs b/src/Propellor/Property/Parted.hs
index 4e2efe24..fcff089a 100644
--- a/src/Propellor/Property/Parted.hs
+++ b/src/Propellor/Property/Parted.hs
@@ -147,13 +147,15 @@ data Eep = YesReallyDeleteDiskContents
partitioned :: Eep -> FilePath -> PartTable -> Property NoInfo
partitioned eep disk (PartTable tabletype parts) = property desc $ do
isdev <- liftIO $ isBlockDevice <$> getFileStatus disk
- ensureProperty $ if isdev
- then go (map (\n -> disk ++ show n) [1 :: Int ..])
- else Partition.kpartx disk go
+ ensureProperty $ combineProperties desc
+ [ parted eep disk partedparams
+ , if isdev
+ then formatl (map (\n -> disk ++ show n) [1 :: Int ..])
+ else Partition.kpartx disk formatl
+ ]
where
desc = disk ++ " partitioned"
- go devs = combineProperties desc $
- parted eep disk partedparams : map format (zip parts devs)
+ formatl devs = combineProperties desc (map format (zip parts devs))
partedparams = concat $ mklabel : mkparts (1 :: Integer) mempty parts []
format (p, dev) = Partition.formatted' (partMkFsOpts p)
Partition.YesReallyFormatPartition (partFs p) dev