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 = vios.get_physical_wwpns(self.adapter, self.host_uuid) return _vscsi_pfc_wwpns
def wwpns(self, adapter, host_uuid, instance): """Builds the WWPNs of the adapters that will connect the ports. :param adapter: The pypowervm API adapter. :param host_uuid: The UUID of the host for the pypowervm adapter. :param instance: The nova instance. :returns: The list of WWPNs that need to be included in the zone set. """ if self._pfc_wwpns is None: self._pfc_wwpns = vios.get_physical_wwpns(adapter, host_uuid) return self._pfc_wwpns
def test_get_physical_wwpns(self): self.adpt.read.return_value = self.vios_feed_resp expected = set(['21000024FF649104']) result = set(vios.get_physical_wwpns(self.adpt, 'fake_uuid')) self.assertSetEqual(expected, result)