~adam-collard/charms/trusty/landscape-client/landscape-client-multiple-juju-files

« back to all changes in this revision

Viewing changes to hooks/hooks.py

Make sure the juju-info file is written to disk before trying to
register the client with the server, so that information about the
Juju environment is sent to the server at registration time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
 
86
86
 
87
87
def container_relation_joined(juju_broker, landscape_broker):
88
 
    exit_code = landscape_broker.update_client_config(
89
 
        {"computer-title": juju_broker.environment["JUJU_REMOTE_UNIT"]})
90
 
 
91
88
    landscape_broker.config.reload()
92
89
    relation_conf = juju_broker.get_relation_config()
93
90
    # We use the remote unit for the unit name, since we want to associate this
100
97
    juju_info_file = os.path.join(
101
98
        landscape_broker.config.data_path, "juju-info.json")
102
99
    write_json_file(juju_info_file, juju_info)
 
100
    exit_code = landscape_broker.update_client_config(
 
101
        {"computer-title": juju_broker.environment["JUJU_REMOTE_UNIT"]})
103
102
 
104
103
    return exit_code
105
104