summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--jenkins_jobs/config.py17
-rw-r--r--tests/cmd/fixtures/plugin_warning.ini3
-rw-r--r--tests/cmd/test_config.py27
-rw-r--r--tests/publishers/fixtures/stash002.conf2
4 files changed, 3 insertions, 46 deletions
diff --git a/jenkins_jobs/config.py b/jenkins_jobs/config.py
index 9a650101..6f146c19 100644
--- a/jenkins_jobs/config.py
+++ b/jenkins_jobs/config.py
@@ -360,18 +360,5 @@ class JJBConfig(object):
return result
def get_plugin_config(self, plugin, key, default=None):
- value = self.get_module_config('plugin "{}"'.format(plugin), key,
- default)
-
- # Backwards compatibility for users who have not switched to the new
- # plugin configuration format in their config. This code should be
- # removed in future versions of JJB after 2.0.
- if value is default:
- old_value = self.get_module_config(plugin, key, _NOTSET)
- # only log warning if detected a plugin config setting.
- if old_value is not _NOTSET:
- value = old_value
- logger.warning(
- DEPRECATED_PLUGIN_CONFIG_SECTION_MESSAGE.format(
- plugin=plugin))
- return value
+ return self.get_module_config('plugin "{}"'.format(plugin), key,
+ default)
diff --git a/tests/cmd/fixtures/plugin_warning.ini b/tests/cmd/fixtures/plugin_warning.ini
index 58ae8909..87f9cfda 100644
--- a/tests/cmd/fixtures/plugin_warning.ini
+++ b/tests/cmd/fixtures/plugin_warning.ini
@@ -1,5 +1,2 @@
-[old_plugin]
-setting = some value
-
[plugin "new_plugin"]
setting = some value
diff --git a/tests/cmd/test_config.py b/tests/cmd/test_config.py
index 8b2eee7d..6cbb6d4d 100644
--- a/tests/cmd/test_config.py
+++ b/tests/cmd/test_config.py
@@ -77,33 +77,6 @@ class TestConfigs(CmdTestsBase):
jenkins_jobs = entry.JenkinsJobs(args)
self.assertRaises(IOError, jenkins_jobs.execute)
- def test_config_old_plugin_format_warning(self):
- """
- Run test mode and check that old plugin settings result
- in a warning, while ensuring that missing sections do not
- trigger the same warning if a default value is provided.
- """
- args = ['--conf',
- os.path.join(self.fixtures_path, 'plugin_warning.ini'),
- 'test', 'foo']
- jenkins_jobs = entry.JenkinsJobs(args)
- jenkins_jobs.jjb_config.get_plugin_config(
- 'old_plugin', 'setting', True)
- jenkins_jobs.jjb_config.get_plugin_config(
- 'old_plugin_no_conf', 'setting', True)
- jenkins_jobs.jjb_config.get_plugin_config(
- 'new_plugin', 'setting')
- self.assertIn(
- 'using a [old_plugin] section in your config file is deprecated',
- self.logger.output)
- self.assertNotIn(
- 'using a [old_plugin_no_conf] secton in your config file is '
- 'deprecated',
- self.logger.output)
- self.assertNotIn(
- 'using a [new_plugin] section in your config file is deprecated',
- self.logger.output)
-
def test_config_options_not_replaced_by_cli_defaults(self):
"""
Run test mode and check config settings from conf file retained
diff --git a/tests/publishers/fixtures/stash002.conf b/tests/publishers/fixtures/stash002.conf
index 8df10973..cccdcf25 100644
--- a/tests/publishers/fixtures/stash002.conf
+++ b/tests/publishers/fixtures/stash002.conf
@@ -1,3 +1,3 @@
-[stash]
+[plugin "stash"]
username=user
password=pass