예제 #1
0
def compare_oc_version(compare_to, operator):
    """

    :param compare_to: E.g. '9.0'
    :param operator: One of '<', '=', '>', '<=', '>='
    :return:
    """
    oc_api = get_oc_api()
    url = oc_api.url + 'status.php'
    rtn_code, std_out, std_err = runcmd('curl %s' % url, log_warning=False)

    import json
    version = (json.loads(std_out))['version']

    return version_compare(version, operator, compare_to)
예제 #2
0
파일: __init__.py 프로젝트: mnutt/smashbox
def compare_oc_version(compare_to, operator):
    """

    :param compare_to: E.g. '9.0'
    :param operator: One of '<', '=', '>', '<=', '>='
    :return:
    """
    oc_api = get_oc_api()
    url = oc_api.url + 'status.php'
    rtn_code, std_out, std_err = runcmd('curl %s' % url, log_warning=False)

    import json
    version = (json.loads(std_out))['version']

    return version_compare(version, operator, compare_to)
예제 #3
0
def compare_client_version(compare_to, operator):
    """

    :param compare_to: E.g. '2.1'
    :param operator: One of '<', '=', '>', '<=', '>='
    :return:
    """

    cmd = config.oc_sync_cmd
    cmd = cmd[:cmd.find(' --')]
    cmd += ' --version'
    rtn_code, std_out, std_err = runcmd(cmd)

    version = std_out[std_out.find(' version ') + 9:]
    if version[-4:-1] == 'git':
        version = version[:-4]

    return version_compare(version, operator, compare_to)
예제 #4
0
파일: __init__.py 프로젝트: mnutt/smashbox
def compare_client_version(compare_to, operator):
    """

    :param compare_to: E.g. '2.1'
    :param operator: One of '<', '=', '>', '<=', '>='
    :return:
    """

    cmd = config.oc_sync_cmd
    cmd = cmd[:cmd.find(' --')]
    cmd += ' --version'
    rtn_code, std_out, std_err = runcmd(cmd)

    version = std_out[std_out.find(' version ') + 9:]
    if version[-4:-1] == 'git':
        version = version[:-4]

    return version_compare(version, operator, compare_to)