diff options
author | Joey Hess <joey@kitenet.net> | 2014-02-20 15:56:26 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-02-20 15:56:26 -0400 |
commit | 805340f3304fbc2962ce334f4d887c4cbf28395c (patch) | |
tree | 00b874e7156beb86ee1d788ec0968ba7e0111380 /Remote/Glacier.hs | |
parent | ebd1c5fa37ef2dcd9187e3cd20ac9be4b6c56531 (diff) |
glacier: Do not try to run glacier value create when an existing glacier remote is enabled.
Diffstat (limited to 'Remote/Glacier.hs')
-rw-r--r-- | Remote/Glacier.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Remote/Glacier.hs b/Remote/Glacier.hs index 77b16cd65..84557851b 100644 --- a/Remote/Glacier.hs +++ b/Remote/Glacier.hs @@ -73,12 +73,13 @@ 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' u mcreds c -glacierSetup' :: UUID -> Maybe CredPair -> RemoteConfig -> Annex (RemoteConfig, UUID) -glacierSetup' u mcreds c = do + glacierSetup' (isJust mu) u mcreds c +glacierSetup' :: Bool -> UUID -> Maybe CredPair -> RemoteConfig -> Annex (RemoteConfig, UUID) +glacierSetup' enabling u mcreds c = do c' <- encryptionSetup c let fullconfig = c' `M.union` defaults - genVault fullconfig u + unless enabling $ + genVault fullconfig u gitConfigSpecialRemote u fullconfig "glacier" "true" c'' <- setRemoteCredPair fullconfig (AWS.creds u) mcreds return (c'', u) @@ -245,7 +246,6 @@ archive r k = fileprefix ++ key2file k where fileprefix = M.findWithDefault "" "fileprefix" $ config r --- glacier vault create will succeed even if the vault already exists. genVault :: RemoteConfig -> UUID -> Annex () genVault c u = unlessM (runGlacier c u params) $ error "Failed creating glacier vault." |