Code review comment for lp://staging/~stub/charm-helpers/bug-1557769-ensure-ip-address

Revision history for this message
Cory Johns (johnsca) wrote :

From my understanding, private-address was never guaranteed to return an IP and in fact almost always returns some form of host name, meaning this function was always poorly named. I believe it depends on the provider what is actually returned.

For the big data charms (and originally for CloudFoundry), we use a similar helper[1] to force it to IPs, but that doesn't support IPv6 as yours does. We also ran into at least one instance where the "host name" returned wasn't resolvable and the IP was part of the host name string and had to be parsed out. My point is just that there a lot of corner cases in what should be a simple function.

It would be ideal if Juju handled this for us and had a private-ip field as well.

[1]: https://github.com/juju-solutions/jujubigdata/blob/master/jujubigdata/utils.py#L404

« Back to merge proposal