Example #1
0
def get_app_build(app_dict):
    domain = Domain.get_by_name(app_dict["domain"])
    if domain.use_cloudcare_releases:
        return ApplicationBase.get(app_dict["_id"]).get_latest_app()["_id"]
    else:
        return ApplicationBase.get_latest_build(app_dict["domain"], app_dict["_id"])["_id"]
    return None
Example #2
0
def get_app_build(app_dict):
    domain = Domain._get_by_name(app_dict['domain'])
    if domain.use_cloudcare_releases:
        return ApplicationBase.get(app_dict['_id']).get_latest_app()['_id']
    else:
        return ApplicationBase.get_latest_build(app_dict['domain'], app_dict['_id'])['_id']
    return None
Example #3
0
def get_app_build(app_dict):
    domain = Domain.get_by_name(app_dict['domain'])
    if domain.use_cloudcare_releases:
        return ApplicationBase.get(app_dict['_id']).get_latest_app()['_id']
    else:
        return get_latest_build_id(app_dict['domain'], app_dict['_id'])
    return None
Example #4
0
def _get_version_from_build_id(domain, build_id):
    try:
        build = ApplicationBase.get(build_id)
    except ResourceNotFound:
        return None
    if not build.copy_of:
        return None
    elif build.domain != domain:
        return None
    else:
        return build.version
Example #5
0
def _get_version_from_build_id(domain, build_id):
    try:
        build = ApplicationBase.get(build_id)
    except ResourceNotFound:
        return None
    if not build.copy_of:
        return None
    elif build.domain != domain:
        return None
    else:
        return build.version
Example #6
0
def get_version_from_build_id(domain, build_id):
    """
    fast lookup of app version number given build_id

    implemented as simple caching around _get_version_from_build_id

    """
    if not build_id:
        return None

    try:
        build = ApplicationBase.get(build_id)
    except ResourceNotFound:
        return None
    if not build.copy_of:
        return None
    elif build.domain != domain:
        return None
    else:
        return build.version