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)
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)
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)
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)
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)