service_resume and service_pause should be idempotent.
Bug #1516821 reported by
Chad Smith
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Charm Helpers |
In Progress
|
Undecided
|
Chad Smith |
Bug Description
In the event of hook retries, service_pause and service_resume should succeed if called multiple times. To support this use case, both of these functions need to gracefully handle to following cases:
- service_pause should succeed if the unit is already in a paused state
- service_resume should succeed if the unit is already in a resumed state
The service_pause function exits in error when run on an already paused unit because "service <name> stop" exits non-zero if the service is already stopped.
Conversely, the service_resume function exits in error when run on an already resumed unit because "service <name> start" exits non-zero if the service is already running.
Related branches
lp:~chad.smith/charm-helpers/resume-pause-idempotent
- Stuart Bishop (community): Approve
- charmers: Pending requested
-
Diff: 284 lines (+176/-68)3 files modifiedVERSION (+1/-1)
charmhelpers/core/host.py (+6/-2)
tests/core/test_host.py (+169/-65)
Changed in charm-helpers: | |
assignee: | nobody → Chad Smith (chad.smith) |
status: | New → In Progress |
To post a comment you must log in.