Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
atlas-physics
pmg
MC Job Options
Commits
236ff4d6
Commit
236ff4d6
authored
May 12, 2021
by
Spyros Argyropoulos
Committed by
Christian Gutschow
May 12, 2021
Browse files
fix
parent
11cfbe6b
Pipeline
#2601431
passed with stages
in 1 minute and 1 second
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
scripts/jo_utils.py
View file @
236ff4d6
...
...
@@ -39,9 +39,8 @@ def _read_param_from_jo(jo, names, ignore_case=False):
# See https://gitlab.cern.ch/atlas-physics/pmg/mcjoboptions/-/issues/98
def
_read_param_from_jo_withDict
(
jo
,
type
,
param
):
locals
=
{
type
:
argparse
.
Namespace
()}
skipLines
=
[
"os.system"
,
"subprocess.call"
,
"subprocess.Popen"
]
# skip lines containing these calls
for
line
in
jo
.
splitlines
():
if
any
(
x
in
line
for
x
in
skipL
ine
s
)
:
continue
if
"os.system"
or
"subprocess.call"
or
"subprocess.Popen"
in
l
ine
:
continue
# for security
try
:
exec
(
line
,
{},
locals
)
except
:
...
...
@@ -56,11 +55,9 @@ def _env_set(jo, param):
os
.
environ
.
clear
()
# dictionary to store environment variables
locals
=
dict
()
# skip lines containing these calls
skipLines
=
[
"os.system"
,
"subprocess.call"
,
"subprocess.Popen"
]
# Execute jO
for
line
in
jo
.
splitlines
():
if
any
(
x
in
line
for
x
in
skipL
ine
s
)
:
continue
if
"os.system"
or
"subprocess.call"
or
"subprocess.Popen"
in
l
ine
:
continue
# for security
try
:
exec
(
line
.
strip
(),
globals
(),
locals
)
except
:
...
...
Write
Preview
Supports
Markdown
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