File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
services/datalad/datalad_service/common Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 55from botocore .config import Config
66
77import datalad_service .config
8- from datalad_service .common .annex import annex_initremote
8+ from datalad_service .common .annex import annex_initremote , is_git_annex_remote
99
1010
1111class S3ConfigException (Exception ):
@@ -135,13 +135,18 @@ def update_s3_sibling(dataset_path):
135135 check = True ,
136136 cwd = dataset_path ,
137137 )
138- subprocess .run (
139- ['git-annex' , 'enableremote' , get_s3_backup_remote ()]
140- + generate_s3_annex_options (dataset_path , backup = True ),
141- check = True ,
142- cwd = dataset_path ,
143- env = backup_remote_env (),
144- )
138+ # Setup the backup remote if it doesn't exist yet
139+ if not is_git_annex_remote (dataset_path , get_s3_backup_remote ()):
140+ setup_s3_backup_sibling_workaround (dataset_path )
141+ else :
142+ # Update the backup remote config
143+ subprocess .run (
144+ ['git-annex' , 'enableremote' , get_s3_backup_remote ()]
145+ + generate_s3_annex_options (dataset_path , backup = True ),
146+ check = True ,
147+ cwd = dataset_path ,
148+ env = backup_remote_env (),
149+ )
145150
146151
147152def validate_s3_config (dataset_path ):
You can’t perform that action at this time.
0 commit comments