juju/juju-gui — pull request #314 by makyo (2014-05-12 19:14:15+00:00)
Title: Unit placement

QA in sandbox:

- disable the simulator;
- drag/deploy a service;
- get a reference to the new service unit:
`var unit = app.db.units.item(0)`;
- add a new machine to the db:
`var machine = app.db.machines.add({id: 'new1'})`;
- add the new machine to the ECS
attaching a callback that will remove the ghost machine:
`app.env.addMachines([{}], function() {app.db.machines.remove(machine)}, {modelId: 'new1'})`;
- add a new container to the machine:
`var container = app.db.machines.add({id: 'new1/lxc/0'})`
- add the new container to the ECS
attaching a callback that will remove the ghost machine:
`app.env.addMachines([{parentId: 'new1', containerType: 'lxc'}], function() {app.db.machines.remove(container)}, {modelId: 'new1/lxc/0'})`
- place the unit in the container:
`app.env.placeUnit(unit, 'new1/lxc/0')`
- click deploy and confirm (status bar);
- everything should work.

Perform QA in real env, also make sure placing units on root-level machines works