~frankban/charms/precise/juju-gui/local-releases

« back to all changes in this revision

Viewing changes to hooks/config-changed

The GUI no longer run from the charm directory.

Updated the GUI and (under pyJuju) the API agent
so that now the files are served from /var/lib/juju-gui.

That directory is also removed when the service is
destroyed. To do that, this branch introduces
the Backend.destroy method, called in the stop
hook.

QA: deploy the charm using this branch, 
check everything is ok, check that the GUI files
are stored in /var/lib/juju-gui.
Then destroy the juju-gui service and ensure
that directory is cleaned up.

R=benjamin.saller
CC=
https://codereview.appspot.com/13309044

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    config = get_config()
37
37
    prev_config = config_json.get()
38
38
    diff = DictDiffer(config, prev_config)
39
 
 
40
39
    if not diff.modified:
41
40
        log("No configuration changes, exiting.")
42
41
        sys.exit(0)
43
42
 
44
43
    log('Updating configuration.')
45
44
    backend = Backend(config, prev_config)
46
 
 
47
 
    backend.install()
48
45
    if prev_config:
49
46
        # Stop whatever the old config was.
50
47
        prev_backend = Backend(prev_config)
51
48
        prev_backend.stop()
 
49
    backend.install()
52
50
    backend.start()
53
51
 
54
52
    # Record new configuration