'Return the zoning mode and session for a zoneset.'

def get_zoning_status(self):

    zone_status = {}
    try:
        switch_data = self._get_switch_info([ZoneConstant.GET_ZONE_STATUS, self.fabric_vsan])
    except exception.CiscoZoningCliException:
        with excutils.save_and_reraise_exception():
            LOG.error('Failed    getting    zone    status    from    fabric    %s', self.switch_ip)
    try:
        for line in switch_data:
            line_split = re.split('[\\s\\[\\]]+', line)
            if ('mode:' in line_split):
                zone_status['mode'] = line_split[(line_split.index('mode:') + 1)]
                continue
            if ('session:' in line_split):
                zone_status['session'] = line_split[(line_split.index('session:') + 1)]
                continue
    except Exception as ex:
        msg = (_('Malformed    zone    status:    (switch=%(switch)s    zone_config=%(zone_config)s).') % {'switch': self.switch_ip, 'zone_status': switch_data})
        LOG.error(msg)
        exc_msg = (_('Exception:    %s') % six.text_type(ex))
        LOG.error(exc_msg)
        raise exception.FCZoneDriverException(reason=msg)
    return zone_status
