Beispiel #1
0
def check_version():
    from flask import request
    version = request.headers.get("X-Broker-Api-Version", None)
    if not version:
        return to_json_response(
            ErrorResponse(description="No X-Broker-Api-Version found.")
        ), HTTPStatus.BAD_REQUEST
    if MIN_VERSION > version_tuple(version):
        return to_json_response(
            ErrorResponse(
                description="Service broker requires version %d.%d+." %
                MIN_VERSION)), HTTPStatus.PRECONDITION_FAILED
Beispiel #2
0
from openbrokerapi.helper import version_tuple

MIN_VERSION_STR = "2.13"
MIN_VERSION = version_tuple(MIN_VERSION_STR)