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

Use openstacksdk rather than shade for resources deletion #319

Merged
merged 2 commits into from
Mar 9, 2021

Conversation

sbesson
Copy link
Member

@sbesson sbesson commented Mar 7, 2021

Fixes an issue encountered during the deletion of prod93b resources related to the detected ports. To reproduce the problem, run a dry-run deletion against an existing environment (or a freshly created one):

./scripts/os-idr-delete.py prod95 --type all

After confirm the environment to be deleted (prod95), the output of the command should list 4 ports to be deleted in the Networks section instead of one.

Debugging reveals that the issue comes from

for p in cloud.list_ports({
'device_owner': 'network:router_interface',
'network_id': n.id
which returns all ports and is ignoring the device_owner and network_id filters.
While trying to track the issue, I noticed that the final release of shade, 1.33.0, happened a year ago with the package is discontinued in favor of openstacksdk. Switching the library also fixes the network detection issue.

With this PR, the same dr=yun command as above only lists a single network:router_interface port associated with the environment subnet.

The swap IP script is also updated to use openstacksdk. The only place still dependent on shade is the openstack-idr.py script used by Ansible. I would propose to get this captured and investigated as a separate issue.

Copy link
Member

@joshmoore joshmoore left a comment

Choose a reason for hiding this comment

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

General 👍 for moving to the non-deprecated library. From my POV, it would have been fine to leave cloud, but that's more a non-issue.

@sbesson
Copy link
Member Author

sbesson commented Mar 9, 2021

Yes, I hesitated to keep the diff minimal vs updating the internal variable to match the class name of the API. I also don't feel strongly either way. It's easy enough to update and retest this PR

@joshmoore
Copy link
Member

It's easy enough to update and retest this

Don't worry about it.

@sbesson sbesson merged commit 89e511f into IDR:master Mar 9, 2021
@sbesson sbesson deleted the shade2openstacksdk branch March 11, 2021 09:15
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.

2 participants