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
beat
beat.backend.python
Commits
80f425e6
Commit
80f425e6
authored
Jul 24, 2019
by
Samuel GAIST
Browse files
[scripts][execute] Clean run directory parameter handling
parent
2309b0eb
Changes
1
Show whitespace changes
Inline
Side-by-side
beat/backend/python/scripts/execute.py
View file @
80f425e6
...
...
@@ -194,15 +194,16 @@ def main():
logger
.
debug
(
"zmq client connected to loop `%s'"
,
loop_addr
)
# Check the dir
if
not
os
.
path
.
exists
(
args
[
"<dir>"
]):
run_directory
=
args
[
"<dir>"
]
if
not
os
.
path
.
exists
(
run_directory
):
send_error
(
logger
,
socket
,
"sys"
,
"Running directory `%s' not found"
%
args
[
"<dir>"
]
logger
,
socket
,
"sys"
,
"Running directory `%s' not found"
%
run_directory
)
close
(
logger
,
[
socket
,
db_socket
,
loop_socket
],
context
)
return
1
# Load the configuration
with
open
(
os
.
path
.
join
(
args
[
"<dir>"
]
,
"configuration.json"
),
"r"
)
as
f
:
with
open
(
os
.
path
.
join
(
run_directory
,
"configuration.json"
),
"r"
)
as
f
:
cfg
=
simplejson
.
load
(
f
)
# Create a new user with less privileges (if necessary)
...
...
@@ -246,7 +247,7 @@ def main():
# Sets up the execution
executor
=
AlgorithmExecutor
(
socket
,
args
[
"<dir>"
]
,
run_directory
,
cache_root
=
cache
,
db_socket
=
db_socket
,
loop_socket
=
loop_socket
,
...
...
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