#NEWLINE# def _populate_initial_zone_map( self ) : #NEWLINE# #INDENT# 'Setup the map between devices and zones based on current rules.' #NEWLINE# self . _device_zone_map = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# rules = self . iptables . get_rules_for_table ( 'raw' ) #NEWLINE# for rule in rules : #NEWLINE# #INDENT# match = re . match ( '.* --physdev-in (?P<dev>[a-zA-Z0-9\\-]+).* -j CT --zone (?P<zone>\\d+).*' , rule ) #NEWLINE# if match : #NEWLINE# #INDENT# short_port_id = match . group ( 'dev' ) [ LINUX_DEV_PREFIX_LEN : ] #NEWLINE# self . _device_zone_map [ short_port_id ] = int ( match . group ( 'zone' ) ) #NEWLINE# #UNINDENT# #UNINDENT# LOG . debug ( 'Populated conntrack zone map: %s' , self . _device_zone_map )