From 43eb89fc5415537e9d15ed5f96294f31170ebcfc Mon Sep 17 00:00:00 2001 From: Alphadose Date: Thu, 10 May 2018 09:38:42 +0530 Subject: [PATCH] Deprecate running testjobs without config-xml flag Creation of nested folders is not possible in `project-type: folder` in test mode because the folder name conflicts with the generated XML filename and an `OSError` is thrown as a result. This can be resolved by passing the `--config-xml` flag when running the jobs in test mode. This commit displays a deprecation message asking the user to use the `--config-xml` flag. Change-Id: I6f883040ed3d9b3536ccc2fb305cdddcfde5d765 Story: #2001937 Task: #15050 --- jenkins_jobs/builder.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jenkins_jobs/builder.py b/jenkins_jobs/builder.py index d446f3862..bb2ae6e89 100644 --- a/jenkins_jobs/builder.py +++ b/jenkins_jobs/builder.py @@ -78,6 +78,14 @@ class JenkinsManager(object): output_dir = os.path.join( output_dir, os.path.basename(item)) output_fn = os.path.join(output_dir, 'config.xml') + else: + logger.warn('(Deprecated) The default output behavior of' + ' `jenkins-jobs test` when given the --output' + ' flag will change in JJB 3.0.' + ' Instead of writing jobs to OUTPUT/jobname;' + ' they will be written to OUTPUT/jobname/config.xml.' + ' The new behavior can be enabled by the passing' + ' `--config-xml` parameter.') if output_dir != output: logger.debug("Creating directory %s" % output_dir)