scripts/ci/gitlab-pipeline-status: refactor parser creation

Out of the main function.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20200904164258.240278-5-crosa@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
Cleber Rosa 2020-09-04 12:42:55 -04:00 committed by Thomas Huth
parent db5424dfda
commit 91641d555a
1 changed files with 7 additions and 4 deletions

View File

@ -89,10 +89,7 @@ def wait_on_pipeline_success(timeout, interval,
return False
def main():
"""
Script entry point
"""
def create_parser():
parser = argparse.ArgumentParser(
prog='pipeline-status',
description='check or wait on a pipeline status')
@ -127,7 +124,13 @@ def main():
parser.add_argument('--verbose', action='store_true', default=False,
help=('A minimal verbosity level that prints the '
'overall result of the check/wait'))
return parser
def main():
"""
Script entry point
"""
parser = create_parser()
args = parser.parse_args()
try: