~hazmat/pyjuju/preserve-unit-for-external-gc

« back to all changes in this revision

Viewing changes to juju/agents/unit.py

  • Committer: kapil.thangavelu at canonical
  • Date: 2011-10-14 15:54:08 UTC
  • mfrom: (402.1.1 retry-sans-hook)
  • Revision ID: kapil.thangavelu@canonical.com-20111014155408-0o9qto1woa219pmm
merge retry-sans-hook [r=fwereade,jimbaker][f=814987]

Fixes a bug with unit agent usage of resolved flags that caused
resolved to always execute hooks, instead of when hook retry was
explicitly specified.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
from twisted.internet.defer import inlineCallbacks, returnValue
7
7
 
8
8
from juju.errors import JujuError
9
 
from juju.state.service import ServiceStateManager
 
9
from juju.state.service import ServiceStateManager, RETRY_HOOKS
10
10
from juju.hooks.protocol import UnitSettingsFactory
11
11
from juju.hooks.executor import HookExecutor
12
12
 
160
160
 
161
161
        # Fire a resolved transition
162
162
        try:
163
 
            if resolved["retry"]:
 
163
            if resolved["retry"] == RETRY_HOOKS:
164
164
                yield self.workflow.fire_transition_alias("retry_hook")
165
165
            else:
166
166
                yield self.workflow.fire_transition_alias("retry")