Commit 5382b56d authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'v0-hotfixes' into 'v0.10.9'

Merge v0-hotfixes into v0.10.9

See merge request !449
parents 00e1ed8c 0a238314
Pipeline #114692 passed with stages
in 26 minutes and 59 seconds
......@@ -91,18 +91,13 @@ response_types = [
def rdf_respose(g: Graph) -> Response:
args = arg_parser.parse_args()
format_ = args.get('format')
accept_header = None
if format_ is None:
accept_header = request.headers.get('Accept', None)
if accept_header is not None:
format_ = all_repsonse_types.get(accept_header, 'pretty-xml')
accept_header = None
format_ = 'pretty-xml'
if accept_header is not None:
content_type = accept_header
content_type = next(key for key, value in all_repsonse_types.items() if value == format_)
except StopIteration:
......@@ -404,8 +404,9 @@ def re_pack(ctx, uploads, parallel: int):
@uploads.command(help='Prepares files for being used in the upcoming NOMAD v1.0.')
@click.argument('UPLOADS', nargs=-1)
@click.option('--dry', is_flag=True, help='Just check, do nothing.')
@click.option('-f', '--force', is_flag=True, help='Ignore warnings and perform the operation regardless.')
def prepare_migration(ctx, uploads, dry):
def prepare_migration(ctx, uploads, dry, force):
Removes one of the raw files, either public or restricted depending on the embargo.
Files that need to be removed are saved as `quarantined` in the upload folder.
......@@ -446,7 +447,7 @@ def prepare_migration(ctx, uploads, dry):
if not to_move.exists():
print(' obsolute was already removed', upload.upload_id, to_move.os_path)
elif to_stay.size < to_move.size:
elif to_stay.size < to_move.size and not force:
print(' !!! likely inconsistent pack !!!')
elif to_move.size == 22:
......@@ -454,7 +455,7 @@ def prepare_migration(ctx, uploads, dry):
print(' removed empty zip', upload.upload_id, to_move.os_path)
elif with_embargo:
elif with_embargo and not force:
print(' !!! embargo upload with non empty public file !!!')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment