Skip to content

Commit 250ef5c

Browse files
committed
Added filter to the interface_all
Filter to create role to exclude vpc_interface of vpc_peer_link mode
1 parent 11588f4 commit 250ef5c

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

plugins/action/dtc/build_resource_data.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,17 +748,34 @@ def _interface_all(self, rt):
748748
]
749749

750750
# Aggregate create list (no breakout_preprov)
751+
# vPC peer-link entries (profile.mode == 'vpc_peer_link') are pipeline
752+
# plumbing used to build the peer-link between switches — they must
753+
# not be pushed through the interface_all create path as regular
754+
# interfaces, so filter them out here.
751755
create_list = []
752756
for itype in interface_types_create:
753757
entry = self.resource_data.get(itype, {})
754758
data = entry.get('data', []) if isinstance(entry, dict) else []
759+
if itype == 'interface_vpc':
760+
data = [
761+
d for d in data
762+
if (d.get('profile') or {}).get('mode') != 'vpc_peer_link'
763+
]
755764
create_list.extend(data)
756765

757766
# Aggregate remove/overridden list (includes breakout_preprov)
767+
# vPC peer-link entries are pipeline plumbing and must not be
768+
# torn down by the remove/overridden pass — filter them out here
769+
# for the same reason we exclude them from create_list.
758770
remove_list = []
759771
for itype in interface_types_remove:
760772
entry = self.resource_data.get(itype, {})
761773
data = entry.get('data', []) if isinstance(entry, dict) else []
774+
if itype == 'interface_vpc':
775+
data = [
776+
d for d in data
777+
if (d.get('profile') or {}).get('mode') != 'vpc_peer_link'
778+
]
762779
remove_list.extend(data)
763780

764781
# Write aggregated file for diff comparison

0 commit comments

Comments
 (0)