Skip to content

Do not add VID 0 to diffsync store #283

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/283.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed adding invalid VLAN 0 to Diffsync Store causing Sync Data job to fail.
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,8 @@ def load_vlans(self):
model_type="vlan",
)
continue
# check for untagged vlan and add if necessary
if interface_data["untagged_vlan"]:
# check for untagged vlan and add if necessary, skip VLAN 0
if interface_data["untagged_vlan"] and interface_data["untagged_vlan"]["id"] != "0":
try:
network_vlan = self.vlan(
adapter=self,
Expand Down Expand Up @@ -711,13 +711,16 @@ def load_untagged_vlan_to_interface(self):
# for interface in device_data["interfaces"]:
for interface_name, interface_data in device_data["interfaces"].items():
try:
network_untagged_vlan_to_interface = self.untagged_vlan_to_interface(
adapter=self,
device__name=hostname,
name=interface_name,
untagged_vlan=interface_data["untagged_vlan"],
)
self.add(network_untagged_vlan_to_interface)
if interface_data["untagged_vlan"]["id"] != "0":
network_untagged_vlan_to_interface = self.untagged_vlan_to_interface(
adapter=self,
device__name=hostname,
name=interface_name,
untagged_vlan=interface_data["untagged_vlan"],
)
self.add(network_untagged_vlan_to_interface)
else:
continue
except Exception as err: # pylint: disable=broad-exception-caught
self._handle_general_load_exception(
error=err,
Expand Down
Loading