Skip to content

Commit

Permalink
Merge pull request #175 from sennetconsortium/maxsibilla/issue-192
Browse files Browse the repository at this point in the history
Maxsibilla/issue 192
  • Loading branch information
maxsibilla authored Oct 18, 2023
2 parents c91cd4e + 2e1c54d commit 0de96b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/routes/entity_CRUD/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def create_dataset():
def multiple_components():
if not request.is_json:
return Response("json request required", 400)
entity_type = 'dataset'
try:
component_request = request.json
auth_helper = AuthHelper.configured_instance(current_app.config['APP_CLIENT_ID'], current_app.config['APP_CLIENT_SECRET'])
Expand All @@ -105,6 +104,8 @@ def multiple_components():
if 'dataset_link_abs_dir' in dataset:
if not os.path.exists(dataset['dataset_link_abs_dir']):
return Response(f"The filepath specified with 'dataset_link_abs_dir' does not exist: {dataset['dataset_link_abs_dir']}", 500)
if not os.path.isdir(dataset['dataset_link_abs_dir']):
return Response(f"The filepath specified with 'dataset_link_abs_dir is not a directory: {dataset['dataset_link_abs_dir']}", 500)
else:
return Response("Required field 'dataset_link_abs_dir' is missing from dataset", 500)

Expand All @@ -128,6 +129,7 @@ def multiple_components():
new_directory_path = ingest_helper.get_dataset_directory_absolute_path(dataset, requested_group_uuid, dataset['uuid'])
logger.info(
f"Creating a directory as: {new_directory_path} with a symbolic link to: {dataset['dataset_link_abs_dir']}")
os.makedirs(new_directory_path)
os.symlink(dataset['dataset_link_abs_dir'], new_directory_path, True)
else:
return Response("Required field 'dataset_link_abs_dir' is missing from dataset", 500)
Expand Down

0 comments on commit 0de96b6

Please sign in to comment.