Remove superfluous calls to matches()

Remove unnecessary calls to matches() and ensure that delete_job() is
correctly passing the jobs_glob argument to the expandYaml() method call
since it uses a string whereas update_job() is using a sequence of
strings.

Once the bug with how delete_job is calling expandYaml() is fixed, the
subsequent call to matches() can be removed.

Change-Id: Iaf1404e26691384fd1d55ea630457860cc1beff5
This commit is contained in:
Darragh Bailey 2015-04-22 18:27:31 +01:00
parent 6c3cf55400
commit c29066210c

View File

@ -820,10 +820,8 @@ class Builder(object):
def delete_job(self, jobs_glob, fn=None):
if fn:
self.load_files(fn)
self.parser.expandYaml(jobs_glob)
jobs = [j['name']
for j in self.parser.jobs
if matches(j['name'], [jobs_glob])]
self.parser.expandYaml([jobs_glob])
jobs = [j['name'] for j in self.parser.jobs]
else:
jobs = [jobs_glob]
@ -858,8 +856,6 @@ class Builder(object):
raise
for job in self.parser.xml_jobs:
if jobs_glob and not matches(job.name, jobs_glob):
continue
if output:
if hasattr(output, 'write'):
# `output` is a file-like object