Merge lp:~stub/charm-helpers/bug-1557769-ensure-ip-address into lp:charm-helpers
Proposed by
Stuart Bishop
Status: | Needs review | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~stub/charm-helpers/bug-1557769-ensure-ip-address | ||||
Merge into: | lp:charm-helpers | ||||
Diff against target: |
131 lines (+56/-9) 3 files modified
Makefile (+2/-2) charmhelpers/core/hookenv.py (+19/-2) tests/core/test_hookenv.py (+35/-5) |
||||
To merge this branch: | bzr merge lp:~stub/charm-helpers/bug-1557769-ensure-ip-address | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
charmers | Pending | ||
Review via email: mp+289128@code.launchpad.net |
Description of the change
Juju 1.25.4 seems to be again returning names in some situations where we expect IP addresses. Fix this, even though it might be considered a Juju regression.
To post a comment you must log in.
Unmerged revisions
- 550. By Stuart Bishop
-
Ensure IP addresses are returned by methods claiming to return IP addresses
- 549. By Stuart Bishop
-
Missing dependencies
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