summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-08-31 13:00:55 (GMT)
committerGerrit Code Review <review@openstack.org>2016-08-31 13:00:55 (GMT)
commit0b8c110fb47eedfc60fbd28d7bff0ea6fa11f054 (patch)
tree269cb8c64159d6611d7dd76caca6ebdd953995f7
parent17bd56dda9ed9174325f4265a3d813ea39631472 (diff)
parent2236a00c5355800f6abf2a53c4d76e865162aecd (diff)
downloadjenkins-job-builder-0b8c110fb47eedfc60fbd28d7bff0ea6fa11f054.tar.gz
jenkins-job-builder-0b8c110fb47eedfc60fbd28d7bff0ea6fa11f054.tar.xz
Merge "Rename Builder.delete_job to Builder.delete_jobs."
-rw-r--r--jenkins_jobs/builder.py4
-rw-r--r--jenkins_jobs/cli/subcommand/delete.py2
-rw-r--r--tests/cmd/subcommands/test_delete.py4
3 files changed, 5 insertions, 5 deletions
diff --git a/jenkins_jobs/builder.py b/jenkins_jobs/builder.py
index 934324c..a0cf574 100644
--- a/jenkins_jobs/builder.py
+++ b/jenkins_jobs/builder.py
@@ -252,7 +252,7 @@ class Builder(object):
if self.jenkins.is_managed(job['name']):
logger.info("Removing obsolete jenkins job {0}"
.format(job['name']))
- self.delete_job([job['name']])
+ self.jenkins.delete_job(job['name'])
deleted_jobs += 1
else:
logger.info("Not deleting unmanaged jenkins job %s",
@@ -261,7 +261,7 @@ class Builder(object):
logger.debug("Keeping job %s", job['name'])
return deleted_jobs
- def delete_job(self, jobs):
+ def delete_jobs(self, jobs):
if jobs is not None:
logger.info("Removing jenkins job(s): %s" % ", ".join(jobs))
for job in jobs:
diff --git a/jenkins_jobs/cli/subcommand/delete.py b/jenkins_jobs/cli/subcommand/delete.py
index a236c05..32f0820 100644
--- a/jenkins_jobs/cli/subcommand/delete.py
+++ b/jenkins_jobs/cli/subcommand/delete.py
@@ -53,4 +53,4 @@ class DeleteSubCommand(base.BaseSubCommand):
else:
jobs = [jobs_glob]
- builder.delete_job(jobs)
+ builder.delete_jobs(jobs)
diff --git a/tests/cmd/subcommands/test_delete.py b/tests/cmd/subcommands/test_delete.py
index 3dfd641..82d3265 100644
--- a/tests/cmd/subcommands/test_delete.py
+++ b/tests/cmd/subcommands/test_delete.py
@@ -27,7 +27,7 @@ from tests.cmd.test_cmd import CmdTestsBase
@mock.patch('jenkins_jobs.builder.Jenkins.get_plugins_info', mock.MagicMock)
class DeleteTests(CmdTestsBase):
- @mock.patch('jenkins_jobs.cli.subcommand.delete.Builder.delete_job')
+ @mock.patch('jenkins_jobs.cli.subcommand.delete.Builder.delete_jobs')
def test_delete_single_job(self, delete_job_mock):
"""
Test handling the deletion of a single Jenkins job.
@@ -36,7 +36,7 @@ class DeleteTests(CmdTestsBase):
args = ['--conf', self.default_config_file, 'delete', 'test_job']
self.execute_jenkins_jobs_with_args(args)
- @mock.patch('jenkins_jobs.cli.subcommand.delete.Builder.delete_job')
+ @mock.patch('jenkins_jobs.cli.subcommand.delete.Builder.delete_jobs')
def test_delete_multiple_jobs(self, delete_job_mock):
"""
Test handling the deletion of multiple Jenkins jobs.