diff options
author | Joey Hess <joey@kitenet.net> | 2012-07-27 21:05:27 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-07-27 21:05:27 -0400 |
commit | 13e9b275dd96673e5a3421b64d672abdd29e9a26 (patch) | |
tree | ce30b153787a7e634d2260d86f18ddf8726bb9ef /Command/InitRemote.hs | |
parent | 1b8a934e8be28ac8632f9345f867d68203d84cd1 (diff) |
initremote: Avoid recording remote's description before checking that its config is valid.
Diffstat (limited to 'Command/InitRemote.hs')
-rw-r--r-- | Command/InitRemote.hs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Command/InitRemote.hs b/Command/InitRemote.hs index a78505a19..ad93529cc 100644 --- a/Command/InitRemote.hs +++ b/Command/InitRemote.hs @@ -38,18 +38,19 @@ start (name:ws) = do t <- findType fullconfig showStart "initremote" name - next $ perform t u $ M.union config c + next $ perform t u name $ M.union config c where config = Logs.Remote.keyValToConfig ws -perform :: RemoteType -> UUID -> R.RemoteConfig -> CommandPerform -perform t u c = do +perform :: RemoteType -> UUID -> String -> R.RemoteConfig -> CommandPerform +perform t u name c = do c' <- R.setup t u c - next $ cleanup u c' + next $ cleanup u name c' -cleanup :: UUID -> R.RemoteConfig -> CommandCleanup -cleanup u c = do +cleanup :: UUID -> String -> R.RemoteConfig -> CommandCleanup +cleanup u name c = do + describeUUID u name Logs.Remote.configSet u c return True @@ -61,7 +62,6 @@ findByName name = do where generate = do uuid <- liftIO genUUID - describeUUID uuid name return (uuid, M.insert nameKey name M.empty) findByName' :: String -> M.Map UUID R.RemoteConfig -> Maybe (UUID, R.RemoteConfig) |