- self._specification["input"]["builds"][job] = list()
- for build in builds:
- self._specification["input"]["builds"][job].\
- append({"build": build["build"],
- "status": "downloaded",
- "file-name": self._replace_tags(
- build["file"],
- self.environment["paths"])})
- else:
- logging.warning("No build is defined for the job '{}'. "
- "Trying to continue without it.".
- format(job))
+ if isinstance(builds, dict):
+ build_nr = builds.get("end", None)
+ try:
+ build_nr = int(build_nr)
+ except ValueError:
+ # defined as a range <start, build_type>
+ build_nr = self._get_build_number(job, build_nr)
+ builds = [x for x in range(builds["start"], build_nr+1)]
+ self.configuration["data-sets"][set_name][job] = builds
+
+ # Mapping table:
+ mapping = None
+ mapping_file_name = self._specification["configuration"].\
+ get("mapping-file", None)
+ if mapping_file_name:
+ logging.debug("Mapping file: '{0}'".format(mapping_file_name))
+ try:
+ with open(mapping_file_name, 'r') as mfile:
+ mapping = load(mfile)
+ logging.debug("Loaded mapping table:\n{0}".format(mapping))
+ except (YAMLError, IOError) as err:
+ raise PresentationError(
+ msg="An error occurred while parsing the mapping file "
+ "'{0}'.".format(mapping_file_name),
+ details=repr(err))
+ # Make sure everything is lowercase
+ if mapping:
+ self._specification["configuration"]["mapping"] = \
+ {key.lower(): val.lower() for key, val in mapping.iteritems()}
+ else:
+ self._specification["configuration"]["mapping"] = dict()
+
+ # Ignore list:
+ ignore = None
+ ignore_list_name = self._specification["configuration"].\
+ get("ignore-list", None)
+ if ignore_list_name:
+ logging.debug("Ignore list file: '{0}'".format(ignore_list_name))
+ try:
+ with open(ignore_list_name, 'r') as ifile:
+ ignore = load(ifile)
+ logging.debug("Loaded ignore list:\n{0}".format(ignore))
+ except (YAMLError, IOError) as err:
+ raise PresentationError(
+ msg="An error occurred while parsing the ignore list file "
+ "'{0}'.".format(ignore_list_name),
+ details=repr(err))
+ # Make sure everything is lowercase
+ if ignore:
+ self._specification["configuration"]["ignore"] = \
+ [item.lower() for item in ignore]
+ else:
+ self._specification["configuration"]["ignore"] = list()