summaryrefslogtreecommitdiffstats
path: root/utils/create-jobs.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/create-jobs.py')
-rwxr-xr-xutils/create-jobs.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/utils/create-jobs.py b/utils/create-jobs.py
index 83ee922..e9701a5 100755
--- a/utils/create-jobs.py
+++ b/utils/create-jobs.py
@@ -5,11 +5,12 @@ import agljobtemplate
import argparse
import os
+
def parse_cmdline(machines, tests, rfs_types):
parser = argparse.ArgumentParser(description="AGL create job",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-v', action='version', version='%(prog)s 1.0')
- parser.add_argument('--machine', action='store', choices=machines,
+ parser.add_argument('--machine', action='store', choices=machines,
help="machine to generate the job for",
required=True)
parser.add_argument('--priority', '-p', action='store', dest='priority',
@@ -18,9 +19,9 @@ def parse_cmdline(machines, tests, rfs_types):
parser.add_argument('--url', '-u', action='store', dest='url',
help="url fetch base",
default='release')
- parser.add_argument('--branch', '--changeid', dest='url_branch', action='store',
+ parser.add_argument('--branch', '--changeid', dest='url_branch', action='store',
help='The branch (or changeid) to generate the job for.')
- parser.add_argument('--version', '--patchset', dest='url_version', action='store',
+ parser.add_argument('--version', '--patchset', dest='url_version', action='store',
help='The version (or patchset) to generate the job for.')
parser.add_argument('--boot', action='store', dest='rfs_type',
choices=rfs_types, help='select boot type')
@@ -30,21 +31,21 @@ def parse_cmdline(machines, tests, rfs_types):
parser.add_argument('--callback-to', action='store', dest='callback_to',
help='The KernelCI instance (name) that will receive the callback from LAVA. '
'Please read: ./templates/callback/callback_readme.txt')
- parser.add_argument('--test', dest='tests', action='store', choices=tests + ['all'],
+ parser.add_argument('--test', dest='tests', action='store', choices=tests + ['all'],
help="add these test to the job", nargs='*', default=[])
- parser.add_argument('-o', '--output', dest='job_file', action='store',
+ parser.add_argument('-o', '--output', dest='job_file', action='store',
help="destination file")
- parser.add_argument('-n', '--name', dest='job_name', action='store',
+ parser.add_argument('-n', '--name', dest='job_name', action='store',
help="job name", default='AGL-short-smoke-wip')
- parser.add_argument('--rootfs-img', dest='rootfs_img', action='store',
+ parser.add_argument('--rootfs-img', dest='rootfs_img', action='store',
help="The name of the root file system image (such as agl-demo-platform-raspberrypi3.ext4.xz)")
- parser.add_argument('--kernel-img', dest='kernel_img', action='store',
+ parser.add_argument('--kernel-img', dest='kernel_img', action='store',
help="The name of the kernel to boot (such as uImage)")
- parser.add_argument('--dtb-img', dest='dtb_img', action='store',
+ parser.add_argument('--dtb-img', dest='dtb_img', action='store',
help="The name of the dtb to use (such as uImage-bcm2710-rpi-3-b.dtb)")
- parser.add_argument('--modules-img', dest='modules_img', action='store',
+ parser.add_argument('--modules-img', dest='modules_img', action='store',
help="The name of the modules to use (such as modules.tar.xz)")
- parser.add_argument('--build-version', dest='build_version', action='store',
+ parser.add_argument('--build-version', dest='build_version', action='store',
help="the version number of the AGL build.")
args = parser.parse_args()
@@ -62,8 +63,7 @@ def parse_cmdline(machines, tests, rfs_types):
parser.error("The argument '--url daily' requires '--branch' and '--version' to be set")
elif (args.url == 'ci'):
if (not args.url_branch) or (not args.url_version):
- parser.error("The argument '--url ci' requires '--changeid' and '--patchset' to be set. "
- + "For more information on how to use patchset and changeid use --help.")
+ parser.error("The argument '--url ci' requires '--changeid' and '--patchset' to be set.")
return args
@@ -99,5 +99,6 @@ def main():
else:
print "Job written to: {}".format(args.job_file)
+
if __name__ == '__main__':
main()