summaryrefslogtreecommitdiffstats
path: root/utils/job-prereq.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/job-prereq.py')
-rwxr-xr-xutils/job-prereq.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/utils/job-prereq.py b/utils/job-prereq.py
index 2dadc61..f688aca 100755
--- a/utils/job-prereq.py
+++ b/utils/job-prereq.py
@@ -13,13 +13,18 @@ FILE_MAP = {
"nbdroot",
}
+FILE_MAP_X86 = {
+ "kernel",
+ "initrd",
+ "nbdroot",
+}
+
# Mapping for qemu between command line QEMU args and LAVA yaml template file names
FILE_MAP_QEMU = {
"kernel": "kernel",
"initrd": "ramdisk",
}
-
def parse_cmdline(machines):
description = "Print to stdout the file names needed to create a LAVA job"
parser = argparse.ArgumentParser(description=description,
@@ -51,15 +56,18 @@ def main():
url_version=args.build_type[2],
machine=args.machine)
job_yaml = yaml.load(job)
- if args.machine != "qemux86-64":
- for key in FILE_MAP:
+ if args.machine == "qemux86-64":
+ for key in FILE_MAP_QEMU:
+ if getattr(args, key):
+ print job_yaml["actions"][0]["deploy"]["images"][FILE_MAP_QEMU[key]].get("url").split('/')[-1]
+ elif args.machine == "intel-corei7-64":
+ for key in FILE_MAP_X86:
if getattr(args, key):
print job_yaml["actions"][0]["deploy"][key].get("url").split('/')[-1]
else:
- for key in FILE_MAP_QEMU:
+ for key in FILE_MAP:
if getattr(args, key):
- print job_yaml["actions"][0]["deploy"]["images"][FILE_MAP_QEMU[key]].get("url").split('/')[-1]
-
+ print job_yaml["actions"][0]["deploy"][key].get("url").split('/')[-1]
if __name__ == '__main__':
main()