~andrewjbeach/juju-ci-tools/make-local-patcher

« back to all changes in this revision

Viewing changes to bootstrap

  • Committer: Aaron Bentley
  • Date: 2016-03-01 21:23:25 UTC
  • mto: This revision was merged to the branch mainline in revision 1305.
  • Revision ID: aaron.bentley@canonical.com-20160301212325-ogp6t6l979xvbxq6
Use revision-build for parallel streams.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
from jujuconfig import get_juju_home
5
5
from jujupy import (
6
6
    bootstrap_from_env,
7
 
    client_from_config,
8
7
    EnvJujuClient,
9
8
    SimpleEnvironment,
10
9
)
21
20
                        help='Override an environment option with value.')
22
21
    parser.add_argument('--name', help='A name for the new environment.')
23
22
    args = parser.parse_args()
24
 
    client = client_from_config(args.env, None)
25
 
    env = client.env
 
23
    env = SimpleEnvironment.from_config(args.env)
26
24
    if args.name is not None:
27
 
        env.set_model_name(args.name)
 
25
        env.environment = args.name
28
26
    for option in args.option:
29
27
        key, value = option.split('=', 1)
30
28
        env.config[key] = value
31
 
    bootstrap_from_env(get_juju_home(), client)
 
29
    bootstrap_from_env(get_juju_home(), EnvJujuClient.by_version(env))
32
30
 
33
31
 
34
32
if __name__ == '__main__':