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

Fix bug in user defined network detection #200

Conversation

nightvisi0n
Copy link
Contributor

@nightvisi0n nightvisi0n commented Feb 11, 2019

Following up to #195
Fixes #196

Unfortunately there is no sane option to check whether a docker network is user defined, but we need that information in order to decide whether we can carry over the ip addresses.
This commit adds a try/except block that tries to set the ip addresses on the new container, and falls back to not setting them when an exception occurs.
I'm not really satisfied by classifying the exception by comparing the message to a string ('user specified IP address is supported only when connecting to networks with user configured subnets' in str(e)), but that's the only implementation that came to my mind.

Unfortunately there is no sane option to check whether a
docker network is user defined, but we need that information
in order to decide whether we can carry over the ip addresses.
This commit adds a try/except block that tries to set the ip
addresses on the new container, and falls back to not setting
them when an exception occurs.

Signed-off-by: julian <dev@jneureuther.de>
Copy link
Member

@dirtycajunrice dirtycajunrice left a comment

Choose a reason for hiding this comment

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

Im going to merge this in and make some tweaks.

@dirtycajunrice dirtycajunrice merged commit 46b371d into pyouroboros:develop Feb 12, 2019
dirtycajunrice added a commit that referenced this pull request Feb 12, 2019
@nightvisi0n nightvisi0n deleted the fix_user-defined-network-detection branch February 15, 2019 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants