def get_scsi_adapter_type(hardware_devices):
 if (hardware_devices.__class__.__name__ == 'ArrayOfVirtualDevice'):
  hardware_devices = hardware_devices.VirtualDevice
 for device in hardware_devices:
  if (device.__class__.__name__ in scsi_controller_classes):
   if (len(device.device) < constants.SCSI_MAX_CONNECT_NUMBER):
    return scsi_controller_classes[device.__class__.__name__]
 raise exception.StorageError(reason=_('Unable to find iSCSI Target'))

def get_scsi_adapter_type ( hardware_devices ) : if ( hardware_devices . __class__ . __name__ == 'ArrayOfVirtualDevice' ) : hardware_devices = hardware_devices . VirtualDevice for device in hardware_devices : if ( device . __class__ . __name__ in scsi_controller_classes ) : if ( len ( device . device ) < constants . SCSI_MAX_CONNECT_NUMBER ) : return scsi_controller_classes [ device . __class__ . __name__ ] raise exception . StorageError ( reason = _ ( 'Unable to find iSCSI Target' ) )
selects a proper iscsi adapter type from the existing hardware devices .