From 805340f3304fbc2962ce334f4d887c4cbf28395c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Feb 2014 15:56:26 -0400 Subject: glacier: Do not try to run glacier value create when an existing glacier remote is enabled. --- Remote/Glacier.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Remote') 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." -- cgit v1.2.3