Replace deprecated _ows_check_services_running

_ows_check_services_running was made public without the underscore and
it's private function name was made an alias and marked deprecated by:
https://github.com/juju/charm-helpers/pull/658

Switch to the new name to avoid many deprecation warnings being printed
by dependant charms every time update-status hooks run:
DEPRECATION WARNING: Function _ows_check_services_running is being
removed on/around 2022-05 : use ows_check_services_running() instead

Change-Id: I4758330db81a95ac2aa17f9bc316afdc2eab2d44
This commit is contained in:
Trent Lloyd 2024-01-09 14:59:58 +08:00 committed by Edward Hope-Morley
parent aec72e735b
commit 0042bc36de
2 changed files with 4 additions and 4 deletions

View File

@ -1551,6 +1551,6 @@ class BaseOpenStackCharmAssessStatus(object):
_services, _ports = ch_cluster.get_managed_services_and_ports(
self.services,
self.ports_to_check(self.active_api_ports))
return os_utils._ows_check_services_running(
return os_utils.ows_check_services_running(
services=_services,
ports=_ports)

View File

@ -399,13 +399,13 @@ class TestBaseOpenStackCharmAssessStatus(BaseOpenStackCharmTest):
chm_core.ch_cluster,
'get_managed_services_and_ports',
side_effect=_svc_and_ports)
# verify that the function calls _ows_check_services_running() with the
# verify that the function calls ows_check_services_running() with the
# valid information
self.patch_object(chm_core.os_utils, '_ows_check_services_running',
self.patch_object(chm_core.os_utils, 'ows_check_services_running',
return_value=('active', 'that'))
status, message = self.target.check_services_running()
self.assertEqual((status, message), ('active', 'that'))
self._ows_check_services_running.assert_called_once_with(
self.ows_check_services_running.assert_called_once_with(
services=['my-default-service'],
ports=[11, 12, 13, 1244, 2478, 3589])