DescriptionHook up the lxc-broker to the provisioner.
How William and I discussed this was to have a new provisioner task at the
machine agent level for the containers.
I added a string representation for the lxc instance as I was outputting some
values in logging information, and it seemed reasonable to leave this in.
The mock lxc implementation gets smarter as I needed this to test an error
condition that I was seeing. Inside the provisioner task, when we delete a
machine, we remove it from the task's map of machines. When we then look for
the unknown instances, this is done by grabbing all the instances and removing
all those we know about. Since there may be a machine that we are stopping,
this has been removed from the provisioner task's map, so the instance is
unknown. When we try to find the instance for the stopped machines, we are
looking in the task's instance map, and we find it. Since we were adding both
the stopping list and the unknown list to the "stop these instances" method,
we were trying to stop the same instance more than once, which was causing
errors. The simplest thing was to pass the stopping list of instances through
to the unknown finding method so they can be ignored.
The dummy provider was very good at ignoring this completely, so the mock lxc
implementation has a little more smarts, and now does return error conditions
if create/start/stop/destory are called on containers with unexpected states.
The mock lxc implementation now also has some event observers. New events are
created for started and stopped machines. These are used in the tests to
monitor the starting and stopping of the containers.
I noticed that the JujuConnSuite wasn't closing the APIConn that it opened.
I refactored the suites the provisioner tests used in order to get some handy
function reuse. Especially when there was other state needed. Like the lxc
containers still need a real machine to have been created, this needs state,
and a real (or dummy) provider.
The provisioner grew a few factory methods that are used to create the
watchers and brokers for the particular supported types.
https://code.launchpad.net/~thumper/juju-core/lxc-provisioner/+merge/171034
Requires: https://code.launchpad.net/~thumper/juju-core/provisioner-auth-provider/+merge/171006
(do not edit description out of merge proposal)
Patch Set 1 #Patch Set 2 : Hook up the lxc-broker to the provisioner. #
Total comments: 4
Patch Set 3 : Hook up the lxc-broker to the provisioner. #
Total comments: 15
Patch Set 4 : Hook up the lxc-broker to the provisioner. #
MessagesTotal messages: 5
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||