summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/agljobtemplate.py16
-rwxr-xr-xutils/create-jobs.py3
2 files changed, 11 insertions, 8 deletions
diff --git a/utils/agljobtemplate.py b/utils/agljobtemplate.py
index 90bad13..c2e0b4a 100644
--- a/utils/agljobtemplate.py
+++ b/utils/agljobtemplate.py
@@ -30,14 +30,14 @@ def parse_callback_file(template_path, lava_callback, kci_callback):
kci_callback = cfg.get('default', 'section')
cb_data = dict(cfg.items(kci_callback))
return cb_data
- except ConfigParser.NoSectionError:
- str_err = "Please make sure: --callback-to " + kci_callback
- str_err += " is correct and corresponds to a section in: "
- str_err += lava_callback + ".cfg"
- raise ConfigParser.NoSectionError, str_err
- except IOError:
- raise IOError, "Unable to read from file {}".format(callback_file_path)
-
+ except (ConfigParser.NoSectionError) as err:
+ str_err = "'--callback-to {}': must correspond to a section [{}] in the file '{}.cfg'".format(
+ kci_callback, kci_callback, lava_callback)
+ raise ConfigParser.NoSectionError(str_err)
+ except (IOError) as err:
+ str_err = "\n'--callback-from {}': must correspond to a file located in: ".format(lava_callback)
+ str_err += "[releng-scripts]/templates/callback/{}.cfg".format(lava_callback)
+ raise IOError(err, str_err)
class Agljobtemplate(object):
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'