Conversation
Strict mode is a new feature in Juju 2.9. The mode allows more things to fail early if the mode is switched to strict. If no mode is detected then it will fallback to a more passive mode, where it will fallback to other solutions and try to carry on. The purpose of strict mode is to enable people developing with Juju/pylibjuju is highlight errors more early on and to prevent less magic in Juju. The PR for implementing strict mode is simple, EXCEPT when I turned it one, it found the first error! ModelInfo delta was wrongly implemented and wasn't gaining all the history correctly from the deltas over time. This requires[1] juju/juju#12183 to land before this PR is really useful. To enable it at bootstrap time: ```sh juju bootstrap lxd test --config mode=strict ``` 1. juju/juju#12183
Improve the name of the method that allows us to override the type name. Offically we would like to call ModelInfo - Model, but Model already exists and I don't want Model to also become a type delta. Model is both a entity for state and an entity for connections and to become an entity for deltas seems like a bit too much.
The try inside of the allwatcher was a bit to greedy and caused issues where it would mask errors from being correctly diagnosed. This might unfortunately lead to some more bug reports about missing types etc, but I believe it's the right way to correctly handle KeyErrors.
Pylibjuju really needs to better handle path detection and tbh it shouldn't be reading your home directory and everything should be passed in.
juju#451 Strict mode is a new feature in Juju 2.9. The mode allows more things to fail early if the mode is switched to strict. If no mode is detected then it will fallback to a more passive mode, where it will fallback to other solutions and try to carry on. The purpose of strict mode is to enable people developing with Juju/pylibjuju is highlight errors more early on and to prevent less magic in Juju. The PR for implementing strict mode is simple, EXCEPT when I turned it one, it found the first error! ModelInfo delta was wrongly implemented and wasn't gaining all the history correctly from the deltas over time. This requires[1] juju/juju#12183 to land before this PR is really useful. To enable it at bootstrap time: ```sh juju bootstrap lxd test --config mode=strict ``` 1. juju/juju#12183
Apparently, list_offers can return a result with a None value instead of
an empty list (or no response key), leading to an error like the
following:
```
Traceback (most recent call last):
File "/home/johnsca/juju/projects/kubernetes-jenkins/jobs/integration/conftest.py", line 233, in k8s_model
offers = [offer.offer_name for offer in (await k8s_model.list_offers()).results]
File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/model.py", line 1989, in list_offers
return await controller.list_offers(self.info.name)
File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/controller.py", line 769, in list_offers
return await facade.ListApplicationOffers(filters=[params])
File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/client/facade.py", line 480, in wrapper
reply = await f(*args, **kwargs)
File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/client/_client2.py", line 2413, in ListApplicationOffers
reply = await self.rpc(msg)
File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/client/facade.py", line 623, in rpc
result = await self.connection.rpc(msg, encoder=TypeEncoder)
File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/client/connection.py", line 484, in rpc
for res in result['response']['results']:
TypeError: 'NoneType' object is not iterable
```
juju#452 Apparently, `list_offers` can return a result with a None value instead of an empty list (or no response key), leading to an error like the following: ```python-traceback Traceback (most recent call last): File "/home/johnsca/juju/projects/kubernetes-jenkins/jobs/integration/conftest.py", line 233, in k8s_model offers = [offer.offer_name for offer in (await k8s_model.list_offers()).results] File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/model.py", line 1989, in list_offers return await controller.list_offers(self.info.name) File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/controller.py", line 769, in list_offers return await facade.ListApplicationOffers(filters=[params]) File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/client/facade.py", line 480, in wrapper reply = await f(*args, **kwargs) File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/client/_client2.py", line 2413, in ListApplicationOffers reply = await self.rpc(msg) File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/client/facade.py", line 623, in rpc result = await self.connection.rpc(msg, encoder=TypeEncoder) File "/home/johnsca/juju/projects/kubernetes-jenkins/.tox/py3/lib/python3.8/site-packages/juju/client/connection.py", line 484, in rpc for res in result['response']['results']: TypeError: 'NoneType' object is not iterable ```
The following adds an example of consuming a model from another controller that we also know about. The helps with consuming CMR and the flakey nature of pylibjuju not finding a model from the current model.
…el-example juju#453 The following adds an example of consuming a model from another controller that we also know about. The helps with consuming CMR and the flakey nature of pylibjuju not finding a model from the current model.
The following updates the facades to prevent spurious warnings about missing facades. Although it logs, because nothing has been coded to the facades we can safely add them without any consequence.
juju#454 The following updates the facades to prevent spurious warnings about missing facades. Although it logs, because nothing has been coded to the facades we can safely add them without any consequence.
Member
Author
|
|
Merged
jujubot
added a commit
that referenced
this pull request
May 26, 2021
#494 The following merges 2.9 into master. eed19e4 (upstream/2.9, origin/2.9, 2.9) Merge pull request #492 from tlm/kube-proxy-support-2 ab33f33 Merge pull request #493 from SimonRichardson/remove-machine-workaround 5c2dfa9 Merge pull request #491 from tlm/2.9.1-facades b24e750 Merge pull request #490 from tlm/kube-proxy-support-2 aaa651c Merge pull request #482 from SimonRichardson/find-parameters bde724b Merge pull request #481 from SimonRichardson/merge-master-2.9 fa1b85f Merge pull request #464 from SimonRichardson/charm-hub-url 195191b Merge pull request #463 from SimonRichardson/charm-hub-origin d6d157f Merge pull request #462 from SimonRichardson/charm-hub-find 6fab2ee Merge pull request #460 from SimonRichardson/charm-hub-info 5e61dd2 Merge pull request #459 from SimonRichardson/rename-upgrade-charm-refresh 73604c8 Merge pull request #456 from SimonRichardson/update-schema-2.9-rc3 6c0437a Merge pull request #457 from SimonRichardson/ensure-charm-store-prefix eb849e4 Merge pull request #455 from SimonRichardson/2.9 1a77394 Merge pull request #449 from achilleasa/support-new-expose-params-for-applications ad3c449 Merge pull request #448 from achilleasa/gen-2.9-beta-client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a clean merge from master to 2.9 to ensure that 2.9 is kept in sync.