diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-07 17:32:27 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-07 17:32:27 -0400 |
| commit | ba76d7689e82a7ed2ea1e88c520cdc3d99b18773 (patch) | |
| tree | bf4b59b2129f3b3c02e5aa600ec24ca4385a84b9 /src/Propellor | |
| parent | c0b502390fd06482500d8298c80a55489198dc9f (diff) | |
minor style improvements
Diffstat (limited to 'src/Propellor')
| -rw-r--r-- | src/Propellor/Property/ZFS/Process.hs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/Propellor/Property/ZFS/Process.hs b/src/Propellor/Property/ZFS/Process.hs index 61d4473c..372bac6d 100644 --- a/src/Propellor/Property/ZFS/Process.hs +++ b/src/Propellor/Property/ZFS/Process.hs @@ -11,15 +11,12 @@ import Data.List -- | Gets the properties of a ZFS volume. zfsGetProperties :: ZFS -> IO ZFSProperties zfsGetProperties z = - let - plist = fromPropertyList . map (\(_:k:v:_) -> (k, v)) . (map (split "\t")) - in - do - plist <$> runZfs "get" [Just "-H", Just "-p", Just "all"] z + let plist = fromPropertyList . map (\(_:k:v:_) -> (k, v)) . (map (split "\t")) + in plist <$> runZfs "get" [Just "-H", Just "-p", Just "all"] z zfsExists :: ZFS -> IO Bool -zfsExists z = - any id . map (isInfixOf (zfsName z)) <$> runZfs "list" [Just "-H"] z +zfsExists z = any id . map (isInfixOf (zfsName z)) + <$> runZfs "list" [Just "-H"] z -- | Runs the zfs command with the arguments. -- @@ -28,11 +25,7 @@ zfsExists z = -- -- Replaces Nothing in the argument list with the ZFS pool/dataset. runZfs :: String -> [Maybe String] -> ZFS -> IO [String] -runZfs cmd args z = - let - (p, a) = zfsCommand cmd args z - in - lines <$> readProcess p a +runZfs cmd args z = lines <$> uncurry readProcess (zfsCommand cmd args z) -- | Return the ZFS command line suitable for readProcess or cmdProperty. zfsCommand :: String -> [Maybe String] -> ZFS -> (String, [String]) |
