~dave-cheney/juju-core/122-fix-lp-1301706

Viewing all changes in revision 2552.

[r=axwalk] Add EnvironCapability to state.Policy

environs.EnvironCapability is moved to the
state package, extended with the
SupportsUnitPlacement method, and added to
the state.Policy interface.

Methods for creating machines and assigning
units to them are now modified to use the
SupportsUnitPlacement method to enable
policy implementations to block adding of
empty machines (juju add-machine) and to
block unit placement (deploy/add-unit --to).

Also, a new EnvironBase type is added to
provider/common, which implements some
default behaviour common to all providers
such as the new SupportsUnitPlacement
method.

A followup will override the default
behaviour of SupportsUnitPlacement in the
Azure provider, blocking placement if in
availability-sets-enabled mode.

https://codereview.appspot.com/77820044/

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: