~hazmat/pyjuju/rapi-rollup

« back to all changes in this revision

Viewing changes to juju/hooks/protocol.py

  • Committer: Kapil Thangavelu
  • Date: 2013-01-20 12:17:15 UTC
  • mfrom: (616.2.13 rapi-annotation)
  • Revision ID: kapil@canonical.com-20130120121715-exju6n7miobz9gmc
Merged rapi-annotation into rapi-rollup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
        if relation_id:
207
207
            yield self.factory.log(
208
208
                logging.DEBUG, "Getting relation %s" % relation_id)
209
 
            context = yield invoker.get_relation_hook_context(relation_id)
 
209
            context = invoker.get_cached_relation_hook_context(relation_id)
210
210
        require_relation_context(context)
211
211
 
212
212
        try:
238
238
        if relation_id:
239
239
            yield self.factory.log(
240
240
                logging.DEBUG, "Setting relation %s" % relation_id)
241
 
            context = yield invoker.get_relation_hook_context(relation_id)
 
241
            context = invoker.get_cached_relation_hook_context(relation_id)
242
242
        require_relation_context(context)
243
243
 
244
244
        for k, v in data.items():
256
256
        if relation_id:
257
257
            yield self.factory.log(
258
258
                logging.DEBUG, "Listing relation members for %s" % relation_id)
259
 
            context = yield self.factory.get_invoker(client_id).\
260
 
                get_relation_hook_context(relation_id)
 
259
            invoker = yield self.factory.get_invoker(client_id)
 
260
            context = invoker.get_cached_relation_hook_context(relation_id)
261
261
        require_relation_context(context)
262
262
        members = yield context.get_members()
263
263
        defer.returnValue(dict(members=" ".join(members)))
265
265
    @RelationIdsCommand.responder
266
266
    @defer.inlineCallbacks
267
267
    def relation_ids(self, client_id, relation_name):
268
 
        """Set values into state.hook.RelationHookContext.
 
268
        """Get relation idents for this hook context.
269
269
 
270
270
        :client_id: hooks client id that is used to define a context
271
271
           for a consistent view of state.