@@ -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
|
||||
|
Reference in New Issue
Block a user