File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,8 @@ def _get_swport_interfaces_iosy(conf: CiscoConfParse,
132132
133133 pm_dict = {}
134134 if what == 'access' :
135- for intf in conf .find_objects_w_child ('^interface ' , '.*access' ):
135+ for intf in conf .find_objects_w_child (r'^interface ' ,
136+ r'^\s+switchport.*access' ):
136137 ifname = intf .text .split ('interface' )[1 ].strip ()
137138 acc_vlan = intf .re_match_iter_typed (r'^.*vlan\s+(\d+)' )
138139 if acc_vlan .isnumeric ():
@@ -141,7 +142,8 @@ def _get_swport_interfaces_iosy(conf: CiscoConfParse,
141142 pm_dict [ifname ] = 0
142143
143144 if what == 'trunk' :
144- for intf in conf .find_objects_w_child ('^interface' , '.*trunk' ):
145+ for intf in conf .find_objects_w_child (r'^interface' ,
146+ r'^\s+switchport.*trunk' ):
145147 ifname = intf .text .split ('interface' )[1 ].strip ()
146148 nvlan = intf .re_match_iter_typed (r'.*native vlan\s+(\d+)' ,
147149 default = '1' )
You can’t perform that action at this time.
0 commit comments