Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
2015-03-30 10:33:17 +03:00
parent dda4e55470
commit da65c72ea4
2 changed files with 12 additions and 8 deletions

View File

@@ -73,9 +73,9 @@ func validateCloudConfig(config []byte, rules []rule) (report Report, err error)
// any parsing issues into the provided report. Unrecoverable errors are
// returned as an error.
func parseCloudConfig(cfg []byte, report *Report) (node, error) {
yaml.UnmarshalMappingKeyTransform = func(nameIn string) (nameOut string) {
return nameIn
}
// yaml.UnmarshalMappingKeyTransform = func(nameIn string) (nameOut string) {
// return nameIn
// }
// unmarshal the config into an implicitly-typed form. The yaml library
// will implicitly convert types into their normalized form
// (e.g. 0744 -> 484, off -> false).
@@ -104,9 +104,9 @@ func parseCloudConfig(cfg []byte, report *Report) (node, error) {
w = normalizeNodeNames(w, report)
// unmarshal the config into the explicitly-typed form.
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 strong config.CloudConfig
if err := yaml.Unmarshal([]byte(cfg), &strong); err != nil {
return node{}, err