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

[Bug] Exception during exception in docker addons for volume removal #1263

Closed
frankcorneliusmartin opened this issue May 15, 2024 · 0 comments · Fixed by #1264
Closed

[Bug] Exception during exception in docker addons for volume removal #1263

frankcorneliusmartin opened this issue May 15, 2024 · 0 comments · Fixed by #1264
Labels
bug Something isn't working
Milestone

Comments

@frankcorneliusmartin
Copy link
Contributor

Describe the bug

I got the following exception when stopping the v6 demo network:

  File "/Users/frankmartin/Repositories/vantage6/vantage6-common/vantage6/common/docker/addons.py", line 304, in delete_volume_if_exists
    log.warning("Could not delete volume %s", volume.name)
UnboundLocalError: local variable 'volume' referenced before assignment

Then I found that there is a bug in the docker add on:

try:
volume = client.volumes.get(volume_name)
if volume:
volume.remove()
except (docker.errors.NotFound, docker.errors.APIError):
log.warning("Could not delete volume %s", volume.name)

Expected behavior
Make the exception handling independent of the retrieval of the volume name by using volume_name instead of volume.name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants