juju/juju-gui — pull request #203 by frankban (2014-03-26 18:54:11+00:00)
Title: Sandbox mode: handle missing machine properties.

Also completed the addMachines/destroyMachines delta
stream implementation in the fake backend.

Removed the ambiguity of having a machine_id attribute
in juju-core sandbox.

QA:
- make devel/debug/prod;
- open the JS console;
- add new machines/containers with the following command:
app.env.addMachines([
// A new machine with default properties.
{},
// A new trusty LXC inside a new machine.
{containerType: 'lxc', series: 'trusty'},
// A new customized machine
{constraints:{'arch': 'i386', 'cpu-cores': 4, mem: 2000},
jobs: ['JobHostUnits', 'JobManageEnviron']}
]);
- ensure four machines were added, and they contain the expected attributes,
by running the following: `app.db.machines._items`
- now force the removal of machine 1: also the contained LXC should be
destroyed: `app.env.destroyMachines(['1'], true);` and then
`app.db.machines._items` again.
Done, thank you.