@@ -304,16 +304,17 @@ def _relocate(src, dst):
304
304
# outside of the source directories
305
305
if any (src .startswith (path + "/" ) for path in source_directories ):
306
306
_logger .debug ("Moving %s to %s" , src , dst )
307
- if os . path . isdir (src ) and os . path .isdir (dst ):
307
+ if fs_access . isdir (src ) and fs_access .isdir (dst ):
308
308
# merge directories
309
309
for dir_entry in scandir (src ):
310
- _relocate (dir_entry , os .path .join (dst , dir_entry .name ))
310
+ _relocate (dir_entry , fs_access .join (
311
+ dst , dir_entry .name ))
311
312
else :
312
313
shutil .move (src , dst )
313
314
return
314
315
315
316
_logger .debug ("Copying %s to %s" , src , dst )
316
- if os . path .isdir (src ):
317
+ if fs_access .isdir (src ):
317
318
if os .path .isdir (dst ):
318
319
shutil .rmtree (dst )
319
320
elif os .path .isfile (dst ):
@@ -326,15 +327,13 @@ def _relocate(src, dst):
326
327
pm = path_mapper (outfiles , "" , destination_path , separateDirs = False )
327
328
stageFiles (pm , stageFunc = _relocate , symLink = False )
328
329
329
- def _check_adjust (file ):
330
- file ["location" ] = file_uri (pm .mapper (file ["location" ])[1 ])
331
- if "contents" in file :
332
- del file ["contents" ]
333
- return file
330
+ def _check_adjust (a_file ):
331
+ a_file ["location" ] = file_uri (pm .mapper (a_file ["location" ])[1 ])
332
+ if "contents" in a_file :
333
+ del a_file ["contents" ]
334
+ return a_file
334
335
335
336
visit_class (outputObj , ("File" , "Directory" ), _check_adjust )
336
- if compute_checksum :
337
- visit_class (outputObj , ("File" ,), functools .partial (compute_checksums , fs_access ))
338
337
339
338
# If there are symlinks to intermediate output directories, we want to move
340
339
# the real files into the final output location. If a file is linked more than once,
@@ -369,6 +368,9 @@ def relink(relinked, # type: Dict[Text, Text]
369
368
relinked = {} # type: Dict[Text, Text]
370
369
relink (relinked , destination_path )
371
370
371
+ if compute_checksum :
372
+ visit_class (outputObj , ("File" ,), functools .partial (
373
+ compute_checksums , fs_access ))
372
374
return outputObj
373
375
374
376
0 commit comments