when ssh key data is missing, allow both error messages to be printed
This commit is contained in:
parent
a4dd315d3c
commit
969db1ed56
|
@ -196,6 +196,7 @@ hosts = -- (o) `
|
|||
& Apt.installed ["obnam", "sshfs", "rsync"]
|
||||
& JoeySites.githubBackup
|
||||
& JoeySites.obnamRepos ["wren", "pell"]
|
||||
& Ssh.knownHost hosts "usw-s002.rsync.net" "joey"
|
||||
|
||||
& alias "podcatcher.kitenet.net"
|
||||
& Apt.installed ["git-annex"]
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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) "")
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue