aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCleber Rosa <crosa@redhat.com>2020-09-04 12:42:56 -0400
committerThomas Huth <thuth@redhat.com>2020-10-13 12:48:17 +0200
commit79df438eeb5e754a0ae22210238e4e6555e7428f (patch)
tree06a94b9210e554d0a48c4f0ad4d2cb8e53ee28ad
parent91641d555ae06726169f6ec8b57caeebcb0b71d0 (diff)
downloadqemu-79df438eeb5e754a0ae22210238e4e6555e7428f.zip
qemu-79df438eeb5e754a0ae22210238e4e6555e7428f.tar.gz
qemu-79df438eeb5e754a0ae22210238e4e6555e7428f.tar.bz2
scripts/ci/gitlab-pipeline-status: handle keyboard interrupts
So that exits based on user requests are handled more gracefully. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20200904164258.240278-6-crosa@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
-rwxr-xr-xscripts/ci/gitlab-pipeline-status6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/ci/gitlab-pipeline-status b/scripts/ci/gitlab-pipeline-status
index 8355b6a..ced488f 100755
--- a/scripts/ci/gitlab-pipeline-status
+++ b/scripts/ci/gitlab-pipeline-status
@@ -132,7 +132,7 @@ def main():
"""
parser = create_parser()
args = parser.parse_args()
-
+ success = False
try:
if args.wait:
success = wait_on_pipeline_success(
@@ -145,9 +145,11 @@ def main():
args.commit)
success = status['status'] == 'success'
except Exception as error: # pylint: disable=W0703
- success = False
if args.verbose:
print("ERROR: %s" % error.args[0])
+ except KeyboardInterrupt:
+ if args.verbose:
+ print("Exiting on user's request")
if success:
if args.verbose: