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

#143 Fixed a bug in itde_manager._remove_current_container_from_db_network #144

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@

## Changes

### Bug fixing

* #143: itde_manager.bring_itde_up() fails if the container is not connected to the network
it is assumed to be connected to.
2 changes: 1 addition & 1 deletion exasol/nb_connector/itde_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def _remove_current_container_from_db_network(conf: Secrets):
if not container:
return
network = _get_docker_network(docker_client, network_name)
if network:
if network and _is_container_connected_to_network(container, network):
network.disconnect(container.id)


Expand Down
6 changes: 6 additions & 0 deletions test/integration/test_itde_manager_in_docker_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,13 @@ def run_test():
secrets.save(AILabConfig.disk_size.value, "4")

bring_itde_up(secrets)
# Remember the network name
network_name = secrets.get(AILabConfig.itde_network)
take_itde_down(secrets)
# Restore the network name. This simulates the situation when a new AI-Lab container
# replaces an old one. It is not connected to the network, but the network name is
# nonetheless present in the secret store.
secrets.save(AILabConfig.itde_network, network_name)
bring_itde_up(secrets)
take_itde_down(secrets)

Expand Down
Loading