コード例 #1
0
ファイル: test_partition.py プロジェクト: tpeponas/pypowervm
 def test_get_physical_wwpns(self):
     self.mock_vios_get.return_value = self.entries
     expected = {'21000024FF649104'}
     result = set(tpar.get_physical_wwpns(self.adpt))
     self.assertSetEqual(expected, result)
     self.mock_vios_get.assert_called_once_with(
         self.adpt, xag=[c.XAG.VIO_STOR])
     # Test caching
     self.mock_vios_get.reset_mock()
     result = set(tpar.get_physical_wwpns(self.adpt, force_refresh=False))
     self.assertSetEqual(expected, result)
     self.mock_vios_get.assert_not_called()
     # Test force_refresh
     result = set(tpar.get_physical_wwpns(self.adpt, force_refresh=True))
     self.assertSetEqual(expected, result)
     self.mock_vios_get.assert_called_once_with(
         self.adpt, xag=[c.XAG.VIO_STOR])
コード例 #2
0
ファイル: vscsi.py プロジェクト: adreznec/nova-powervm
    def wwpns(self):
        """Builds the WWPNs of the adapters that will connect the ports.

        :return: The list of WWPNs that need to be included in the zone set.
        """
        # Use a global variable so this is pulled once when the process starts.
        global _vscsi_pfc_wwpns
        if _vscsi_pfc_wwpns is None:
            _vscsi_pfc_wwpns = pvm_tpar.get_physical_wwpns(self.adapter)
        return _vscsi_pfc_wwpns
コード例 #3
0
ファイル: vscsi.py プロジェクト: openstack/nova-powervm
    def wwpns(self):
        """Builds the WWPNs of the adapters that will connect the ports.

        :return: The list of WWPNs that need to be included in the zone set.
        """
        # Use a global variable so this is pulled once when the process starts.
        global _vscsi_pfc_wwpns
        if _vscsi_pfc_wwpns is None:
            _vscsi_pfc_wwpns = pvm_tpar.get_physical_wwpns(self.adapter)
        return _vscsi_pfc_wwpns
コード例 #4
0
ファイル: fcvscsi.py プロジェクト: y00187570/nova
def wwpns(adapter):
    """Builds the WWPNs of the adapters that will connect the ports.

    :return: The list of WWPNs that need to be included in the zone set.
    """
    return pvm_tpar.get_physical_wwpns(adapter, force_refresh=False)
コード例 #5
0
ファイル: test_partition.py プロジェクト: tbreeds/pypowervm
 def test_get_physical_wwpns(self):
     self.mock_vios_get.return_value = self.entries
     expected = {'21000024FF649104'}
     result = set(tpar.get_physical_wwpns(self.adpt))
     self.assertSetEqual(expected, result)
コード例 #6
0
ファイル: fcvscsi.py プロジェクト: arbrandes/nova
def wwpns(adapter):
    """Builds the WWPNs of the adapters that will connect the ports.

    :return: The list of WWPNs that need to be included in the zone set.
    """
    return pvm_tpar.get_physical_wwpns(adapter, force_refresh=False)