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:
Lukas Bednar 2014-07-15 17:01:10 +02:00
parent 2d74b16620
commit 90f4dc0dfe
5 changed files with 37 additions and 13 deletions

View File

@ -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.'

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<buildWrappers/>
</project>

View File

@ -0,0 +1,2 @@
wrappers:
- locks:

View 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>

View File

@ -0,0 +1,4 @@
wrappers:
- locks:
- FOO
- FOO2