diff --git a/jenkins_jobs/modules/helpers.py b/jenkins_jobs/modules/helpers.py index 725da2adb..964fb4696 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): mapping, fail_required=True) -def convert_mapping_to_xml(parent, data, mapping, fail_required=False): +def convert_mapping_to_xml(parent, data, mapping, fail_required=True): """Convert mapping to XML 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): valid_dict = elem[3] # Use fail_required setting to allow support for optional parameters - # we will phase this out in the future as we rework plugins so that - # optional parameters use a default setting instead. if val is None and fail_required is True: raise MissingAttributeError(optname) - # (Deprecated) in the future we will default to fail_required True # if no value is provided then continue else leave it # up to the user if they want to use an empty XML tag if val is None and fail_required is False: diff --git a/jenkins_jobs/modules/publishers.py b/jenkins_jobs/modules/publishers.py index 00645b593..0cef58e68 100644 --- a/jenkins_jobs/modules/publishers.py +++ b/jenkins_jobs/modules/publishers.py @@ -388,7 +388,8 @@ def mqtt(registry, xml_parent, data): 'EXACTLY_ONCE': '2'}), ('retain-message', 'retainMessage', False) ] - helpers.convert_mapping_to_xml(mqtt, data, mqtt_mapping) + helpers.convert_mapping_to_xml(mqtt, data, mqtt_mapping, + fail_required=False) def codecover(registry, xml_parent, data):