-
Notifications
You must be signed in to change notification settings - Fork 102
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
Fallback to 'local-fan' #612
Conversation
If 'public' or 'local-cloud' are missing from the unit data, fallback to 'local-fan', in case of containers using solely fan networking and no provider network. Fixes juju#611
Can one of the admins verify this patch? |
6 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
This will have to wait until we have further discussion on how to proceed with dns names. |
juju/machine.py
Outdated
@@ -239,6 +239,8 @@ def dns_name(self): | |||
scope = address['scope'] | |||
if scope == 'public' or scope == 'local-cloud': |
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.
Python's logic ops like or
are short-circuiting (e.g. 1 or 1/0 or 3
will produce 1), so it might make it cleaner if you just add or scope == 'local-fan'
at the end of this line.
Checks in sequence for public, local-cloud and local-fan Returns the first match, if any, None if they don't exist
for scope in ordered_scopes: | ||
for address in addresses: | ||
if scope == address['scope']: | ||
ordered_addresses.append(address) |
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.
You could return from here.
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 for working on this. Much appreciated.
!!build!! |
@juanmanuel-tirado The problems in the CI are known intermittent problems (i.e. not related to this PR), you can go ahead and merge this 👍 |
#619 ## What's Changed * [JUJU-320] Unit public address by @SimonRichardson in #600 * [JUJU-244] Add attach-resource by @cderici in #601 * [JUJU-140] Model.wait_for_idle -- for apps with no units yet by @cderici in #575 * [JUJU-367] Improve `get_charm_series` to check the model for series for a local charm by @cderici in #607 * [JUJU-366] Utility for connecting directly to existing connection by @cderici in #605 * Use public-address key instead of public_address by @wolsen in #610 * [JUJU-376] `wait_for_idle` to support scale down by @cderici in #613 * [JUJU-378] Utility for block_until-ing with a custom coroutine by @cderici in #614 * Fallback to 'local-fan' by @dparv in #612 * Minor comments on docs for block_until related functions. by @juanmanuel-tirado in #617 * Additional checks in print status. by @juanmanuel-tirado in #622 ## New Contributors * @wolsen made their first contribution in #610 * @dparv made their first contribution in #612 [JUJU-320]: https://warthogs.atlassian.net/browse/JUJU-320?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-244]: https://warthogs.atlassian.net/browse/JUJU-244?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-140]: https://warthogs.atlassian.net/browse/JUJU-140?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-367]: https://warthogs.atlassian.net/browse/JUJU-367?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-366]: https://warthogs.atlassian.net/browse/JUJU-366?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-376]: https://warthogs.atlassian.net/browse/JUJU-376?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [JUJU-378]: https://warthogs.atlassian.net/browse/JUJU-378?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
This is specifically to include juju/python-libjuju#612, available since 2.9.6. Reviewed-on: https://code.launchpad.net/~canonical-bootstack-cre/juju-backup-all/+git/juju-backup-all/+merge/421844 Reviewed-by: Peter Sabaini <[email protected]> Reviewed-by: Ksawery Dziekoński <[email protected]>
If 'public' or 'local-cloud' are missing from the unit data, fallback to
'local-fan', in case of containers using solely fan networking and no
provider network.
Fixes #611