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
f4aa174e
Commit
f4aa174e
authored
Dec 16, 2021
by
Markus Scheidgen
Browse files
Fixed repack cli after rebase.
parent
a64348e1
Pipeline
#117976
passed with stages
in 26 minutes and 26 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/cli/admin/uploads.py
View file @
f4aa174e
...
...
@@ -461,13 +461,17 @@ def process(ctx, uploads, parallel: int, process_running: bool, setting: typing.
@
uploads
.
command
(
help
=
'Repack selected uploads.'
)
@
click
.
argument
(
'UPLOADS'
,
nargs
=-
1
)
@
click
.
option
(
'--parallel'
,
default
=
1
,
type
=
int
,
help
=
'Use the given amount of parallel processes. Default is 1.'
)
@
click
.
pass_context
def
re_pack
(
ctx
,
uploads
,
parallel
:
int
):
def
re_pack
(
ctx
,
uploads
):
_
,
uploads
=
_query_uploads
(
uploads
,
**
ctx
.
obj
.
uploads_kwargs
)
_run_processing
(
uploads
,
parallel
,
lambda
upload
:
upload
.
re_pack
(),
're-packing'
,
wait_until_complete
=
False
)
for
upload
in
uploads
:
if
not
upload
.
published
:
print
(
f
'Cannot repack unpublished upload
{
upload
.
upload_id
}
'
)
continue
upload
.
upload_files
.
re_pack
(
upload
.
with_embargo
)
print
(
f
'successfully re-packed
{
upload
.
upload_id
}
'
)
@
uploads
.
command
(
help
=
'Attempt to abort the processing of uploads.'
)
...
...
tests/test_cli.py
View file @
f4aa174e
...
...
@@ -233,7 +233,7 @@ class TestAdminUploads:
published
.
save
()
result
=
invoke_cli
(
cli
,
[
'admin'
,
'uploads'
,
're-pack'
,
'--parallel'
,
'2'
,
upload_id
],
catch_exceptions
=
False
)
cli
,
[
'admin'
,
'uploads'
,
're-pack'
,
upload_id
],
catch_exceptions
=
False
)
assert
result
.
exit_code
==
0
assert
're-pack'
in
result
.
stdout
...
...
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