diff --git a/jenkins_jobs/builder.py b/jenkins_jobs/builder.py index 7beab9400..5d7bbe34a 100644 --- a/jenkins_jobs/builder.py +++ b/jenkins_jobs/builder.py @@ -79,14 +79,6 @@ 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) diff --git a/jenkins_jobs/cli/subcommand/test.py b/jenkins_jobs/cli/subcommand/test.py index ff31285e8..a185a3d86 100644 --- a/jenkins_jobs/cli/subcommand/test.py +++ b/jenkins_jobs/cli/subcommand/test.py @@ -50,6 +50,14 @@ class TestSubCommand(update.UpdateSubCommand): help='path to output XML') def execute(self, options, jjb_config): + if not options.config_xml: + 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.') builder, xml_jobs, xml_views = self._generate_xmljobs( options, jjb_config)