Removed unnecessary parameter from delete_old_jobs

Also removed the extra return value from the update_jobs method.

Change-Id: Ide838ec5313f736f7a9b4e696f82beb3d9805d57
Signed-off-by: David Caro <dcaroest@redhat.com>
This commit is contained in:
David Caro 2015-05-06 16:57:01 +02:00 committed by Darragh Bailey
parent 8839388aa3
commit 32f402f3e5
2 changed files with 4 additions and 3 deletions
jenkins_jobs

@ -242,9 +242,11 @@ class Builder(object):
else:
self.parser.parse(in_file)
def delete_old_managed(self, keep):
def delete_old_managed(self, keep=None):
jobs = self.jenkins.get_jobs()
deleted_jobs = 0
if keep is None:
keep = [job.name for job in self.parser.xml_jobs]
for job in jobs:
if job['name'] not in keep and \
self.jenkins.is_managed(job['name']):

@ -295,8 +295,7 @@ def execute(options, config):
options.names)
logger.info("Number of jobs updated: %d", num_updated_jobs)
if options.delete_old:
num_deleted_jobs = builder.delete_old_managed(
keep=[x.name for x in jobs])
num_deleted_jobs = builder.delete_old_managed()
logger.info("Number of jobs deleted: %d", num_deleted_jobs)
elif options.command == 'test':
builder.update_job(options.path, options.name,