示例#1
0
文件: driver.py 项目: y00187570/nova
    def get_volume_connector(self, instance):
        """Get connector information for the instance for attaching to volumes.

        Connector information is a dictionary representing information about
        the system that will be making the connection.

        :param instance: nova.objects.instance.Instance
        """
        # Put the values in the connector
        connector = {}
        wwpn_list = fcvscsi.wwpns(self.adapter)

        if wwpn_list is not None:
            connector["wwpns"] = wwpn_list
        connector["multipath"] = False
        connector['host'] = CONF.host
        connector['initiator'] = None

        return connector
示例#2
0
    def get_volume_connector(self, instance):
        """Get connector information for the instance for attaching to volumes.

        Connector information is a dictionary representing information about
        the system that will be making the connection.

        :param instance: nova.objects.instance.Instance
        """
        # Put the values in the connector
        connector = {}
        wwpn_list = fcvscsi.wwpns(self.adapter)

        if wwpn_list is not None:
            connector["wwpns"] = wwpn_list
        connector["multipath"] = False
        connector['host'] = CONF.host
        connector['initiator'] = None

        return connector
示例#3
0
 def test_wwpns(self, mock_vio_wwpns):
     mock_vio_wwpns.return_value = ['aa', 'bb']
     wwpns = fcvscsi.wwpns(self.adpt)
     self.assertListEqual(['aa', 'bb'], wwpns)
     mock_vio_wwpns.assert_called_once_with(self.adpt, force_refresh=False)