Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
perun-proxy-utils
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Perun
Perun ProxyIdP
perun-proxy-utils
Commits
53e638a4
Verified
Commit
53e638a4
authored
2 months ago
by
Jan Pavlíček
Browse files
Options
Downloads
Patches
Plain Diff
feat: run_probes.py now allows to select probes to run with optional argument
parent
48158f6f
No related branches found
No related tags found
1 merge request
!78
feat: run_probes.py now allows to select probes to run with optional argument
Pipeline
#615595
passed
2 months ago
Stage: .pre
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
perun/proxy/utils/run_probes.py
+21
-0
21 additions, 0 deletions
perun/proxy/utils/run_probes.py
with
21 additions
and
0 deletions
perun/proxy/utils/run_probes.py
+
21
−
0
View file @
53e638a4
#!/usr/bin/python3
import
argparse
import
re
import
subprocess
import
sys
...
...
@@ -73,9 +74,27 @@ def run_probe(probe_name, command, timeout):
return
result
.
returncode
def
parse_arguments
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
-p
"
,
"
--probes
"
,
nargs
=
"
+
"
,
default
=
[],
help
=
"
Optional list of probes to run from the config.
"
"
If not specified, all probes will be run.
"
,
)
args
=
parser
.
parse_args
()
return
args
def
main
():
args
=
parse_arguments
()
probes_to_run
=
args
.
probes
config_filepath
=
"
/etc/run_probes_cfg.yaml
"
config
=
yaml
.
safe_load
(
open_file
(
config_filepath
))
if
not
config
:
return
...
...
@@ -83,6 +102,8 @@ def main():
for
_
,
options
in
config
[
"
checks
"
].
items
():
module
=
options
[
"
module
"
]
for
name
,
args
in
options
.
get
(
"
runs
"
).
items
():
if
probes_to_run
and
name
not
in
probes_to_run
:
continue
command
=
[
"
python3
"
,
"
-m
"
,
module
]
timeout
=
global_timeout
if
args
is
not
None
:
...
...
This diff is collapsed.
Click to expand it.
Perun-GitLab Service Account
@9045464
mentioned in commit
8444fbe9
·
2 months ago
mentioned in commit
8444fbe9
mentioned in commit 8444fbe971e032cf22821b1d5d8c65e87ae53573
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment