initremote: Avoid recording remote's description before checking that its config is valid.
This commit is contained in:
parent
1b8a934e8b
commit
13e9b275dd
3 changed files with 17 additions and 7 deletions
|
@ -38,18 +38,19 @@ start (name:ws) = do
|
||||||
t <- findType fullconfig
|
t <- findType fullconfig
|
||||||
|
|
||||||
showStart "initremote" name
|
showStart "initremote" name
|
||||||
next $ perform t u $ M.union config c
|
next $ perform t u name $ M.union config c
|
||||||
|
|
||||||
where
|
where
|
||||||
config = Logs.Remote.keyValToConfig ws
|
config = Logs.Remote.keyValToConfig ws
|
||||||
|
|
||||||
perform :: RemoteType -> UUID -> R.RemoteConfig -> CommandPerform
|
perform :: RemoteType -> UUID -> String -> R.RemoteConfig -> CommandPerform
|
||||||
perform t u c = do
|
perform t u name c = do
|
||||||
c' <- R.setup t u c
|
c' <- R.setup t u c
|
||||||
next $ cleanup u c'
|
next $ cleanup u name c'
|
||||||
|
|
||||||
cleanup :: UUID -> R.RemoteConfig -> CommandCleanup
|
cleanup :: UUID -> String -> R.RemoteConfig -> CommandCleanup
|
||||||
cleanup u c = do
|
cleanup u name c = do
|
||||||
|
describeUUID u name
|
||||||
Logs.Remote.configSet u c
|
Logs.Remote.configSet u c
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -61,7 +62,6 @@ findByName name = do
|
||||||
where
|
where
|
||||||
generate = do
|
generate = do
|
||||||
uuid <- liftIO genUUID
|
uuid <- liftIO genUUID
|
||||||
describeUUID uuid name
|
|
||||||
return (uuid, M.insert nameKey name M.empty)
|
return (uuid, M.insert nameKey name M.empty)
|
||||||
|
|
||||||
findByName' :: String -> M.Map UUID R.RemoteConfig -> Maybe (UUID, R.RemoteConfig)
|
findByName' :: String -> M.Map UUID R.RemoteConfig -> Maybe (UUID, R.RemoteConfig)
|
||||||
|
|
7
debian/changelog
vendored
7
debian/changelog
vendored
|
@ -1,3 +1,10 @@
|
||||||
|
git-annex (3.20120722) UNRELEASED; urgency=low
|
||||||
|
|
||||||
|
* initremote: Avoid recording remote's description before checking
|
||||||
|
that its config is valid.
|
||||||
|
|
||||||
|
-- Joey Hess <joeyh@debian.org> Fri, 27 Jul 2012 21:04:47 -0400
|
||||||
|
|
||||||
git-annex (3.20120721) unstable; urgency=low
|
git-annex (3.20120721) unstable; urgency=low
|
||||||
|
|
||||||
* get, move, copy: Now refuse to do anything when the requested file
|
* get, move, copy: Now refuse to do anything when the requested file
|
||||||
|
|
|
@ -60,3 +60,6 @@ bloom filter size: 16 mebibytes (0% full)
|
||||||
backend usage:
|
backend usage:
|
||||||
x00:atest jtang$
|
x00:atest jtang$
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
> Indeed, I broke that in June by making it record the name in a much too
|
||||||
|
> early stage. Now fixed. [[done]] --[[Joey]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue