Skip to content
Snippets Groups Projects
Commit ecc69052 authored by Pavel Břoušek's avatar Pavel Břoušek
Browse files

chore: merge branch 'monitoring_general' into 'main'

feat: script calling non-python monitoring scripts

Closes PRX-222

See merge request perun-proxy-aai/python/perun-proxy-utils!30
parents 2813e037 159b00b5
No related branches found
No related tags found
1 merge request!30feat: script calling non-python monitoring scripts
Pipeline #278240 passed with warnings
#!/usr/bin/env python3
import argparse
import subprocess
import sys
"""
general script to run non-python checks by a custom-defined command
"""
def get_args():
"""
Supports the command-line arguments listed below.
"""
parser = argparse.ArgumentParser(description="Custom command to run")
parser.add_argument(
"-c",
"--command",
required=True,
help="whole command to be executed",
)
return parser.parse_args()
def main():
args = get_args()
result = subprocess.run(args.command, shell=True, text=True, capture_output=True)
print(result.stdout, end="")
return result.returncode
if __name__ == "__main__":
sys.exit(main())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment