summaryrefslogtreecommitdiffstats
path: root/jenkins_jobs/modules/general.py
diff options
context:
space:
mode:
authorDaniel Richardson <daniel.djrichar@gmail.com>2018-05-16 23:26:17 -0700
committerDaniel Richardson <daniel.djrichar@gmail.com>2018-05-16 23:29:38 -0700
commit0f45ba0351e1b088c1e5fb8cf117a43051b33fb2 (patch)
tree7ed27c640b8178ea83ab6dfca056ccb5b1d49542 /jenkins_jobs/modules/general.py
parent53d100458dd935956241ebdc6e597e5663833e72 (diff)
downloadpython-jenkins-job-builder-0f45ba0351e1b088c1e5fb8cf117a43051b33fb2.tar.gz
python-jenkins-job-builder-0f45ba0351e1b088c1e5fb8cf117a43051b33fb2.tar.xz
python-jenkins-job-builder-0f45ba0351e1b088c1e5fb8cf117a43051b33fb2.zip
bug/2002053 allow None for auth-token
auth-tokean as None type should exclude from the build job valuable for reuseing jobs that sometime need auth and othertimes don't Change-Id: I691e7dd4ff1af53efd9fac3363bce9d41038cf25
Diffstat (limited to 'jenkins_jobs/modules/general.py')
-rw-r--r--jenkins_jobs/modules/general.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/jenkins_jobs/modules/general.py b/jenkins_jobs/modules/general.py
index 0bfca537..6a893afa 100644
--- a/jenkins_jobs/modules/general.py
+++ b/jenkins_jobs/modules/general.py
@@ -155,8 +155,9 @@ class General(jenkins_jobs.modules.base.Base):
else:
XML.SubElement(xml,
'blockBuildWhenUpstreamBuilding').text = 'false'
- if 'auth-token' in data:
- XML.SubElement(xml, 'authToken').text = data['auth-token']
+ authtoken = data.get('auth-token', None)
+ if authtoken is not None:
+ XML.SubElement(xml, 'authToken').text = authtoken
if data.get('concurrent'):
XML.SubElement(xml, 'concurrentBuild').text = 'true'
else: