'Concrete implementation of delete_connection.
Based on zoning policy and state of each I-T pair, list of zones
are created for deletion. The zones are either updated deleted based
on the policy and attach/detach state of each I-T pair.
:param fabric: Fabric name from cinder.conf file
:param initiator_target_map: Mapping of initiator to list of targets'

@lockutils.synchronized('brcd', 'fcfabric-', True)
def delete_connection(self, fabric, initiator_target_map, host_name=None, storage_system=None):

    LOG.info('BrcdFCZoneDriver    -    Delete    connection    for    fabric    %(fabric)s    for    I-T    map:    %(i_t_map)s', {'fabric': fabric, 'i_t_map': initiator_target_map})
    zoning_policy = self.configuration.zoning_policy
    zoning_policy_fab = self.fabric_configs[fabric].safe_get('zoning_policy')
    zone_name_prefix = self.fabric_configs[fabric].safe_get('zone_name_prefix')
    zone_activate = self.fabric_configs[fabric].safe_get('zone_activate')
    if zoning_policy_fab:
        zoning_policy = zoning_policy_fab
    LOG.info('Zoning    policy    for    fabric    %(policy)s', {'policy': zoning_policy})
    conn = self._get_southbound_client(fabric)
    cfgmap_from_fabric = self._get_active_zone_set(conn)
    zone_names = []
    if cfgmap_from_fabric.get('zones'):
        zone_names = cfgmap_from_fabric['zones'].keys()
    LOG.debug('zone    config    from    Fabric:    %(cfgmap)s', {'cfgmap': cfgmap_from_fabric})
    for initiator_key in initiator_target_map.keys():
        initiator = initiator_key.lower()
        formatted_initiator = utils.get_formatted_wwn(initiator)
        zone_map = {}
        zones_to_delete = []
        t_list = initiator_target_map[initiator_key]
        if (zoning_policy == 'initiator-target'):
            for t in t_list:
                target = t.lower()
                zone_name = driver_utils.get_friendly_zone_name(zoning_policy, initiator, target, host_name, storage_system, zone_name_prefix, SUPPORTED_CHARS)
                LOG.debug('Zone    name    to    delete:    %(zonename)s', {'zonename': zone_name})
                if ((len(zone_names) > 0) and (zone_name in zone_names)):
                    LOG.debug('Added    zone    to    delete    to    list:    %(zonename)s', {'zonename': zone_name})
                    zones_to_delete.append(zone_name)
        elif (zoning_policy == 'initiator'):
            zone_members = [formatted_initiator]
            for t in t_list:
                target = t.lower()
                zone_members.append(utils.get_formatted_wwn(target))
            zone_name = driver_utils.get_friendly_zone_name(zoning_policy, initiator, target, host_name, storage_system, zone_name_prefix, SUPPORTED_CHARS)
            if (zone_names and (zone_name in zone_names)):
                filtered_members = filter((lambda x: (x not in zone_members)), cfgmap_from_fabric['zones'][zone_name])
                if filtered_members:
                    zone_members.remove(formatted_initiator)
                    zm_list = cfgmap_from_fabric['zones'][zone_name]
                    for t in t_list:
                        formatted_target = utils.get_formatted_wwn(t)
                        if (formatted_target not in zm_list):
                            zone_members.remove(formatted_target)
                    if zone_members:
                        LOG.debug('Zone    members    to    remove:    %(members)s', {'members': zone_members})
                        zone_map[zone_name] = zone_members
                else:
                    zones_to_delete.append(zone_name)
        else:
            LOG.warning('Zoning    policy    not    recognized:    %(policy)s', {'policy': zoning_policy})
        LOG.debug('Zone    map    to    update:    %(zonemap)s', {'zonemap': zone_map})
        LOG.debug('Zone    list    to    delete:    %(zones)s', {'zones': zones_to_delete})
        try:
            if zone_map:
                conn.update_zones(zone_map, zone_activate, fc_zone_constants.ZONE_REMOVE, cfgmap_from_fabric)
            if zones_to_delete:
                zone_name_string = ''
                num_zones = len(zones_to_delete)
                for i in range(0, num_zones):
                    if (i == 0):
                        zone_name_string = ('%s%s' % (zone_name_string, zones_to_delete[i]))
                    else:
                        zone_name_string = ('%s;%s' % (zone_name_string, zones_to_delete[i]))
                conn.delete_zones(zone_name_string, zone_activate, cfgmap_from_fabric)
        except (exception.BrocadeZoningCliException, exception.BrocadeZoningHttpException) as brocade_ex:
            raise exception.FCZoneDriverException(brocade_ex)
        except Exception:
            msg = _('Failed    to    update    or    delete    zoning    configuration.')
            LOG.exception(msg)
            raise exception.FCZoneDriverException(msg)
        finally:
            conn.cleanup()
