def check_api_version(resource_root, min_version):
    """Check API version

    Checks if the resource_root's API version it at least the given minimum
    version.
    """
    if resource_root.version < min_version:
        raise ex.CMApiVersionError(
            _("API version %(minv)s is required but %(acv)s is in use.")
            % {'minv': min_version, 'acv': resource_root.version})
dataset/ETHPy150Open openstack/sahara/sahara/plugins/cdh/client/types.py/check_api_version/original