Index: juju/control/bootstrap.py |
=== modified file 'juju/control/bootstrap.py' |
--- juju/control/bootstrap.py 2011-09-22 13:23:00 +0000 |
+++ juju/control/bootstrap.py 2012-03-29 01:37:57 +0000 |
@@ -1,6 +1,7 @@ |
from twisted.internet.defer import inlineCallbacks |
-from juju.control.utils import get_environment |
+from juju.control import legacy |
+from juju.control.utils import expand_constraints, get_environment |
def configure_subparser(subparsers): |
@@ -9,6 +10,11 @@ |
sub_parser.add_argument( |
"--environment", "-e", |
help="juju environment to operate in.") |
+ sub_parser.add_argument( |
+ "--constraints", |
+ help="default hardware constraints for this environment.", |
+ default=[], |
+ type=expand_constraints) |
return sub_parser |
@@ -19,6 +25,14 @@ |
""" |
environment = get_environment(options) |
provider = environment.get_machine_provider() |
+ legacy_keys = provider.get_legacy_config_keys() |
+ if legacy_keys: |
+ legacy.error(legacy_keys) |
+ |
+ constraint_set = yield provider.get_constraint_set() |
+ constraints = constraint_set.parse(options.constraints) |
+ constraints = constraints.with_series(environment.default_series) |
+ |
options.log.info("Bootstrapping environment %r (type: %s)..." % ( |
environment.name, environment.type)) |
- yield provider.bootstrap() |
+ yield provider.bootstrap(constraints) |