def __init__(self, i_wwn, t_wwn): from infi.hbaapi import Port i_port = Port() t_port = Port() i_port.port_wwn = i_wwn t_port.port_wwn = t_wwn super(FCConectivityMock, self).__init__(None, i_port, t_port)
def build_connectivity_object_from_wwn(initiator_wwn, target_wwn): from infi.hbaapi import Port from ..connectivity import FCConnectivity local_port = Port() local_port.port_wwn = initiator_wwn remote_port = Port() remote_port.port_wwn = target_wwn return FCConnectivity(None, local_port, remote_port)
def _populate_remote_port(self, fc_hba, target): properties = self._get_target_transport_properties(fc_hba, target) # http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.host.ScsiTopology.Target.html port = Port() port.port_wwn = self._translate_long_to_wwn(properties.portWorldWideName) logger.debug("Found remote port with address {}".format(port.port_wwn)) port.node_wwn = self._translate_long_to_wwn(properties.nodeWorldWideName) port.hct = (fc_hba.device, 0, target.target) return port
def build_connectivity_object_from_wwn(initiator_wwn, target_wwn): """Returns a `infi.storagemodel.connectivity.FCConnectivity` instance for the given WWNs""" from infi.hbaapi import Port from ..connectivity import FCConnectivity local_port = Port() local_port.port_wwn = initiator_wwn remote_port = Port() remote_port.port_wwn = target_wwn return FCConnectivity(None, local_port, remote_port)
def _populate_remote_port(self, fc_hba, target): properties = self._get_target_transport_properties(fc_hba, target) # http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.host.ScsiTopology.Target.html port = Port() port.port_wwn = self._translate_long_to_wwn( properties.portWorldWideName) logger.debug("Found remote port with address {}".format(port.port_wwn)) port.node_wwn = self._translate_long_to_wwn( properties.nodeWorldWideName) port.hct = (fc_hba.device, 0, target.target) return port
def _populate_port(self, fc_hba): # http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.host.HostBusAdapter.html port = Port() port.port_wwn = self._translate_long_to_wwn(fc_hba.portWorldWideName) logger.debug("Found local port with address {}".format(port.port_wwn)) port.node_wwn = self._translate_long_to_wwn(fc_hba.nodeWorldWideName) port.port_speed = int(fc_hba.speed) port.port_supported_speeds = [ port.port_speed, ] port.port_type = fc_hba.portType port.port_state = fc_hba.status port.model_description = fc_hba.model port.driver_name = fc_hba.driver port.os_device_name = fc_hba.device port.discovered_ports = self._populate_remote_ports(fc_hba) port.hct = (fc_hba.device, -1, -1) return port
def _populate_port(self, fc_hba): # http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.host.HostBusAdapter.html port = Port() port.port_wwn = self._translate_long_to_wwn(fc_hba.portWorldWideName) logger.debug("Found local port with address {}".format(port.port_wwn)) port.node_wwn = self._translate_long_to_wwn(fc_hba.nodeWorldWideName) port.port_speed = int(fc_hba.speed) port.port_supported_speeds = [port.port_speed, ] port.port_type = fc_hba.portType port.port_state = fc_hba.status port.model_description = fc_hba.model port.driver_name = fc_hba.driver port.os_device_name = fc_hba.device port.discovered_ports = self._populate_remote_ports(fc_hba) port.hct = (fc_hba.device, -1, -1) return port
"port_type": null, "port_wwn": "21:00:00:24:ff:2c:4d:f2", "serial_number": "", "statistics": { "dumped_frames": 0, "error_frames": -1, "fcp_control_requests": -1, "fcp_input_megabytes": 0, "fcp_input_requests": -1, "fcp_output_megabytes": 0, "fcp_output_requests": -1, "invalid_crc_count": 0, "invalid_tx_word_count": 0, "link_failure_count": 0, "lip_count": 0, "loss_of_signal_count": 0, "loss_of_sync_count": 0, "nos_count": 0, "primitive_seq_protocol_err_count": -1, "primitiveitive_seq_protocol_err_count": -1, "rx_frames": 0, "rx_words": -1, "seconds_since_last_reset": -1, "tx_frames": 0, "tx_words": -1 } } ] """) ports = [Port().update_not_none_values(item) for item in example]