Skip to content
Snippets Groups Projects
Commit 159b00b5 authored by Johana Supíková's avatar Johana Supíková
Browse files

feat: script calling non-python monitoring scripts

parent c47c8e9f
No related branches found
No related tags found
1 merge request!30feat: script calling non-python monitoring scripts
Pipeline #278228 passed
#!/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.
Please register or to comment