summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-06-11 14:31:43 +0000
committerGerrit Code Review <review@openstack.org>2018-06-11 14:31:43 +0000
commitc07f2711b38951d2301f67252a4cb45910c03d44 (patch)
treebcb68f78806d3e42238f078b90cdca713fee2f23
parent97922e40468f46dd4a121b27d89e3a743ce2411b (diff)
parent1799211e3e106efef2a9756b3eb5ef1af078db66 (diff)
Merge "Change default on fail_required parameter to True for convert xml"
-rw-r--r--jenkins_jobs/modules/helpers.py5
-rw-r--r--jenkins_jobs/modules/publishers.py3
2 files changed, 3 insertions, 5 deletions
diff --git a/jenkins_jobs/modules/helpers.py b/jenkins_jobs/modules/helpers.py
index 725da2a..964fb46 100644
--- a/jenkins_jobs/modules/helpers.py
+++ b/jenkins_jobs/modules/helpers.py
@@ -589,7 +589,7 @@ def trigger_project(tconfigs, project_def, param_order=None):
589 mapping, fail_required=True) 589 mapping, fail_required=True)
590 590
591 591
592def convert_mapping_to_xml(parent, data, mapping, fail_required=False): 592def convert_mapping_to_xml(parent, data, mapping, fail_required=True):
593 """Convert mapping to XML 593 """Convert mapping to XML
594 594
595 fail_required affects the last parameter of the mapping field when it's 595 fail_required affects the last parameter of the mapping field when it's
@@ -624,12 +624,9 @@ def convert_mapping_to_xml(parent, data, mapping, fail_required=False):
624 valid_dict = elem[3] 624 valid_dict = elem[3]
625 625
626 # Use fail_required setting to allow support for optional parameters 626 # Use fail_required setting to allow support for optional parameters
627 # we will phase this out in the future as we rework plugins so that
628 # optional parameters use a default setting instead.
629 if val is None and fail_required is True: 627 if val is None and fail_required is True:
630 raise MissingAttributeError(optname) 628 raise MissingAttributeError(optname)
631 629
632 # (Deprecated) in the future we will default to fail_required True
633 # if no value is provided then continue else leave it 630 # if no value is provided then continue else leave it
634 # up to the user if they want to use an empty XML tag 631 # up to the user if they want to use an empty XML tag
635 if val is None and fail_required is False: 632 if val is None and fail_required is False:
diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py
index 00645b5..0cef58e 100644
--- a/jenkins_jobs/modules/publishers.py
+++ b/jenkins_jobs/modules/publishers.py
@@ -388,7 +388,8 @@ def mqtt(registry, xml_parent, data):
388 'EXACTLY_ONCE': '2'}), 388 'EXACTLY_ONCE': '2'}),
389 ('retain-message', 'retainMessage', False) 389 ('retain-message', 'retainMessage', False)
390 ] 390 ]
391 helpers.convert_mapping_to_xml(mqtt, data, mqtt_mapping) 391 helpers.convert_mapping_to_xml(mqtt, data, mqtt_mapping,
392 fail_required=False)
392 393
393 394
394def codecover(registry, xml_parent, data): 395def codecover(registry, xml_parent, data):