~hatch/charms/precise/juju-gui/trunk

« back to all changes in this revision

Viewing changes to hooks/start

  • Committer: Francesco Banconi
  • Date: 2013-03-28 16:25:06 UTC
  • mfrom: (36.1.7 juju-gui)
  • Revision ID: francesco.banconi@canonical.com-20130328162506-dgerjn52ye7433w9
Added support for juju-core.

It is now possible to deploy the charm
in a juju-core environment.
The GUI correctly  connects to the juju-core 
API server.

R=gary.poster, bac
CC=
https://codereview.appspot.com/8081043

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
)
9
9
 
10
10
from utils import (
 
11
    legacy_juju,
11
12
    log_hook,
12
13
    start_agent,
13
14
    start_gui,
25
26
def main():
26
27
    config = get_config()
27
28
    staging = config.get('staging')
28
 
    if staging:
29
 
        start_improv(config['staging-environment'], config['ssl-cert-path'])
30
 
    else:
31
 
        start_agent(config['ssl-cert-path'])
 
29
    # If juju-core is used, there is no need to start either the staging server
 
30
    # (not supported) or the API agent (already included out of the box).
 
31
    if legacy_juju():
 
32
        if staging:
 
33
            start_improv(
 
34
                config['staging-environment'], config['ssl-cert-path'])
 
35
        else:
 
36
            start_agent(config['ssl-cert-path'])
32
37
    start_gui(
33
38
        config['juju-gui-console-enabled'], config['login-help'],
34
39
        config['read-only'], staging, config['ssl-cert-path'],