summaryrefslogtreecommitdiffstats
path: root/jenkins_jobs/config.py
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-01-12 14:56:05 +0000
committerGerrit Code Review <review@openstack.org>2018-01-12 14:56:05 +0000
commit1854fde4d98111e89932533267d1298fede179f3 (patch)
tree29312b1885a03f6817761d7da9323d2e898363f4 /jenkins_jobs/config.py
parent0b5ed0345a1aaba5c6502fedd6259932c78d750d (diff)
parent630fc6e88a77c0eab1bc8dd9d4f0c9df3a58508d (diff)
downloadpython-jenkins-job-builder-1854fde4d98111e89932533267d1298fede179f3.tar.gz
python-jenkins-job-builder-1854fde4d98111e89932533267d1298fede179f3.tar.xz
python-jenkins-job-builder-1854fde4d98111e89932533267d1298fede179f3.zip
Merge "No warn on old plugin conf format not in use"
Diffstat (limited to 'jenkins_jobs/config.py')
-rw-r--r--jenkins_jobs/config.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/jenkins_jobs/config.py b/jenkins_jobs/config.py
index 2fc4a78d..136dc78d 100644
--- a/jenkins_jobs/config.py
+++ b/jenkins_jobs/config.py
@@ -51,6 +51,7 @@ query_plugins_info=False
CONFIG_REQUIRED_MESSAGE = ("A valid configuration file is required. "
"No configuration file passed.")
+_NOTSET = object()
class JJBConfig(object):
@@ -354,10 +355,13 @@ class JJBConfig(object):
# plugin configuration format in their config. This code should be
# removed in future versions of JJB after 2.0.
if value is default:
- value = self.get_module_config(plugin, key, default)
- logger.warning(
- "Defining plugin configuration using [" + plugin + "] is"
- " deprecated. The recommended way to define plugins now is by"
- " configuring [plugin \"" + plugin + "\"]")
+ 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(
+ "Defining plugin configuration using [" + plugin + "] is "
+ "deprecated. The recommended way to define plugins now is "
+ "by configuring [plugin \"" + plugin + "\"]")
return value