From 3e5ca284b7a7073a2a2308a46d6c6dbc66828169 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 23 Oct 2015 13:52:59 +0200 Subject: [PATCH] contrib/rh-bkr: add -J option to use default job template There is a default job template "job01.xml" which is usually used. Allow chosing this job template without explicitly requiring the filename. --- contrib/rh-bkr/bkr.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/rh-bkr/bkr.py b/contrib/rh-bkr/bkr.py index dd522be0fd..48a7061053 100755 --- a/contrib/rh-bkr/bkr.py +++ b/contrib/rh-bkr/bkr.py @@ -549,6 +549,7 @@ class CmdSubmit(CmdBase): self.parser.add_argument('--nitrate-test-plan', '-P', help='Select the nitrate-test-plan for loading tests. Currently supported: \'devel\' (\'18716\'), \'rhel-7.1\' (\'6726\') or the numeric id of parent plan. The default depends on the target-branch. See for example https://tcms.engineering.redhat.com/plan/18716/networkmanager#treeview') self.parser.add_argument('--tests', '-c', action='append', help='Append argument to $TESTS') self.parser.add_argument('--job', '-j', help='beaker xml job file') + self.parser.add_argument('--job-default', '-J', action='store_true', help='Use default job file. Only has effect if --job is not specified') self.parser.add_argument('--verbose', '-v', action='count', help='print more information') self.parser.add_argument('--reservesys', '-R', action='store_true', help='add task /distribution/reservesys') self.parser.add_argument('--disable-selinux', action='store_true', help='add kernel option selinux=0 to disable AVC checks ($SELINUX_DISABLED)') @@ -857,6 +858,9 @@ class CmdSubmit(CmdBase): self.argv_profile = argv_profiles[self.options.profile] self.options = self.parser.parse_args(self.argv_profile + argv) + if not self.options.job and self.options.job_default: + self.options.job = os.path.dirname(os.path.abspath(__file__)) + '/job01.xml' + if self.options.job: with open(self.options.job) as f: job0 = list(f)