Move 'delete' yaml parsing to JenkinsJobs.execute.
This is the final piece of YamlParser in jenkins_jobs.builder, so also remove the imports and make trivial fixes to test methods to prevent borked test cases. Change-Id: Ida543fa14c70447ae506092ec8afd5cb6caaa629
This commit is contained in:
@@ -133,8 +133,21 @@ class JenkinsJobs(object):
|
||||
builder = Builder(self.jjb_config)
|
||||
|
||||
if options.command == 'delete':
|
||||
for job in options.name:
|
||||
builder.delete_job(job, options.path)
|
||||
parser = YamlParser(self.jjb_config, builder.plugins_list)
|
||||
|
||||
fn = options.path
|
||||
|
||||
for jobs_glob in options.name:
|
||||
parser = YamlParser(self.jjb_config, builder.plugins_list)
|
||||
|
||||
if fn:
|
||||
parser.load_files(fn)
|
||||
parser.expandYaml([jobs_glob])
|
||||
jobs = [j['name'] for j in parser.jobs]
|
||||
else:
|
||||
jobs = [jobs_glob]
|
||||
|
||||
builder.delete_job(jobs)
|
||||
|
||||
elif options.command == 'delete-all':
|
||||
if not utils.confirm(
|
||||
|
||||
Reference in New Issue
Block a user