def slave_utilization(registry, xml_parent, data):
 utilization = XML.SubElement(xml_parent, 'com.suryagaddipati.jenkins.SlaveUtilizationProperty')
 percent = int(data.get('slave-percentage', 0))
 XML.SubElement(utilization, 'needsExclusiveAccessToNode').text = ('true' if percent else 'false')
 XML.SubElement(utilization, 'slaveUtilizationPercentage').text = str(percent)
 XML.SubElement(utilization, 'singleInstancePerSlave').text = str(data.get('single-instance-per-slave', False)).lower()

def slave_utilization ( registry , xml_parent , data ) : utilization = XML . SubElement ( xml_parent , 'com.suryagaddipati.jenkins.SlaveUtilizationProperty' ) percent = int ( data . get ( 'slave-percentage' , 0 ) ) XML . SubElement ( utilization , 'needsExclusiveAccessToNode' ) . text = ( 'true' if percent else 'false' ) XML . SubElement ( utilization , 'slaveUtilizationPercentage' ) . text = str ( percent ) XML . SubElement ( utilization , 'singleInstancePerSlave' ) . text = str ( data . get ( 'single-instance-per-slave' , False ) ) . lower ( )
yaml: slave-utilization this plugin allows you to specify the percentage of a slaves capacity a job wants to use .