Skip to content

dcnm_vrf: now raises an error if networks are attached during deletion #456

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

Conversation

neiljohn-gh
Copy link
Collaborator

@neiljohn-gh neiljohn-gh commented Jul 2, 2025

Fix for #455

When networks are attached to a vrf, deletion fails without proper information being raised.
This was because the check for networks was wrong. It was using the VRF switch attachments and not network attachments endpoint.

The check for attached networks is now being done before any updates to the vrf in case a vrf in the config has to be deleted.

Changelog:

  • added network attachment checks using a new endpoint
  • added graceful error handling
  • added a timeout in wait_for_vrf_del_ready of 100 seconds per vrf to prevent potential infinite loops
  • removed the failure condition inside the wait_for_vrf_del_ready function as the failure is now being checked earlier
  • updated Unit Tests

@allenrobel
Copy link
Collaborator

Hi Neil, let's not make any changes to dcnm_vrf.py or its associated unit tests. This file is going away once the Pydantic integration PR is merged. If this fix is for a customer, we could work together to apply it to the dcnm-vrf-pydantic-integration branch, but we'd need to coordinate so that we don't overwrite one another's changes.

Thanks,
Allen

@mikewiebe mikewiebe changed the title dcnm_vrf now raises an error if networks are attached during deletion dcnm_vrf: now raises an error if networks are attached during deletion Jul 14, 2025
@mikewiebe mikewiebe self-assigned this Jul 15, 2025
@neiljohn-gh neiljohn-gh force-pushed the dcnm_vrf_raise_attached_nets_error branch from f9fc173 to d05ede2 Compare July 15, 2025 10:37
@mikewiebe mikewiebe merged commit 28c16fe into CiscoDevNet:develop Jul 15, 2025
16 checks passed
@neiljohn-gh neiljohn-gh deleted the dcnm_vrf_raise_attached_nets_error branch July 16, 2025 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants