in osci/config/reader.py [0:0]
def read(self) -> Dict[str, Any]:
"""Read configuration from file
Read and parse yaml configuration file by rule: `<directory_path>/<env>.<file_format>`
:return: configuration dictionary
"""
try:
log.debug(f'Read config from {self.file_path}')
with open(self.file_path) as config_file:
self.__cfg = yaml.load(config_file, Loader=yaml.FullLoader)
log.debug(f"Prod yml load: {self.__cfg}")
meta = self.__cfg[META_CONFIG_FIELD].copy()
if meta[CONFIG_SOURCE_TYPE_FIELD] in readers_types_map:
self.__cfg = readers_types_map[meta[CONFIG_SOURCE_TYPE_FIELD]](self.__cfg, self.dbutils)
if meta.get(PARENT_CONFIG_FIELD) is not None:
self.__cfg = always_merger.merge(
BaseYmlConfigReader(env=meta.get(PARENT_CONFIG_FIELD),
directory_path=self.directory_path,
file_format=self.file_format).config,
self.__cfg
)
log.debug(f"Prod yml res: {self.__cfg}")
return self.__cfg
except FileNotFoundError as ex:
log.error(ex)
raise ex