Fix default result for reverse trigger
Change-Id: I033e2c121508d0ecc2adeab0f0f21d36ef63ae3c
This commit is contained in:
parent
b6b85a3c8a
commit
dede4b3703
@ -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." %
|
||||
|
15
tests/triggers/fixtures/reverse-default.xml
Normal file
15
tests/triggers/fixtures/reverse-default.xml
Normal 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>
|
3
tests/triggers/fixtures/reverse-default.yaml
Normal file
3
tests/triggers/fixtures/reverse-default.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
triggers:
|
||||
- reverse:
|
||||
jobs: 'Fantastic-job'
|
Loading…
Reference in New Issue
Block a user