Beispiel #1
0
func (e *Env) loadAttributes() {
	files, err := utils.AttributeFiles(e.path + PATH_ATTRIBUTES)
	if err != nil {
		logs.WithEF(err, e.fields).WithField("path", e.path+PATH_ATTRIBUTES).Fatal("Cannot load attribute files")
	}
	files, err = e.addIncludeFiles(files)
	if err != nil {
		logs.WithEF(err, e.fields).WithField("path", e.path+PATH_ATTRIBUTES).Fatal("Cannot load include files")
	}

	e.attributes = attributes.MergeAttributesFiles(files)
	logs.WithFields(e.fields).WithField("attributes", e.attributes).Debug("Attributes loaded")
}
Beispiel #2
0
func (s *Service) loadAttributes() {
	attr := utils.CopyMap(s.env.GetAttributes())
	files, err := utils.AttributeFiles(s.path + PATH_ATTRIBUTES)
	if err != nil {
		logs.WithEF(err, s.fields).WithField("path", s.path+PATH_ATTRIBUTES).Fatal("Cannot load Attributes files")
	}
	files, err = s.addIncludeFiles(files)
	if err != nil {
		logs.WithEF(err, s.fields).WithField("path", s.path+PATH_ATTRIBUTES).Fatal("Cannot load include files")
	}
	attr = attributes.MergeAttributesFilesForMap(attr, files)
	s.attributes = attr
	logs.WithFields(s.fields).WithField("attributes", s.attributes).Debug("Attributes loaded")
}