Skip to content
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

refactor network operations in NetworkMonitorPlugin #105

Merged
merged 3 commits into from
Dec 21, 2023

Conversation

AnishReddyRavula
Copy link

@AnishReddyRavula AnishReddyRavula commented Dec 19, 2023

refactors the network operations in the NetworkMonitorPlugin class The changes include the introduction of a new method, remove_subnet_route_from_router, to handle the removal of subnet routes from a router

without removing the route, the network cleanup is raising the Exception

ConflictException: 409: Client Error for url: , Router interface for subnet on router cannot be deleted, as it is required by one or more routes.

Tested in UC dev by

  • Creating a network lease
  • Creating a router
  • Attaching the network subnet interface to the router
  • Adding a route in the router to the subnet
  • Changing the network reservation status to 'error' to trigger the network monitor
  • cleaned up the network without the said error

Change-Id: I7e35002ff2e471fe47601e9daea8cf77fe1a01df

refactors the network operations in the `NetworkMonitorPlugin` class
The changes include the introduction of a new method, `remove_subnet_route_from_router`, to handle the removal of subnet routes from a router

without removing the route, the network cleanup is raising the Exception

ConflictException: 409: Client Error for url: <url>, Router interface for subnet on router cannot be deleted, as it is required by one or more routes.

Change-Id: I7e35002ff2e471fe47601e9daea8cf77fe1a01df
@AnishReddyRavula AnishReddyRavula self-assigned this Dec 19, 2023
@AnishReddyRavula AnishReddyRavula marked this pull request as ready for review December 19, 2023 15:16
Added extra test cases remove_subnet_route_from_router method to make sure it works

Tested in UC dev

Change-Id: I140b8d1897e941e088cfebc9433b8cc317bd7cb1
Copy link

@Mark-Powers Mark-Powers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Glad to hear that this was working well on dev.

return next_hop_ip in subnet_cidr
try:
subnet = neutron_client.show_subnet(subnet_id).get('subnet', {})
except neutron_ex.NotFound as e:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I am forgetting something, but is there a point to these try/except blocks if the exception is just reraised? Should there at least be a log statement here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I removed them for some reason, The logs should be there

Change-Id: I07cce45e92c8a08522994e6675ba5eeed184c37e
@AnishReddyRavula AnishReddyRavula merged commit b6c92ac into chameleoncloud/xena Dec 21, 2023
1 check passed
@AnishReddyRavula AnishReddyRavula deleted the network_cleanup-fixes branch December 21, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants