+ # Data sets: Replace ranges by lists
+ for set_name, data_set in self.configuration["data-sets"].items():
+ for job, builds in data_set.items():
+ if builds:
+ if isinstance(builds, dict):
+ # defined as a range <start, end>
+ if builds.get("end", None) == "lastSuccessfulBuild":
+ # defined as a range <start, lastSuccessfulBuild>
+ ret_code, build_nr, _ = get_last_build_number(
+ self.environment["urls"]["URL[JENKINS,CSIT]"],
+ job)
+ if ret_code != 0:
+ raise PresentationError(
+ "Not possible to get the number of the "
+ "last successful build.")
+ else:
+ # defined as a range <start, end (build number)>
+ build_nr = builds.get("end", None)
+ builds = [x for x in range(1, int(build_nr)+1)]
+ self.configuration["data-sets"][set_name][job] = builds
+