Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
5382b56d
Commit
5382b56d
authored
Nov 09, 2021
by
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/app/flask/dcat/api.py
View file @
5382b56d
...
...
@@ -91,22 +91,17 @@ 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'
)
else
:
accept_header
=
None
format_
=
'pretty-xml'
if
accept_header
is
not
None
:
content_type
=
accept_header
else
:
try
:
content_type
=
next
(
key
for
key
,
value
in
all_repsonse_types
.
items
()
if
value
==
format_
)
except
StopIteration
:
content_type
=
'application/xml'
if
format
in
[
'xml'
,
'pretty-xml'
]
else
'text/%s'
%
format_
try
:
content_type
=
next
(
key
for
key
,
value
in
all_repsonse_types
.
items
()
if
value
==
format_
)
except
StopIteration
:
content_type
=
'application/xml'
if
format
in
[
'xml'
,
'pretty-xml'
]
else
'text/%s'
%
format_
return
Response
(
g
.
serialize
(
format
=
format_
).
decode
(
'utf-8'
),
200
,
...
...
nomad/cli/admin/uploads.py
View file @
5382b56d
...
...
@@ -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.'
)
@
click
.
pass_context
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 raw.zip 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):
to_move
.
delete
()
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 !!!'
)
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment