Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
6eff468e
Commit
6eff468e
authored
Aug 01, 2019
by
Markus Scheidgen
Browse files
Added a dry option to index all calcs cli command. [skip ci]
parent
c45c69c2
Pipeline
#52969
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/cli/admin/admin.py
View file @
6eff468e
...
...
@@ -28,7 +28,8 @@ def admin(ctx):
@
admin
.
command
(
help
=
'(Re-)index all calcs.'
)
def
index
():
@
click
.
option
(
'--dry'
,
help
=
'Doe not index, only compute entries.'
,
is_flag
=
True
)
def
index
(
dry
):
infrastructure
.
setup_logging
()
infrastructure
.
setup_mongo
()
infrastructure
.
setup_elastic
()
...
...
@@ -47,6 +48,12 @@ def index():
stdout
.
flush
()
yield
datamodel
.
CalcWithMetadata
(
**
calc
.
metadata
)
failed
=
search
.
index_all
(
calc_generator
())
if
dry
:
for
_
in
calc_generator
():
pass
failed
=
0
else
:
failed
=
search
.
index_all
(
calc_generator
())
print
(
''
)
print
(
'indexing completed, %d failed entries'
%
failed
)
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