~sseman/juju-ci-tools/model-change-watcher-py3-2

« back to all changes in this revision

Viewing changes to deploy_stack.py

  • Committer: Aaron Bentley
  • Date: 2014-02-21 19:46:13 UTC
  • mfrom: (233.1.20 manual-provider)
  • mto: This revision was merged to the branch mainline in revision 252.
  • Revision ID: aaron.bentley@canonical.com-20140221194613-3dai5kb0d9uwtca8
Support manual provider tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
)
14
14
 
15
15
 
16
 
def deploy_stack(environments, charm_prefix):
 
16
def deploy_stack(environments, charm_prefix, already_bootstrapped):
17
17
    """"Deploy a Wordpress stack in the specified environment.
18
18
 
19
19
    :param environment: The name of the desired environment.
23
23
        sys.path = [p for p in sys.path if 'OpenSSH' not in p]
24
24
    envs = [Environment.from_config(e) for e in environments]
25
25
    for env in envs:
26
 
        env.bootstrap()
 
26
        if not already_bootstrapped:
 
27
            env.bootstrap()
27
28
    for env in envs:
28
29
        agent_version = env.get_matching_agent_version()
29
30
        status = env.get_status()
54
55
    parser = ArgumentParser('Deploy a WordPress stack')
55
56
    parser.add_argument('--charm-prefix', help='A prefix for charm urls.',
56
57
                        default='')
 
58
    parser.add_argument('--already-bootstrapped',
 
59
                        help='The environment is already bootstrapped.',
 
60
                        action='store_true')
57
61
    parser.add_argument('env', nargs='*')
58
62
    args = parser.parse_args()
59
63
    try:
60
 
        deploy_stack(args.env, args.charm_prefix)
 
64
        deploy_stack(args.env, args.charm_prefix, args.already_bootstrapped)
61
65
    except Exception as e:
62
66
        print(e)
63
67
        sys.exit(1)