From d2d7c3f3f982068b0162c7d13b52827a2bdd0619 Mon Sep 17 00:00:00 2001 From: "Timothy R. Chavez" Date: Mon, 15 Aug 2016 21:18:40 -0500 Subject: [PATCH] Use xml_jobs not jobs Fixes a regression where using --delete-old will delete jobs that are not updated for example in the case of caching and jenkins-jobs determines a job does not need to be updated. jobs returns a list of jobs that were updated via jenkins-jobs while xml_jobs returns a list of all jobs generated jobs regardless of if they were updated or not. Change-Id: I8f9d0b609d1a7cc0a526d479b4f0a2448c25aba3 --- jenkins_jobs/cli/subcommand/update.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jenkins_jobs/cli/subcommand/update.py b/jenkins_jobs/cli/subcommand/update.py index 739632bc8..be7dd8eac 100644 --- a/jenkins_jobs/cli/subcommand/update.py +++ b/jenkins_jobs/cli/subcommand/update.py @@ -96,7 +96,7 @@ class UpdateSubCommand(base.BaseSubCommand): n_workers=options.n_workers) logger.info("Number of jobs updated: %d", num_updated_jobs) - keep_jobs = [job.name for job in jobs] + keep_jobs = [job.name for job in xml_jobs] if options.delete_old: n = builder.delete_old_managed(keep=keep_jobs) logger.info("Number of jobs deleted: %d", n)