Verified Commit 5bbac695 authored by Adam Mercer's avatar Adam Mercer
Browse files

check that we can authenticate to koji

parent fa8fa711
......@@ -24,6 +24,7 @@
import argparse
import pathlib
import sys
import subprocess
#
# metadata
......@@ -56,6 +57,15 @@ def parse_options():
return args
# method to check for connection to koji
def check_connection_to_koji():
try:
subprocess.check_call(['koji', 'moshimoshi'],
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
except subprocess.CalledProcessError as e:
print('Authentication failed, do you have a valid kerberos ticket?')
sys.exit(1)
return
#
# main program
#
......@@ -65,6 +75,9 @@ def main():
print('source-rpm = %s' % args.srpm)
print('target tag = %s' % args.target)
# check that we can authenticate to koji
check_connection_to_koji()
#
# main program entry point
#
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment