Skip to content

Commit df8ff14

Browse files
committed
Working on getting filepaths for local dataset
1 parent f42b344 commit df8ff14

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pyclowder/connectors.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ def _check_for_local_file(self, file_metadata, file_id=None):
277277
# Check if file is present in a minio mount (only valid for Clowder v2)
278278
if self.minio_mounted_path and file_id:
279279
minio_file_path = self.minio_mounted_path + "/" + file_id
280-
print("Checking for minio local file: %s" % minio_file_path)
281280
if os.path.isfile(minio_file_path):
282281
return minio_file_path
283282

@@ -327,7 +326,14 @@ def _prepare_dataset(self, host, secret_key, resource):
327326
temp_link_dir = tempfile.mkdtemp()
328327
tmp_dirs_created.append(temp_link_dir)
329328

330-
# first check if any files in dataset accessible locally
329+
# 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)
336+
#check if any files in dataset accessible locally
331337
ds_file_list = pyclowder.datasets.get_file_list(self, host, secret_key, resource["id"])
332338
for ds_file in ds_file_list:
333339
file_path = self._check_for_local_file(ds_file)

0 commit comments

Comments
 (0)