Ask Your Question
0

YAML Bug in 2015.3 ?

asked 2015-12-14 08:27:30 -0500

FranzCC gravatar image

Hi, since i write my own yaml files using standard implementations i stumbled upon a severe problem.
Boolean Boolean (note: includes on and off, yes and no in addition to true and false)
Good, but why puppet wants to have Language Independent Scalar types quoted ?
This is not the standard so i had to patch the STANDARD implementation to quote the boolean strings.
Next one: Also puppet interprets "stopped" unquoted as bool which is completely wrong.
See: (key: service: stopped)
key service expects a String or Array, got FalseClass
Quoting:
service: "stopped" works.

I patched LibYaml:
(string_len == 0) ||
strEQ(string, "~") ||
strEQ(string, "yes") ||
strEQ(string, "stopped") ||
strEQ(string, "no") ||
strEQ(string, "on") ||
strEQ(string, "off") ||
strEQ(string, "true") ||
strEQ(string, "false") ||
strEQ(string, "null") ||
to get things working. I didn't test json the backend yet ;-)

Perhaps a developer can explain why.

Rgds. Franz

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-12-15 01:09:46 -0500

FranzCC gravatar image

updated 2015-12-15 02:35:20 -0500

So i will anwser the question myself. ;-)
Reading this [http://devblog.arnebrasseur.net/2014-...]
changed my mind and i will convert to JSON format.
Puppet uses Psych YAML Parser. only available for ruby.
Perl and C/C++ uses the standard libayml implementation.
So, before i change system libraries i will switch to JSON.
Hopefully you use JSON standard ;-)

Rgds.
Franz

edit flag offensive delete link more

Comments

And JSON works as expected.
You really should stick with the YAML standard or switch to only use JSON. Franz

FranzCC gravatar imageFranzCC ( 2015-12-15 02:24:02 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-12-14 08:27:30 -0500

Seen: 67 times

Last updated: Dec 15 '15