cloudinit/config/validate
Alex Crawford 5527f09778 config: fix parsing of file permissions
These reintroduces the braindead '744' syntax for file permissions. Even
though this number isn't octal, it is assumed by convention to be. In
order to pull this off, coerceNodes() was introduced to try to
counteract the type inferrencing that occurs during the yaml
unmarshalling. The config is unmarshalled twice: once into an empty
interface and once into the CloudConfig structure. The two resulting
node structures are combined together. The nodes from the CloudConfig
process replace those from the interface{} when the types of the two
nodes are compatible. For example, with the input `0744`, yaml
interprets that as the integer 484 giving us the nodes '0744'(string)
and 484(int). Because the types string and int are compatible, we opt to
take the string node instead of the integer.
2014-12-30 16:20:21 +01:00
..
context_test.go config/validate: add new config validator 2014-11-12 16:48:57 -08:00
context.go config/validate: add new config validator 2014-11-12 16:48:57 -08:00
node_test.go config/validate: add new config validator 2014-11-12 16:48:57 -08:00
node.go config: add support for float64 2014-11-21 16:13:49 -08:00
report_test.go config/validate: add new config validator 2014-11-12 16:48:57 -08:00
report.go config/validate: add new config validator 2014-11-12 16:48:57 -08:00
rules_test.go validate: promote invalid values to an error 2014-11-26 10:29:09 -08:00
rules.go validate: fix printing for non-string values 2014-12-30 16:20:21 +01:00
validate_test.go config: fix parsing of file permissions 2014-12-30 16:20:21 +01:00
validate.go config: fix parsing of file permissions 2014-12-30 16:20:21 +01:00