remove support of old plugin config format
Remove code refering to old plugin config format. Change-Id: Iba0922d3bfe066444e5e982c303968d15e1853a1
This commit is contained in:
parent
1e24fceea1
commit
71f1c89b65
@ -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)
|
||||
|
@ -1,5 +1,2 @@
|
||||
[old_plugin]
|
||||
setting = some value
|
||||
|
||||
[plugin "new_plugin"]
|
||||
setting = some value
|
||||
|
@ -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
|
||||
|
@ -1,3 +1,3 @@
|
||||
[stash]
|
||||
[plugin "stash"]
|
||||
username=user
|
||||
password=pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user