aboutsummaryrefslogtreecommitdiff
path: root/scripts/ci
diff options
context:
space:
mode:
authorCleber Rosa <crosa@redhat.com>2020-09-04 12:42:55 -0400
committerThomas Huth <thuth@redhat.com>2020-10-13 12:48:17 +0200
commit91641d555ae06726169f6ec8b57caeebcb0b71d0 (patch)
tree2becf507e3c08b5e1a8509041d3f60825e112710 /scripts/ci
parentdb5424dfda1329da226ad98904c3a26fc9f7310f (diff)
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>
Diffstat (limited to 'scripts/ci')
-rwxr-xr-xscripts/ci/gitlab-pipeline-status11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/ci/gitlab-pipeline-status b/scripts/ci/gitlab-pipeline-status
index 18609553be..8355b6a427 100755
--- a/scripts/ci/gitlab-pipeline-status
+++ b/scripts/ci/gitlab-pipeline-status
@@ -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: