def disable_failed_job(registry, xml_parent, data):
 xml_element = XML.SubElement(xml_parent, 'disableFailedJob.disableFailedJob.DisableFailedJob', {'plugin': 'disable-failed-job'})
 valid_conditions = ['Only Failure', 'Failure and Unstable', 'Only Unstable']
 mapping = [('when-to-disable', 'whenDisable', None, valid_conditions)]
 helpers.convert_mapping_to_xml(xml_element, data, mapping, fail_required=True)
 if ('no-of-failures' in data):
  XML.SubElement(xml_element, 'failureTimes').text = str(data.get('no-of-failures'))
  XML.SubElement(xml_element, 'optionalBrockChecked').text = 'true'
 else:
  XML.SubElement(xml_element, 'optionalBrockChecked').text = 'false'

def disable_failed_job ( registry , xml_parent , data ) : xml_element = XML . SubElement ( xml_parent , 'disableFailedJob.disableFailedJob.DisableFailedJob' , { 'plugin' : 'disable-failed-job' } ) valid_conditions = [ 'Only Failure' , 'Failure and Unstable' , 'Only Unstable' ] mapping = [ ( 'when-to-disable' , 'whenDisable' , None , valid_conditions ) ] helpers . convert_mapping_to_xml ( xml_element , data , mapping , fail_required = True ) if ( 'no-of-failures' in data ) : XML . SubElement ( xml_element , 'failureTimes' ) . text = str ( data . get ( 'no-of-failures' ) ) XML . SubElement ( xml_element , 'optionalBrockChecked' ) . text = 'true' else : XML . SubElement ( xml_element , 'optionalBrockChecked' ) . text = 'false'
yaml: disable-failed-job automatically disable failed jobs .