~bjornt/charms/wily/landscape-client/trunk

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: Christopher Glass
  • Date: 2014-08-28 10:10:51 UTC
  • mfrom: (43.1.2 fix-unit-tests-take-two)
  • Revision ID: christopher.glass@canonical.com-20140828101051-lakskww2hphu1h0p
Merge lp:~tribaal/charms/trusty/landscape-client/fix-unit-tests-take-two [r=free, sparkiegeek]

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
import base64
7
7
 
8
8
from charmhelpers.core.hookenv import (
9
 
    Hooks, UnregisteredHookError, log, local_unit)
 
9
    Hooks, UnregisteredHookError, log)
10
10
from shutil import rmtree
11
11
from subprocess import CalledProcessError
12
12
 
41
41
    @param relation_data: data from the context of a relation, it should
42
42
                          match the data in the config
43
43
    """
44
 
    log("In config-changed for %s" % local_unit())
 
44
    juju_broker.log("In config-changed for %s" % landscape_broker.local_unit)
45
45
    if relation_data is None:
46
46
        relation_data = {}
47
47
    service_config = juju_broker.get_service_config()
67
67
@hooks.hook("container-relation-joined", "ceph-client-relation-joined")
68
68
def container_relation_joined(juju_broker=JUJU_BROKER,
69
69
                              landscape_broker=LANDSCAPE_BROKER):
70
 
    log("In container-relation-joined for %s" % local_unit())
 
70
    juju_broker.log("In container-relation-joined for %s"
 
71
                    "" % landscape_broker.local_unit)
71
72
    landscape_broker.config.reload()
72
73
    relation_conf = juju_broker.get_relation_config()
73
74
    remote_unit_name = juju_broker.environment.get("JUJU_REMOTE_UNIT")