[Review Queue] nrpe, amulet/ubuntu-repository-cache

Adam Israel adam.israel at canonical.com
Mon Apr 20 14:16:16 UTC 2015


This MP cleans up pep8 and pylint errors, and adds additional unit
testing. Passes cleanly on local and amazon providers. +1



I found and fixed (pending peer review) a critical amuet bug that was
blocking the /ubuntu-repository-cache/ charm, where a call to
|Deployer.add_unit| could return early, indicating a machine was
available while it was still being allocated. This caused subsequent
tests against the unit to fail.

I found that |Talisman.wait_for_status| only checked for a unit to have
a |public-address| assigned to it by the cloud provider in determining
if the unit was ready. On Amazon (and possibly other cloud providers),
|public-address| was set while the unit was still initializing. I added
a check here to ensure the agent-state is |started| before returning.

In |Talisman.wait|, it would simply wait the full length of the timeout
and then attempt to run |juju_agent| against the unit, which would fail
if the timeout wasn’t sufficient time for the unit to stand up. I
modified this logic to use the timeout value as the max time it would
wait for a unit to be available, and added an arbitrary wait time
between checks of the agent-state, running |juju_agent| only if the unit
becomes available. This fixed the bug of running |juju_agent| against an
unavailable unit and decreases the wait time, since it will return in
less than the full timeout if the unit is available.

With the patches to amulet and some of the /ubuntu-repository-cache/
timeouts increased, I was able to successfully deploy a mirrored pair to


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20150420/1f3413f6/attachment.html>

More information about the Juju mailing list