Skip to content
Snippets Groups Projects
Commit ef9f99d5 authored by Jan Pavlíček's avatar Jan Pavlíček
Browse files

chore: merge branch 'run_probes' into 'main'

fix: run_probes support for probes executed without arguments and flags

See merge request perun-proxy-aai/python/perun-proxy-utils!36
parents 639a79bd 60364d4e
Branches
Tags
1 merge request!36fix: run_probes support for probes executed without arguments and flags
Pipeline #305040 passed with warnings
......@@ -53,3 +53,8 @@ check_syncrepl:
only-check-contextCSN:
W: 900
C: 3600
check_exabgp_propagation:
module: perun.proxy.utils.nagios.check_exabgp_propagation
runs:
check_exabgp_propagation:
......@@ -42,18 +42,19 @@ def main():
module = options["module"]
for name, args in options.get("runs").items():
command = ["python3", "-m", module]
for arg_name, arg_val in args.items():
if len(arg_name) == 1:
arg_name = "-" + arg_name
else:
arg_name = "--" + arg_name
if arg_val is True:
arg_val = "true"
elif arg_val is False:
arg_val = "false"
command.append(arg_name)
if arg_val is not None:
command.append(str(arg_val))
if args is not None:
for arg_name, arg_val in args.items():
if len(arg_name) == 1:
arg_name = "-" + arg_name
else:
arg_name = "--" + arg_name
if arg_val is True:
arg_val = "true"
elif arg_val is False:
arg_val = "false"
command.append(arg_name)
if arg_val is not None:
command.append(str(arg_val))
Thread(target=run_probe, args=[name, command]).start()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment