def load_config(self, path, environments, fill_with_defaults=False):
        """Will load default.yaml and <environment>.yaml at given path.
        The environment config will override the default values.

        :param path: directory where to find your config files. If the last character is not a slash (/) it will be appended. Example: resources/
        :param environments: list of environment configs to load. File name pattern: <environment>.yaml. Example: develop.yaml. Latter configs will override previous ones.
        :param fill_with_defaults: use 'defaults' keyword in config file to fill up following config entrys.
        :return: your config as dictionary.
        """
        yaml.add_implicit_resolver("!environ", self.__environ_pattern)
        yaml.add_constructor('!environ', self.__get_from_environment)
        yaml.add_implicit_resolver("!vault", self.__vault_pattern)
        yaml.add_constructor('!vault', self.__get_from_vault)

        if not path.endswith('/'):
            path += '/'

        if type(environments) != list:
            environments = [environments]

        config = {}
        try:
            for env in environments:
                with open(path + env + '.yaml', 'r') as configFile:
                    env_config = yaml.load(configFile.read()) or {}
                config.update(env_config)
            if fill_with_defaults:
                if 'defaults' in config:
                    defaults = config['defaults']
                    for target in defaults:
                        for index, item in enumerate(config[target]):
                            tmp = defaults[target].copy()
                            tmp.update(config[target][index])
                            config[target][index] = tmp
            return config
        except exceptions.VaultError as error:
            raise ConfigLoaderError("Could not read vault secrets [" + error.__class__.__name__ + "]")
        except yaml.YAMLError as error:
            raise ConfigLoaderError("Configuration files malformed [" + error.__class__.__name__ + "]")
        except json.decoder.JSONDecodeError as error:
            raise ConfigLoaderError("Vault response was not json [" + error.__class__.__name__ + "]")
        except Exception as error:
            raise ConfigLoaderError("WTF? [" + error.__class__.__name__ + "]")
def load_config ( self , path , environments , fill_with_defaults = False ) : yaml . add_implicit_resolver ( "!environ" , self . __environ_pattern ) yaml . add_constructor ( '!environ' , self . __get_from_environment ) yaml . add_implicit_resolver ( "!vault" , self . __vault_pattern ) yaml . add_constructor ( '!vault' , self . __get_from_vault ) if not path . endswith ( '/' ) : path += '/' if type ( environments ) != list : environments = [ environments ] config = { } try : for env in environments : with open ( path + env + '.yaml' , 'r' ) as configFile : env_config = yaml . load ( configFile . read ( ) ) or { } config . update ( env_config ) if fill_with_defaults : if 'defaults' in config : defaults = config [ 'defaults' ] for target in defaults : for index , item in enumerate ( config [ target ] ) : tmp = defaults [ target ] . copy ( ) tmp . update ( config [ target ] [ index ] ) config [ target ] [ index ] = tmp return config except exceptions . VaultError as error : raise ConfigLoaderError ( "Could not read vault secrets [" + error . __class__ . __name__ + "]" ) except yaml . YAMLError as error : raise ConfigLoaderError ( "Configuration files malformed [" + error . __class__ . __name__ + "]" ) except json . decoder . JSONDecodeError as error : raise ConfigLoaderError ( "Vault response was not json [" + error . __class__ . __name__ + "]" ) except Exception as error : raise ConfigLoaderError ( "WTF? [" + error . __class__ . __name__ + "]" )
Will load default.yaml and <environment>.yaml at given path.
        The environment config will override the default values.

        :param path: directory where to find your config files. If the last character is not a slash (/) it will be appended. Example: resources/
        :param environments: list of environment configs to load. File name pattern: <environment>.yaml. Example: develop.yaml. Latter configs will override previous ones.
        :param fill_with_defaults: use 'defaults' keyword in config file to fill up following config entrys.
        :return: your config as dictionary.