Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
Василий Толстов 2015-03-30 10:29:18 +03:00
parent 0c98d05ebf
commit dda4e55470

View File

@ -70,9 +70,9 @@ func IsCloudConfig(userdata string) bool {
// string of YAML), returning any error encountered. It will ignore unknown
// fields but log encountering them.
func NewCloudConfig(contents string) (*CloudConfig, error) {
yaml.UnmarshalMappingKeyTransform = func(nameIn string) (nameOut string) {
return strings.Replace(nameIn, "-", "_", -1)
}
// yaml.UnmarshalMappingKeyTransform = func(nameIn string) (nameOut string) {
// return strings.Replace(nameIn, "-", "_", -1)
// }
var cfg CloudConfig
err := yaml.Unmarshal([]byte(contents), &cfg)
return &cfg, err