summaryrefslogtreecommitdiffstats
path: root/jenkins_jobs/modules/general.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-09-01 15:44:19 +0000
committerGerrit Code Review <review@openstack.org>2016-09-01 15:44:19 +0000
commit6853cf5ae7030fb82650a0ba5c6556e621f54313 (patch)
tree9cde64415d3b81344059312354f78915de0736f9 /jenkins_jobs/modules/general.py
parent29b82490429cc9a889b4a967a8cc8bed3558941f (diff)
parenta4cc12611afb8e3253d22dc05d9185cc4e11faaf (diff)
downloadpython-jenkins-job-builder-6853cf5ae7030fb82650a0ba5c6556e621f54313.tar.gz
python-jenkins-job-builder-6853cf5ae7030fb82650a0ba5c6556e621f54313.tar.xz
python-jenkins-job-builder-6853cf5ae7030fb82650a0ba5c6556e621f54313.zip
Merge "Fix disabled always returning true"
Diffstat (limited to 'jenkins_jobs/modules/general.py')
-rw-r--r--jenkins_jobs/modules/general.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/jenkins_jobs/modules/general.py b/jenkins_jobs/modules/general.py
index 9ba06454..c4e67de9 100644
--- a/jenkins_jobs/modules/general.py
+++ b/jenkins_jobs/modules/general.py
@@ -127,12 +127,15 @@ class General(jenkins_jobs.modules.base.Base):
description = XML.SubElement(xml, 'description')
description.text = desc_text
XML.SubElement(xml, 'keepDependencies').text = 'false'
+
+ # Need to ensure we support the None parameter to allow disabled to
+ # remain the last setting if the user purposely adds and then removes
+ # the disabled parameter.
+ # See: http://lists.openstack.org/pipermail/openstack-infra/2016-March/003980.html # noqa
disabled = data.get('disabled', None)
if disabled is not None:
- if disabled:
- XML.SubElement(xml, 'disabled').text = 'true'
- else:
- XML.SubElement(xml, 'disabled').text = 'false'
+ XML.SubElement(xml, 'disabled').text = str(disabled).lower()
+
if 'display-name' in data:
XML.SubElement(xml, 'displayName').text = data['display-name']
if data.get('block-downstream'):