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)