def _check_status(func, read_exception, *args, **kwargs):
        """
        Checks the status of a single component by
        calling the func with the args.  The func is expected to
        return a dict with at least an `available=<bool>` key
        value pair

        :param func func: The function to call
        :param read_exception: If an exception is thrown
            should the exception message be passed as the
            message parameter.  If not a generic
            message parameter will be added to the dict
        :param tuple args: A list of arguments to pass to
            to function
        :param dict kwargs: a dict of keyword arguments
            to pass to the function
        :return: a dictionary that includes the state
            of the component.  At least an 'available'
            key is guaranteed
        :rtype: dict
        """
        try:
            return func(*args, **kwargs)
        except Exception as e:
            _LOG.exception(e)
            message = str(e) if read_exception else 'An error occurred while checking the status'
            return dict(message=message, available=False)
def _check_status ( func , read_exception , * args , ** kwargs ) : try : return func ( * args , ** kwargs ) except Exception as e : _LOG . exception ( e ) message = str ( e ) if read_exception else 'An error occurred while checking the status' return dict ( message = message , available = False )
Checks the status of a single component by
        calling the func with the args.  The func is expected to
        return a dict with at least an `available=<bool>` key
        value pair

        :param func func: The function to call
        :param read_exception: If an exception is thrown
            should the exception message be passed as the
            message parameter.  If not a generic
            message parameter will be added to the dict
        :param tuple args: A list of arguments to pass to
            to function
        :param dict kwargs: a dict of keyword arguments
            to pass to the function
        :return: a dictionary that includes the state
            of the component.  At least an 'available'
            key is guaranteed
        :rtype: dict