Skip to content
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

Merged
merged 5 commits into from
Jan 14, 2022
Merged

Fallback to 'local-fan' #612

merged 5 commits into from
Jan 14, 2022

Conversation

dparv
Copy link

@dparv dparv commented Jan 4, 2022

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

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
@jujubot
Copy link
Contributor

jujubot commented Jan 4, 2022

Can one of the admins verify this patch?

6 similar comments
@jujubot
Copy link
Contributor

jujubot commented Jan 4, 2022

Can one of the admins verify this patch?

@jujubot
Copy link
Contributor

jujubot commented Jan 4, 2022

Can one of the admins verify this patch?

@jujubot
Copy link
Contributor

jujubot commented Jan 4, 2022

Can one of the admins verify this patch?

@jujubot
Copy link
Contributor

jujubot commented Jan 4, 2022

Can one of the admins verify this patch?

@jujubot
Copy link
Contributor

jujubot commented Jan 4, 2022

Can one of the admins verify this patch?

@jujubot
Copy link
Contributor

jujubot commented Jan 4, 2022

Can one of the admins verify this patch?

@juanmanuel-tirado
Copy link
Contributor

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':
Copy link
Contributor

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.

juju/machine.py Outdated Show resolved Hide resolved
Checks in sequence for public, local-cloud and local-fan
Returns the first match, if any, None if they don't exist
juju/machine.py Show resolved Hide resolved
for scope in ordered_scopes:
for address in addresses:
if scope == address['scope']:
ordered_addresses.append(address)
Copy link
Member

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.

Copy link
Member

@manadart manadart left a 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.

@cderici
Copy link
Contributor

cderici commented Jan 14, 2022

!!build!!

@cderici
Copy link
Contributor

cderici commented Jan 14, 2022

@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 👍

@juanmanuel-tirado juanmanuel-tirado merged commit f3ba58f into juju:master Jan 14, 2022
jujubot added a commit that referenced this pull request Jan 31, 2022
#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
zxhdaze pushed a commit to canonical/juju-backup-all that referenced this pull request Apr 25, 2024
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 <peter.sabaini@canonical.com>
Reviewed-by: Ksawery Dziekoński <xav.dziekonski@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants