'Setup the map between devices and zones based on current rules.'

def _populate_initial_zone_map(self):

    self._device_zone_map = {}
    rules = self.get_rules_for_table_func('raw')
    for rule in rules:
        match = re.match('.*    --physdev-in    (?P<dev>[a-zA-Z0-9\\-]+).*    -j    CT    --zone    (?P<zone>\\d+).*', rule)
        if match:
            short_port_id = match.group('dev')[n_const.LINUX_DEV_PREFIX_LEN:]
            self._device_zone_map[short_port_id] = int(match.group('zone'))
    LOG.debug('Populated    conntrack    zone    map:    %s', self._device_zone_map)
