def load_conf(conf_file):
"""Loads and parses conf file
Loads and parses the module conf file
Args:
conf_file: string with the conf file name
Returns:
ConfigParser object with conf_file configs
Exception:
OneViewRedfishResourceNotFoundError:
- if conf file not found
"""
if not os.path.isfile(conf_file):
raise errors.OneViewRedfishResourceNotFoundError(conf_file, 'File')
config = configparser.ConfigParser()
config.optionxform = str
try:
config.read(conf_file)
except Exception:
raise
return config
评论列表
文章目录