wrappers: fixed locks for empty collection
it caused "Locks" checkbox to be checked, and it picked up first lock from selectbox as default. Change-Id: I13fdf104c6c32b783fb539f8947e3e071cb9788c Signed-off-by: Lukas Bednar <lbednar@redhat.com>
This commit is contained in:
parent
2d74b16620
commit
90f4dc0dfe
@ -424,17 +424,16 @@ def locks(parser, xml_parent, data):
|
|||||||
|
|
||||||
:arg: list of locks to use
|
:arg: list of locks to use
|
||||||
|
|
||||||
Example::
|
Example:
|
||||||
|
|
||||||
wrappers:
|
.. literalinclude:: /../../tests/wrappers/fixtures/locks002.yaml
|
||||||
- locks:
|
:language: yaml
|
||||||
- FOO
|
|
||||||
- FOO2
|
|
||||||
"""
|
"""
|
||||||
|
locks = data
|
||||||
|
if locks:
|
||||||
lw = XML.SubElement(xml_parent,
|
lw = XML.SubElement(xml_parent,
|
||||||
'hudson.plugins.locksandlatches.LockWrapper')
|
'hudson.plugins.locksandlatches.LockWrapper')
|
||||||
locktop = XML.SubElement(lw, 'locks')
|
locktop = XML.SubElement(lw, 'locks')
|
||||||
locks = data
|
|
||||||
for lock in locks:
|
for lock in locks:
|
||||||
lockwrapper = XML.SubElement(locktop,
|
lockwrapper = XML.SubElement(locktop,
|
||||||
'hudson.plugins.locksandlatches.'
|
'hudson.plugins.locksandlatches.'
|
||||||
|
4
tests/wrappers/fixtures/locks001.xml
Normal file
4
tests/wrappers/fixtures/locks001.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<buildWrappers/>
|
||||||
|
</project>
|
2
tests/wrappers/fixtures/locks001.yaml
Normal file
2
tests/wrappers/fixtures/locks001.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
wrappers:
|
||||||
|
- locks:
|
15
tests/wrappers/fixtures/locks002.xml
Normal file
15
tests/wrappers/fixtures/locks002.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<project>
|
||||||
|
<buildWrappers>
|
||||||
|
<hudson.plugins.locksandlatches.LockWrapper>
|
||||||
|
<locks>
|
||||||
|
<hudson.plugins.locksandlatches.LockWrapper_-LockWaitConfig>
|
||||||
|
<name>FOO</name>
|
||||||
|
</hudson.plugins.locksandlatches.LockWrapper_-LockWaitConfig>
|
||||||
|
<hudson.plugins.locksandlatches.LockWrapper_-LockWaitConfig>
|
||||||
|
<name>FOO2</name>
|
||||||
|
</hudson.plugins.locksandlatches.LockWrapper_-LockWaitConfig>
|
||||||
|
</locks>
|
||||||
|
</hudson.plugins.locksandlatches.LockWrapper>
|
||||||
|
</buildWrappers>
|
||||||
|
</project>
|
4
tests/wrappers/fixtures/locks002.yaml
Normal file
4
tests/wrappers/fixtures/locks002.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
wrappers:
|
||||||
|
- locks:
|
||||||
|
- FOO
|
||||||
|
- FOO2
|
Loading…
Reference in New Issue
Block a user