diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property.hs | 9 | ||||
| -rw-r--r-- | src/Propellor/Property/Ssh.hs | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/Propellor/Property.hs b/src/Propellor/Property.hs index e3d46eae..c7a03765 100644 --- a/src/Propellor/Property.hs +++ b/src/Propellor/Property.hs @@ -37,6 +37,15 @@ combineProperties desc ps = Property desc (go ps NoChange) (combineAttrs ps) FailedChange -> return FailedChange _ -> go ls (r <> rs) +-- | Does not stop on failure (but does propigate failure at the end). +combineProperties' :: Desc -> [Property] -> Property +combineProperties' desc ps = Property desc (go ps NoChange) (combineAttrs ps) + where + go [] rs = return rs + go (l:ls) rs = do + r <- ensureProperty l + go ls (r <> rs) + -- | Combines together two properties, resulting in one property -- that ensures the first, and if the first succeeds, ensures the second. -- The property uses the description of the first property. diff --git a/src/Propellor/Property/Ssh.hs b/src/Propellor/Property/Ssh.hs index 061f440c..ba0311cc 100644 --- a/src/Propellor/Property/Ssh.hs +++ b/src/Propellor/Property/Ssh.hs @@ -97,7 +97,7 @@ hostKey keytype = combineProperties desc -- | Sets up a user with a ssh private key and public key pair -- from the site's PrivData. keyImported :: SshKeyType -> UserName -> Property -keyImported keytype user = combineProperties desc +keyImported keytype user = combineProperties' desc [ property desc (install writeFile (SshPubKey keytype user) ".pub") , property desc (install writeFileProtected (SshPrivKey keytype user) "") ] |
