From 5c6cf2bf9c09f379cca28947fe6af0ec413c1fc4 Mon Sep 17 00:00:00 2001 From: Loys Ollivier Date: Wed, 27 Dec 2017 13:59:42 +0100 Subject: utils: Verify that callback options are correct When using callbacks, the user must specify '--callback-to' and '--callback-from'. Make these two arguments mutually dependant. If one is specified, the other becomes mandatory as well. Edit exceptions returns so they give meaningful information to the user in case something went wrong while reading from the callback configuration file. Change-Id: Iaa0de0b6f01ba605407db2f37c3da97aa0cacbc2 Signed-off-by: Loys Ollivier --- utils/create-jobs.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'utils/create-jobs.py') diff --git a/utils/create-jobs.py b/utils/create-jobs.py index 5a146c4..83ee922 100755 --- a/utils/create-jobs.py +++ b/utils/create-jobs.py @@ -49,6 +49,9 @@ def parse_cmdline(machines, tests, rfs_types): args = parser.parse_args() + if (bool(args.callback_from) ^ bool(args.callback_to)): + parser.error("To specify callbacks both '--callback-to' and '--callback-from' are mandatory.") + if (args.url == 'release'): if (args.url_branch is None) and (args.url_version is None): args.url = 'default' -- cgit 1.2.3-korg