def create_health_check(lock):
    """
    Return health check function that captures whether the lock is acquired
    """

    def health_check():
        d = lock.is_acquired()
        return d.addCallback(lambda b: (True, {"has_lock": b}))

    return health_check