webapp: Fix creation of box.com, S3, and Glacier repositories, broken in 5.20140221.

This commit is contained in:
Joey Hess 2014-02-24 15:14:44 -04:00
parent d70220e0f4
commit 45e7040142
4 changed files with 14 additions and 12 deletions

View file

@ -73,16 +73,16 @@ gen r u c gc = new <$> remoteCost gc veryExpensiveRemoteCost
glacierSetup :: Maybe UUID -> Maybe CredPair -> RemoteConfig -> Annex (RemoteConfig, UUID)
glacierSetup mu mcreds c = do
u <- maybe (liftIO genUUID) return mu
glacierSetup' (isJust mu) u mcreds c
glacierSetup' :: Bool -> UUID -> Maybe CredPair -> RemoteConfig -> Annex (RemoteConfig, UUID)
glacierSetup' enabling u mcreds c = do
c' <- setRemoteCredPair c (AWS.creds u) mcreds
glacierSetup' (isJust mu) u c'
glacierSetup' :: Bool -> UUID -> RemoteConfig -> Annex (RemoteConfig, UUID)
glacierSetup' enabling u c = do
c' <- encryptionSetup c
let fullconfig = c' `M.union` defaults
unless enabling $
genVault fullconfig u
gitConfigSpecialRemote u fullconfig "glacier" "true"
c'' <- setRemoteCredPair fullconfig (AWS.creds u) mcreds
return (c'', u)
return (c', u)
where
remotename = fromJust (M.lookup "name" c)
defvault = remotename ++ "-" ++ fromUUID u