~simpoir/landscape-charm/juju-deploy-err

« back to all changes in this revision

Viewing changes to hooks/lib/hook.py

  • Committer: Free Ekanayaka
  • Date: 2015-01-28 11:53:18 UTC
  • mto: (218.5.1 run-schema-script)
  • mto: This revision was merged to the branch mainline in revision 222.
  • Revision ID: free.ekanayaka@canonical.com-20150128115318-kftwmfs9fbc8vop8
Add PostgreSQLRelationContext

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
class Hook(object):
13
13
    """Juju hook Abstraction, providing dependency injection for testing."""
14
14
 
15
 
    _name = None  # MUST be set by sub-classes
16
 
 
17
15
    def __init__(self, hookenv=hookenv):
18
16
        """
19
17
        @param hookenv: The charm-helpers C{hookenv} module, will be replaced
26
24
 
27
25
        @return: An integer with the exit code for the hook.
28
26
        """
29
 
        self._hookenv.log("Executing %s hook handler" % self._name)
 
27
        self._hookenv.log("Invoke handler for %s" % self._hookenv.hook_name())
30
28
        try:
31
29
            self._run()
32
30
        except HookError, error: