Improved Primitive support and better testing
This changeset addresses several issues.
- Improve primitive support so the status and output of an executed
primitive can be retrieved
- Merge latest upstream libjuju (required for new primive features)
- New testing framework
This is the start of a new testing framework with the ability to
create and configure LXD containers with SSH, to use while testing proxy
charms.
- Add support for using ssh keys with proxy charms
See Feature 1429. This uses the per-proxy charm/unit ssh keypair
Signed-off-by: Adam Israel <adam.israel@canonical.com>
diff --git a/modules/libjuju/juju/machine.py b/modules/libjuju/juju/machine.py
index bd3d030..a46135c 100644
--- a/modules/libjuju/juju/machine.py
+++ b/modules/libjuju/juju/machine.py
@@ -14,7 +14,18 @@
class Machine(model.ModelEntity):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
- self.on_change(self._workaround_1695335)
+ self.model.loop.create_task(self._queue_workarounds())
+
+ async def _queue_workarounds(self):
+ model = self.model
+ if not model.info:
+ await utils.run_with_interrupt(model.get_info(),
+ model._watch_stopping,
+ model.loop)
+ if model._watch_stopping.is_set():
+ return
+ if model.info.agent_version < client.Number.from_json('2.2.3'):
+ self.on_change(self._workaround_1695335)
async def _workaround_1695335(self, delta, old, new, model):
"""