Verified Commit 4099eba4 authored by Adam Mercer's avatar Adam Mercer
Browse files

pep8 formatting changes

parent 9da7edc9
......@@ -30,58 +30,63 @@ import subprocess
# metadata
#
__version__= "0.0.1"
__version__ = "0.0.1"
__target__ = "sandbox"
#
# helper methods
#
def parse_options():
# define option parser
parser = argparse.ArgumentParser(description='Build RPMs using Koji')
parser.add_argument('--version', action='version', version=__version__)
parser.add_argument('srpm', help='Source RPM to build with Koji')
koji_options = parser.add_argument_group('Koji Options')
koji_options.add_argument('--target', default=__target__,
help='Koji tag to tag (%s)' % __target__)
# define option parser
parser = argparse.ArgumentParser(description='Build RPMs using Koji')
parser.add_argument('--version', action='version', version=__version__)
parser.add_argument('srpm', help='Source RPM to build with Koji')
koji_options = parser.add_argument_group('Koji Options')
koji_options.add_argument('--target', default=__target__,
help='Koji tag to tag (%s)' % __target__)
# parse options
args = parser.parse_args()
# parse options
args = parser.parse_args()
# check that source-rpm exists
srpm = pathlib.Path(args.srpm)
if not srpm.is_file():
print('File %s does not exist.' % args.srpm)
sys.exit(1)
# check that source-rpm exists
srpm = pathlib.Path(args.srpm)
if not srpm.is_file():
print('File %s does not exist.' % args.srpm)
sys.exit(1)
return args
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.STDOUT)
except subprocess.CalledProcessError as e:
print('Authentication failed, do you have a valid kerberos ticket?')
sys.exit(1)
return
try:
subprocess.check_call(['koji', 'moshimoshi'],
stdout=subprocess.DEVNULL,
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError:
print('Authentication failed, do you have a valid kerberos ticket?')
sys.exit(1)
return
#
# main program
#
def main():
args = parse_options()
print('source-rpm = %s' % args.srpm)
print('target tag = %s' % args.target)
args = parse_options()
print('source-rpm = %s' % args.srpm)
print('target tag = %s' % args.target)
# check that we can authenticate to koji
check_connection_to_koji()
# check that we can authenticate to koji
check_connection_to_koji()
#
# main program entry point
#
if __name__ == '__main__':
main()
main()
Markdown is supported
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