def whitesource(registry, xml_parent, data):
 whitesource = XML.SubElement(xml_parent, 'org.whitesource.jenkins.WhiteSourcePublisher')
 whitesource.set('plugin', 'whitesource')
 policies = ['global', 'enable', 'disable']
 mappings = [('policies', 'jobCheckPolicies', 'global', policies), ('override-token', 'jobApiToken', ''), ('product-token', 'product', ''), ('version', 'productVersion', ''), ('project-token', 'projectToken', ''), ('requester-email', 'requesterEmail', '')]
 helpers.convert_mapping_to_xml(whitesource, data, mappings, fail_required=True)
 XML.SubElement(whitesource, 'libIncludes').text = ' '.join(data.get('includes', []))
 XML.SubElement(whitesource, 'libExcludes').text = ' '.join(data.get('excludes', []))
 XML.SubElement(whitesource, 'ignorePomModules').text = 'false'

def whitesource ( registry , xml_parent , data ) : whitesource = XML . SubElement ( xml_parent , 'org.whitesource.jenkins.WhiteSourcePublisher' ) whitesource . set ( 'plugin' , 'whitesource' ) policies = [ 'global' , 'enable' , 'disable' ] mappings = [ ( 'policies' , 'jobCheckPolicies' , 'global' , policies ) , ( 'override-token' , 'jobApiToken' , '' ) , ( 'product-token' , 'product' , '' ) , ( 'version' , 'productVersion' , '' ) , ( 'project-token' , 'projectToken' , '' ) , ( 'requester-email' , 'requesterEmail' , '' ) ] helpers . convert_mapping_to_xml ( whitesource , data , mappings , fail_required = True ) XML . SubElement ( whitesource , 'libIncludes' ) . text = ' ' . join ( data . get ( 'includes' , [ ] ) ) XML . SubElement ( whitesource , 'libExcludes' ) . text = ' ' . join ( data . get ( 'excludes' , [ ] ) ) XML . SubElement ( whitesource , 'ignorePomModules' ) . text = 'false'
yaml: whitesource this plugin brings automatic open source management to jenkins users .