コード例 #1
0
def get_setup_config(file):
    if not os.path.exists(file):
        return None
    config = cloudstackConfiguration()
    fp = open(file, 'r')
    config = json.load(fp)
    return jsonHelper.jsonLoader(config)
コード例 #2
0
def get_setup_config(file):
    if not os.path.exists(file):
        return None
    config = cloudstackConfiguration()
    fp = open(file, 'r')
    config = json.load(fp)
    return jsonHelper.jsonLoader(config)
コード例 #3
0
def get_setup_config(file):
    if not os.path.exists(file):
        raise IOError("config file %s not found. please specify a valid config file"%file)
    config = cloudstackConfiguration()
    fp = open(file, 'r')
    config = json.load(fp)
    return jsonHelper.jsonLoader(config)
コード例 #4
0
ファイル: configGenerator.py プロジェクト: wj2409/CloudStack
def get_setup_config(file):
    if not os.path.exists(file):
        raise IOError(
            "config file %s not found. please specify a valid config file" %
            file)
    config = cloudstackConfiguration()
    fp = open(file, 'r')
    config = json.load(fp)
    return jsonHelper.jsonLoader(config)
コード例 #5
0
def get_setup_config(file):
    if not os.path.exists(file):
        raise IOError("config file %s not found. please specify a valid config file"%file)
    config = cloudstackConfiguration()
    configLines = []
    with open(file, 'r') as fp:
        for line in fp:
            ws = line.strip()
            if not ws.startswith("#"):
                configLines.append(ws)
    config = json.loads("\n".join(configLines))
    return jsonHelper.jsonLoader(config)
コード例 #6
0
def get_setup_config(file):
    if not os.path.exists(file):
        raise IOError("config file %s not found. please specify a valid config file"%file)
    config = cloudstackConfiguration()
    configLines = []
    with open(file, 'r') as fp:
        for line in fp:
            ws = line.strip()
            if not ws.startswith("#"):
                configLines.append(ws)
    config = json.loads("\n".join(configLines))
    return jsonHelper.jsonLoader(config)
コード例 #7
0
def getSetupConfig(file):
    try:
        config = cloudstackConfiguration()
        configLines = []
        with open(file, 'r') as fp:
            for line in fp:
                ws = line.strip()
                if not ws.startswith("#"):
                    configLines.append(ws)
        config = json.loads("\n".join(configLines))
        return jsonHelper.jsonLoader(config)
    except Exception as e:
        printException(e)
コード例 #8
0
def getSetupConfig(file):
    try:
        config = cloudstackConfiguration()
        configLines = []
        with open(file, 'r') as fp:
            for line in fp:
                ws = line.strip()
                if not ws.startswith("#"):
                    configLines.append(ws)
        config = json.loads("\n".join(configLines))
        return jsonHelper.jsonLoader(config)
    except Exception as e:
        printException(e)