@@ -309,6 +309,8 @@ def _download_file_metadata(self, host, secret_key, fileid, filepath):
309
309
(fd , md_file ) = tempfile .mkstemp (suffix = md_name , dir = md_dir )
310
310
311
311
with os .fdopen (fd , "wb" ) as tmp_file :
312
+ print ("Writing metadata to %s" % md_file )
313
+ print (file_md )
312
314
tmp_file .write (json .dumps (file_md ))
313
315
314
316
return (md_dir , md_file )
@@ -327,12 +329,21 @@ def _prepare_dataset(self, host, secret_key, resource):
327
329
tmp_dirs_created .append (temp_link_dir )
328
330
329
331
# Check if miniomounted path is set and if the file is in the minio mounted path
330
- if self .minio_mounted_path :
331
- for file in resource ['files' ]:
332
- file_path = self ._check_for_local_file (file , file ['id' ])
333
- if file_path :
334
- # print("Found file locally: %s" % file_path)
335
- located_files .append (file_path )
332
+ # if self.minio_mounted_path:
333
+ # for file in resource['files']:
334
+ # file_path = self._check_for_local_file(file, file['id'])
335
+ # if not file_path:
336
+ # missing_files.append(file)
337
+ # else:
338
+ # md_file_path = file['name'].split('.')[0] + "_metadata.json"
339
+ # (file_md_dir, file_md_tmp) = self._download_file_metadata(host, secret_key, file['id'], md_file_path)
340
+ # located_files.append(file_path)
341
+ # located_files.append(file_md_tmp)
342
+ # tmp_files_created.append(file_md_tmp)
343
+ # tmp_dirs_created.append(file_md_dir)
344
+
345
+ # else:
346
+
336
347
#check if any files in dataset accessible locally
337
348
ds_file_list = pyclowder .datasets .get_file_list (self , host , secret_key , resource ["id" ])
338
349
for ds_file in ds_file_list :
@@ -349,7 +360,7 @@ def _prepare_dataset(self, host, secret_key, resource):
349
360
350
361
# Also get file metadata in format expected by extrator
351
362
(file_md_dir , file_md_tmp ) = self ._download_file_metadata (host , secret_key , ds_file ['id' ],
352
- ds_file ['filepath' ])
363
+ ds_file ['filepath' ])
353
364
located_files .append (file_path )
354
365
located_files .append (file_md_tmp )
355
366
tmp_files_created .append (file_md_tmp )
@@ -393,6 +404,7 @@ def _prepare_dataset(self, host, secret_key, resource):
393
404
except Exception as e :
394
405
logger .exception ("No files found and download failed" )
395
406
407
+ print ("File paths: %s" % file_paths )
396
408
return (file_paths , tmp_files_created , tmp_dirs_created )
397
409
398
410
# pylint: disable=too-many-branches,too-many-statements
0 commit comments