deis/deis — pull request #2672 by mboersma (2014-12-05 23:01:34+00:00)
Title: fix(controller): update App.structure field correctly after scaling

While the scaling logic is correct, we were naively using the requested scaling values to update the App.structure JSON field, rather than the actual containers in existence after scaling. This was cosmetic only, but is fixed by a SQL aggregate query and python dict comprehension. Includes regression unit tests.

The issue was that the last scale operation "wins", at least in terms of the structure field:
```console
$ deis scale web=2
$ deis info
=== kingly-playroom Application
{
"updated": "2014-12-05T21:58:54UTC",
"uuid": "c08e226e-2f83-4f80-91b3-7c33d850f3a4",
"created": "2014-12-05T21:01:06UTC",
"url": "kingly-playroom.deis.rocks",
"owner": "matt",
"id": "kingly-playroom",
"structure": {
"web": 2
}
}

=== kingly-playroom Processes

--- test:
test.1 up (v7)
test.2 up (v7)
test.3 up (v7)
test.4 up (v7)

--- web:
web.1 up (v7)
web.2 up (v7)

=== kingly-playroom Domains
No domains
```