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:
parent
53d100458d
commit
0f45ba0351
@ -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:
|
||||
|
9
tests/general/fixtures/authtoken001.xml
Normal file
9
tests/general/fixtures/authtoken001.xml
Normal 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>
|
2
tests/general/fixtures/authtoken001.yaml
Normal file
2
tests/general/fixtures/authtoken001.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
project-type: freestyle
|
||||
auth-token:
|
10
tests/general/fixtures/authtoken002.xml
Normal file
10
tests/general/fixtures/authtoken002.xml
Normal 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>
|
2
tests/general/fixtures/authtoken002.yaml
Normal file
2
tests/general/fixtures/authtoken002.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
project-type: freestyle
|
||||
auth-token: 'testvalue'
|
10
tests/general/fixtures/authtoken003.xml
Normal file
10
tests/general/fixtures/authtoken003.xml
Normal 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>
|
2
tests/general/fixtures/authtoken003.yaml
Normal file
2
tests/general/fixtures/authtoken003.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
project-type: freestyle
|
||||
auth-token: ''
|
Loading…
Reference in New Issue
Block a user