Fix default result for reverse trigger

Change-Id: I033e2c121508d0ecc2adeab0f0f21d36ef63ae3c
This commit is contained in:
Bertrand Roussel 2015-11-04 14:48:03 -08:00 committed by Bertrand Roussel
parent b6b85a3c8a
commit dede4b3703
3 changed files with 19 additions and 1 deletions

View File

@ -1204,7 +1204,7 @@ def reverse(parser, xml_parent, data):
jobs
threshold = XML.SubElement(reserveBuildTrigger, 'threshold')
result = data.get('result').upper()
result = str(data.get('result', 'success')).upper()
if result not in supported_thresholds:
raise jenkins_jobs.errors.JenkinsJobsException(
"Choice should be one of the following options: %s." %

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<triggers class="vector">
<jenkins.triggers.ReverseBuildTrigger>
<spec/>
<upstreamProjects>Fantastic-job</upstreamProjects>
<threshold>
<name>SUCCESS</name>
<ordinal>0</ordinal>
<color>BLUE</color>
<completeBuild>true</completeBuild>
</threshold>
</jenkins.triggers.ReverseBuildTrigger>
</triggers>
</project>

View File

@ -0,0 +1,3 @@
triggers:
- reverse:
jobs: 'Fantastic-job'