Support fabric specific Cisco FC Zone Name

This change in Fibre Channel zone manager Cisco driver allows to use the
Fibre Channel fabric level cisco_zone_name_prefix to form the zone name.
This is consistent with the "Cisco Fibre Channel Zone Driver – OpenStack
Configuration Reference”. Zone_name_prefix will fall back to the one
speficied at fc-zone-manager level if it is not specified at the more
granular FC fabric level. The existing code takes zone_name_prefix only
from the fc-zone-manager configuration.

This patch also removes the code that marks Cisco Fibre Channel Zone driver
as unsupported and deprecated. Cisco CI has been up and running again since
Jan 24, 2018. Thus the change.

This patch also contains a minor cleanup in ssh pool.

Change-Id: If629dd30ed61829a1e4a56bc2e4401ef1adef2a5
This commit is contained in:
Liqin Dong 2018-01-25 16:27:10 -08:00
parent 4a92c2ec8e
commit 47b2c53952
2 changed files with 16 additions and 7 deletions

View File

@ -136,6 +136,8 @@ class CiscoFCSanLookupService(fc_service.FCSanLookupService):
LOG.debug("show fcns database for vsan %s", zoning_vsan)
nsinfo = self.get_nameserver_info(zoning_vsan)
self.cleanup()
LOG.debug("Lookup service:fcnsdatabase-%s", nsinfo)
LOG.debug("Lookup service:initiator list from caller-%s",
formatted_initiator_list)

View File

@ -75,9 +75,6 @@ class CiscoFCZoneDriver(fc_zone_driver.FCZoneDriver):
# ThirdPartySystems wiki name
CI_WIKI_NAME = "Cisco_ZM_CI"
# TODO(jsbryant) Remove driver in Rocky if CI is not fixed
SUPPORTED = False
def __init__(self, **kwargs):
super(CiscoFCZoneDriver, self).__init__(**kwargs)
self.configuration = kwargs.get('configuration', None)
@ -152,6 +149,11 @@ class CiscoFCZoneDriver(fc_zone_driver.FCZoneDriver):
'cisco_zoning_policy')
if zoning_policy_fab:
zoning_policy = zoning_policy_fab
zone_name_prefix = self.fabric_configs[fabric].safe_get(
'cisco_zone_name_prefix')
if not zone_name_prefix:
zone_name_prefix = self.configuration.cisco_zone_name_prefix
zoning_vsan = self.fabric_configs[fabric].safe_get('cisco_zoning_vsan')
@ -187,7 +189,7 @@ class CiscoFCZoneDriver(fc_zone_driver.FCZoneDriver):
target,
host_name,
storage_system,
self.configuration.cisco_zone_name_prefix,
zone_name_prefix,
SUPPORTED_CHARS))
if (len(cfgmap_from_fabric) == 0 or (
zone_name not in zone_names)):
@ -211,7 +213,7 @@ class CiscoFCZoneDriver(fc_zone_driver.FCZoneDriver):
target,
host_name,
storage_system,
self.configuration.cisco_zone_name_prefix,
zone_name_prefix,
SUPPORTED_CHARS))
# If zone exists, then perform an update_zone and add
@ -299,6 +301,11 @@ class CiscoFCZoneDriver(fc_zone_driver.FCZoneDriver):
zoning_policy = self.configuration.zoning_policy
zoning_policy_fab = self.fabric_configs[fabric].safe_get(
'cisco_zoning_policy')
zone_name_prefix = self.fabric_configs[fabric].safe_get(
'cisco_zone_name_prefix')
if not zone_name_prefix:
zone_name_prefix = self.configuration.cisco_zone_name_prefix
if zoning_policy_fab:
zoning_policy = zoning_policy_fab
@ -341,7 +348,7 @@ class CiscoFCZoneDriver(fc_zone_driver.FCZoneDriver):
target,
host_name,
storage_system,
self.configuration.cisco_zone_name_prefix,
zone_name_prefix,
SUPPORTED_CHARS))
LOG.debug("Zone name to del: %s", zone_name)
if (len(zone_names) > 0 and (zone_name in zone_names)):
@ -363,7 +370,7 @@ class CiscoFCZoneDriver(fc_zone_driver.FCZoneDriver):
target,
host_name,
storage_system,
self.configuration.cisco_zone_name_prefix,
zone_name_prefix,
SUPPORTED_CHARS)
# Check if there are zone members leftover after removal
if (zone_names and (zone_name in zone_names)):