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
This commit is contained in:
Daniel Richardson 2018-05-16 23:26:17 -07:00
parent 53d100458d
commit 0f45ba0351
7 changed files with 38 additions and 2 deletions

View File

@ -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:

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<actions/>
<keepDependencies>false</keepDependencies>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<concurrentBuild>false</concurrentBuild>
<canRoam>true</canRoam>
</project>

View File

@ -0,0 +1,2 @@
project-type: freestyle
auth-token:

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<actions/>
<keepDependencies>false</keepDependencies>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<authToken>testvalue</authToken>
<concurrentBuild>false</concurrentBuild>
<canRoam>true</canRoam>
</project>

View File

@ -0,0 +1,2 @@
project-type: freestyle
auth-token: 'testvalue'

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<actions/>
<keepDependencies>false</keepDependencies>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<authToken/>
<concurrentBuild>false</concurrentBuild>
<canRoam>true</canRoam>
</project>

View File

@ -0,0 +1,2 @@
project-type: freestyle
auth-token: ''