This introduces a new method on environs.Environ,
SanityCheckConstraints. This method will check
if constraints can possibly be met by the environment.
This will be used to check if an environment is
capable of creating an instance with the specified
constraints.
If the method returns nil, that does not necessarily
mean that the constraints are satisfied; if a non-nil
error is returned, then it means that the constraints
are definitely not satisfiable.
The ec2, azure and openstack Environ implementatons
will now disallow creating containers. When the work
to support addressability is done, this needs to be
changed. Currently, maas and local let everything
through.
cmd/juju is updated so that add-machine, and
deploy/add-unit --to call the new SanityCheckConstraints
method.
Affected files (+166, -25 lines):
A [revision details]
M cmd/juju/addmachine.go
M cmd/juju/addmachine_test.go
M cmd/juju/addunit_test.go
M cmd/juju/deploy_test.go
M environs/interface.go
M juju/conn.go
M provider/azure/environ.go
M provider/azure/environ_test.go
M provider/dummy/environs.go
M provider/ec2/ec2.go
M provider/ec2/local_test.go
M provider/local/environ.go
M provider/maas/environ.go
M provider/openstack/local_test.go
M provider/openstack/provider.go
Reviewers: mp+185015_ code.launchpad. net,
Message:
Please take a look.
Description: SanityCheckCons traints
all: implements Environ.
This introduces a new method on environs.Environ, traints. This method will check
SanityCheckCons
if constraints can possibly be met by the environment.
This will be used to check if an environment is
capable of creating an instance with the specified
constraints.
If the method returns nil, that does not necessarily
mean that the constraints are satisfied; if a non-nil
error is returned, then it means that the constraints
are definitely not satisfiable.
The ec2, azure and openstack Environ implementatons
will now disallow creating containers. When the work
to support addressability is done, this needs to be
changed. Currently, maas and local let everything
through.
cmd/juju is updated so that add-machine, and traints
deploy/add-unit --to call the new SanityCheckCons
method.
https:/ /code.launchpad .net/~axwalk/ juju-core/ sanity- check-constrain ts/+merge/ 185015
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/13632046/
Affected files (+166, -25 lines): addmachine. go addmachine_ test.go addunit_ test.go deploy_ test.go interface. go azure/environ. go azure/environ_ test.go dummy/environs. go ec2/local_ test.go local/environ. go maas/environ. go openstack/ local_test. go openstack/ provider. go
A [revision details]
M cmd/juju/
M cmd/juju/
M cmd/juju/
M cmd/juju/
M environs/
M juju/conn.go
M provider/
M provider/
M provider/
M provider/ec2/ec2.go
M provider/
M provider/
M provider/
M provider/
M provider/