Пример #1
0
/*
Load node yaml based on hostname
*/
func LoadNode(hostname string) (Node, error) {
	selectedNode := VoodooDataPathNodes + hostname + ".yaml"

	node := Node{}

	err := yaml.Unmarshal(lib.LoadFile(selectedNode), &node)
	if err != nil {
		return node, err
	}
	return node, nil
}
Пример #2
0
func LoadNodeFromYaml(file string) (Node, error) {
	selectedNode := VoodooDataPathNodes + file

	node := Node{}

	err := yaml.Unmarshal(lib.LoadFile(selectedNode), &node)
	if err != nil {
		return node, err
	}
	return node, nil
}