def _get_bus_number_for_scsi_controller(devices):
 taken = [dev.busNumber for dev in devices if _is_scsi_controller(dev)]
 for i in range(constants.SCSI_MAX_CONTROLLER_NUMBER):
  if (i not in taken):
   return i
 msg = (_('Only %d SCSI controllers are allowed to be created on this instance.') % constants.SCSI_MAX_CONTROLLER_NUMBER)
 raise vexc.VMwareDriverException(msg)

def _get_bus_number_for_scsi_controller ( devices ) : taken = [ dev . busNumber for dev in devices if _is_scsi_controller ( dev ) ] for i in range ( constants . SCSI_MAX_CONTROLLER_NUMBER ) : if ( i not in taken ) : return i msg = ( _ ( 'Only %d SCSI controllers are allowed to be created on this instance.' ) % constants . SCSI_MAX_CONTROLLER_NUMBER ) raise vexc . VMwareDriverException ( msg )
return usable bus number when create new scsi controller .