Unmask services during post-series-upgrade

If a unit is paused then its services will not start during the
post-series-upgrade hook. In addition exclude haproxy from the list
of services to start if it is being managed by hacluster.

Closes-Bug: #1861660
Change-Id: I5f72f5507b9ed40b50dcacd1940e91d3cff26298
This commit is contained in:
Liam Young 2020-02-03 09:25:58 +00:00
parent 2d8d80e47e
commit bbc0e3dcd3
1 changed files with 5 additions and 1 deletions

View File

@ -86,6 +86,7 @@ from charmhelpers.contrib.openstack.ha.utils import (
from charmhelpers.contrib.hahelpers.cluster import (
is_elected_leader,
determine_api_port,
get_managed_services_and_ports,
)
from charmhelpers.core.hookenv import (
@ -111,6 +112,7 @@ from charmhelpers.core.host import (
service_restart,
service_stop,
service_start,
service_resume,
)
from charmhelpers.fetch import (
apt_install,
@ -781,8 +783,10 @@ def post_series_upgrade():
log("Running complete series upgrade hook", "INFO")
openstack.clear_unit_paused()
openstack.clear_unit_upgrading()
_services, _ = get_managed_services_and_ports(services(), [])
if not openstack.is_unit_paused_set():
for service in services():
for service in _services:
service_resume(service)
started = service_start(service)
if not started:
raise Exception("{} didn't start cleanly.".format(service))