-
Notifications
You must be signed in to change notification settings - Fork 4
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
Some suggestions for better IPv6 support #31
Conversation
Taking Arne's suggestion, much nicer. Co-authored-by: Arne Welzel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Dop — I hadn't gone near IPv6 at all so it's great that you found this. It's also a good reminder that IPv6 should be in the external testsuite.
We should have a few IP address tests in test_config_io.py
to cover the parsing of configs with addresses. They could work like this one, just with spelled-out IPv4/v6 addresses for instances.
It would also be good to have a test that spells out an instance's host and port, but doesn't use an IP address. I think it's currently not spelled out anywhere, but due to the underlying handling the host value needs to be an address, not a hostname. (This needn't be in this PR. It's also hopefully temporary, since eventually the framework should support hostnames and addresses throughout.)
The other day we merged #32, which means you need to rebase this one and likely tweak formatting a bit.
Let me know if you have cycles for these, otherwise I'm happy to cherry-pick your commits and take over.
Okay, we should have checking for valid IPs and tests for those now. As you mentioned, I did not implement accepting hostnames yet until the underlying code does as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great Dop, thank you. Are you up for rebasing on top of master? It's a bit fiddly due to the reformat, but otherwise not bad. Otherwise I can copy the commits from your branch and do it.
I'll be honest... I have no idea how to do that. :)
|
tests/test_config_io.py
Outdated
role = MANAGER | ||
port = 5000 | ||
""" | ||
cfp = self.parserFromString(ini_input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got renamed to parse_from_string
recently.
Here and below.
When specifying addresses in the [instances] section of a config there were two issues:
Previously there was no support for specifying an ipv6 address at all. This should allow the above to work as well as if the v6 address is inside []'s.
There's a sort in brokertypes.py that ended up trying to compare IPv4 vs IPv6 addresses causing 'ipaddress' to throw a TypeError. What I've implement here is just a basic assumption that IPv4 is less than IPv6.