예제 #1
0
    def check_services_running(self):
        """Check that the services that should be running are actually running.

        This uses the self.services and self.api_ports to determine what should
        be checked.

        :returns: (status, message) or (None, None).
        """
        # This returns either a None, None or a status, message if the service
        # is not running or the ports are not open.
        return os_utils._ows_check_services_running(services=self.services,
                                                    ports=self.ports_to_check(
                                                        self.api_ports))
예제 #2
0
    def check_services_running(self):
        """Check that the services that should be running are actually running.

        This uses the self.services and self.api_ports to determine what should
        be checked.

        :returns: (status, message) or (None, None).
        """
        # This returns either a None, None or a status, message if the service
        # is not running or the ports are not open.
        return os_utils._ows_check_services_running(
            services=self.services,
            ports=self.ports_to_check(self.api_ports))
예제 #3
0
def update_status():
    """Use the update-status hook to check to see if we can restart the
    manila-share service: (BUG#1706699).  The bug appears to be a race-hazard
    but it's proving very difficult to track it down.

    This is a band-aid to enable the charm to get into a working state once all
    of the interfaces have joined, and the bug has been hit; otherwise the
    charm stays "stuck" with the service not running.

    Note, there is no need to actually call update_status as one of the other
    handlers will activate it.
    """
    if not os_utils.is_unit_paused_set():
        with charms_openstack.charm.provide_charm_instance() as manila_charm:
            if manila_charm.get_adapter('remote-manila-plugin.available'):
                services = []
            else:
                services = ['manila-share']
        state, message = os_utils._ows_check_services_running(
            services=services, ports=None)
        if state == 'blocked' and services:
            # try to start the 'manila-share' service
            ch_host.service_start('manila-share')