Is the marathon api responding?

def ping():
    '''
    Is the marathon api responding?
    '''
    try:
        response = salt.utils.http.query(
            "{0}/ping".format(CONFIG[CONFIG_BASE_URL]),
            decode_type='plain',
            decode=True,
        )
        log.debug(
            'marathon.info returned successfully: %s',
            response,
        )
        if 'text' in response and response['text'].strip() == 'pong':
            return True
    except Exception as ex:
        log.error(
            'error calling marathon.info with base_url %s: %s',
            CONFIG[CONFIG_BASE_URL],
            ex,
        )
    return False