juju / charm-helpers

Apache License 2.0
18 stars 127 forks source link

Skip service_enable if already enabled #885

Closed brianphaley closed 4 months ago

brianphaley commented 5 months ago

Repeatedly calling service_enable for a service that is already enabled can lead to unintended consequences. Some charms frequently call servie_resume which will call service('enable') and this adds a check to only do so of the service is not enabled.

Related-Bug: #2058505 (cherry picked from commit a3345005e597f098909b7c12dfee630a366ce0f6)