From f0b52ec41a93416a89b3257adb3ea33828c7252a Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Wed, 1 Mar 2023 12:43:38 +0100 Subject: [PATCH] Fix --enabled-only option when updating jobs Commit 5e61fbaf00c97 added a new --enabled-only option but that doesn't work correctly because the xml_jobs_filtered variable isn't filled with all the jobs in the end. So some jobs are not updated even if the disabled status was not found. That's fixed now. Change-Id: I915116cf875e9e20c10ca43175c924b9e4307cca --- jenkins_jobs/cli/subcommand/update.py | 2 +- tests/cmd/fixtures/cmd-002.yaml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/jenkins_jobs/cli/subcommand/update.py b/jenkins_jobs/cli/subcommand/update.py index 2099bd9f3..d82f66906 100644 --- a/jenkins_jobs/cli/subcommand/update.py +++ b/jenkins_jobs/cli/subcommand/update.py @@ -149,7 +149,7 @@ class UpdateSubCommand(base.BaseSubCommand): if el is not None: if el.text == "true": continue - xml_jobs_filtered.append(xml_job) + xml_jobs_filtered.append(xml_job) logging.info( "Will only deploy enabled jobs " diff --git a/tests/cmd/fixtures/cmd-002.yaml b/tests/cmd/fixtures/cmd-002.yaml index 70d9e66e0..26e7948da 100644 --- a/tests/cmd/fixtures/cmd-002.yaml +++ b/tests/cmd/fixtures/cmd-002.yaml @@ -1,5 +1,4 @@ - job-template: - disabled: false name: 'bar001' description: 'My first job'