From a72a6e1ce515e0f6720fea6a3ffbdfdea7d4e3ac Mon Sep 17 00:00:00 2001 From: Marian Gasparovic Date: Tue, 19 Jan 2021 16:30:08 +0100 Subject: [PATCH] Let verify command return different return codes depending on results. Change-Id: Ie49856573dbf5bcf87837c555c046b06c569b3e9 --- CHANGELOG.rst | 8 ++++++++ rally/cli/commands/verify.py | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1dd0c56c59..d69bde6574 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,6 +17,14 @@ Changelog .. Release notes for existing releases are MUTABLE! If there is something that was missed or can be improved, feel free to change it! +[x.x.x] - 202x-xx-xx +-------------------- + +Changed +~~~~~ + +* ``rally verify`` returns 0 on success, 1, 2 or 3 depending on detected issue. + [3.2.0] - 2020-10-30 -------------------- diff --git a/rally/cli/commands/verify.py b/rally/cli/commands/verify.py index 7ee27e200d..f82e7bf414 100644 --- a/rally/cli/commands/verify.py +++ b/rally/cli/commands/verify.py @@ -526,6 +526,13 @@ class VerifyCommands(object): else: print("Verification UUID: %s." % verification_uuid) + if results["totals"]["unexpected_success"] > 0: + return 2 + if results["totals"]["failures"] > 0: + return 3 + + return 0 + @cliutils.help_group("verification") @cliutils.args("--uuid", dest="verification_uuid", type=str, required=True, help="Verification UUID. " + LIST_VERIFICATIONS_HINT)