service_resume and service_pause should be idempotent.

Bug #1516821 reported by Chad Smith on 2015-11-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
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

Chad Smith (chad.smith) on 2015-11-16
Changed in charm-helpers:
assignee: nobody → Chad Smith (chad.smith)
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers