Currently it is not possible to specify IPv6 host address:
$ fab -H 2001:0DB8::1 taskname
[2001:0DB8::1] Executing task 'taskname'
Fatal error: Low level socket error connecting to host 2001: Invalid argument
Using square brackets http://serverfault.com/questions/205793/how-can-one-distinguish-the-difference-between-the-host-and-the-port-in-an-ipv6-u can help to separate address and port. And maybe we can make brackets optional by using more sophisticated regex patterns to distinguish IPv6 addresses from hostnames and IPv4 addresses.
What do you think?
Originally submitted by Max Arnold (LwarX) on 2011-07-11 at 01:18pm EDT
Jeff Forcier (bitprophet) posted:
I am +1 on improving IPv6 support. What I'm unsure of is whether control over that is in our hands or if it's in the Paramiko level.
If you have time, take a gander at fabric/network.py::connect() and follow that as far as needed to figure out which eg os.socket calls are used. I don't remember offhand if we (or Paramiko) are using something that precludes use of IPv6 style addresses.
Hopefully it's just something dumb we're doing that is mangling it, but I suspect it may not be that easy.
on 2011-07-11 at 01:45pm EDT
Max Arnold (LwarX) posted:
I think Paramiko itself already supports IPv6 (both hostnames and raw addresses). SSHClient.connect() method accepts separate arguments for username/host/port, so there is no additional parsing required. I did a quick test with raw v6 address and it worked out just fine.
Fabric expects host specification in form username@host:port and fails to parse IPv6 notation because of semicolon. Hostnames with AAAA records are supported just fine (I was able to connect to v6-only machine by using DNS alias in /etc/hosts). What needs to be fixed is fabric/network.py::host_pattern, and related functions for host normalization/denormalization.
on 2011-07-11 at 03:11pm EDT
I'm all ears for a better regex that is backwards compatible with how host strings behave now. Don't really have time to come up with it on my own at the moment :( especially as you're the first person to run into this specific problem so far -- it's not affecting a ton of people yet.
on 2011-07-11 at 04:37pm EDT
Finally managed to do some work on this issue. Feature branch is here: https://github.com/max-arnold/fabric/tree/385-ipv6-hosts
Great, thanks -- let's move discussion over to the pull request.
What happened with this issue? I'm in need if IPv6 support.
Looks like Github failed to auto-link the related pull request, which is #491.
@zerd If you have time to try and update Max's pull request patches so they apply to the current Fabric master branch, I can try to prioritize merging it. Thanks!
I will be able to allocate some time to update the patch in a few days.
Thanks @max-arnold ! @zerd, please follow #491 so we can keep discussion in one spot. Hopefully see you over there in a while, Max.
@zerd, could you please test the branch mentioned in #491?