Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-26 Thread markus
> > We initially just force-loaded rails first and then over-rode its > > monkey patches, but then it started force-loaded all of the json libs > > so it could guarantee that its (incompatible) monkey patches won. > > > > At that point our only choice was to use different names. Yay rails. > > >

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-26 Thread James Turnbull
Luke Kanies wrote: On Oct 26, 2014, at 12:08 AM, James Turnbull wrote: Andy Parker wrote: the communication was done with PSON, which is a variant of JSON that has been in use in puppet since at least 2010. As far as I understand PSON started out as simply a vendored version of json_pure. The

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-26 Thread Luke Kanies
> On Oct 26, 2014, at 12:08 AM, James Turnbull wrote: > > Andy Parker wrote: >> the communication was done with PSON, which is a variant of JSON that >> has been in use in puppet since at least 2010. As far as I understand >> PSON started out as simply a vendored version of json_pure. The name >>

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-26 Thread James Turnbull
Andy Parker wrote: the communication was done with PSON, which is a variant of JSON that has been in use in puppet since at least 2010. As far as I understand PSON started out as simply a vendored version of json_pure. The name PSON was apparently because rails would try to patch anything named J

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-25 Thread Charlie Sharpsteen
On Friday, October 24, 2014 2:59:12 PM UTC-7, Andy Parker wrote: > > On Fri, Oct 24, 2014 at 1:58 PM, Joshua Hoblitt > wrote: > >> On 10/24/2014 11:49 AM, Wil Cooley wrote: >> > On the other hand, I'm more likely to try to run grep on the master, >> which >> > does not work well with minimized

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-24 Thread Andy Parker
On Fri, Oct 24, 2014 at 1:58 PM, Joshua Hoblitt wrote: > On 10/24/2014 11:49 AM, Wil Cooley wrote: > > On the other hand, I'm more likely to try to run grep on the master, > which > > does not work well with minimized JSON (I'm clever enough that I can do > it, > > but I would curse under my brea

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-24 Thread Joshua Hoblitt
On 10/24/2014 11:49 AM, Wil Cooley wrote: > On the other hand, I'm more likely to try to run grep on the master, which > does not work well with minimized JSON (I'm clever enough that I can do it, > but I would curse under my breath at having to do so). (Yes, I could > probably query PuppetDB for t

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-24 Thread Wil Cooley
On Fri, Oct 24, 2014 at 10:25 AM, Andy Parker wrote: > Pretty printing introduces a significant overhead. On a test catalog that > we have (the one produced by our many_modules benchmark) it increases the > space needed by 52% (JSON.pretty_generate(p).size == 141065 and > JSON.generate(p).size =

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-24 Thread Andy Parker
On Fri, Oct 24, 2014 at 9:30 AM, Wil Cooley wrote: > > On Oct 23, 2014 5:04 PM, "Andy Parker" wrote: > > > > So what all would be changing? > ... > > 2. YAML files that the master and agent write would move to JSON > (node, facts, last_run_summary, state, etc.). > > Please store these pretty-p

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-24 Thread Trevor Vaughan
I would like to ask for a puppet subcommand that pretty prints (with highlighting?!) the catalog. For large catalogs, those newlines can add 50k or more and the less the better IMO. Trevor On Fri, Oct 24, 2014 at 12:30 PM, Wil Cooley wrote: > > On Oct 23, 2014 5:04 PM, "Andy Parker" wrote: >

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-24 Thread Joshua Hoblitt
On 10/23/2014 05:04 PM, Andy Parker wrote: > MessagePack might be nice. It is pretty well specified, has a fairly > large number of libraries written for it, but it doesn't do much to > help us solve the wild west of encoding in puppet. In MessagePack > there aren't really any enforcements of strin

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-24 Thread Wil Cooley
On Oct 23, 2014 5:04 PM, "Andy Parker" wrote: > > So what all would be changing? ... > 2. YAML files that the master and agent write would move to JSON (node, facts, last_run_summary, state, etc.). Please store these pretty-printed rather than minimized - one long, unindented line of JSON is pr

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-23 Thread Eric Shamow
+1 on hiera-file - I suspect this is where you are going to find this - edge cases around create_resources and other places where people don’t realize they’re serializing data into another format. On the plus side the people doing this are also the ones most likely to understand the impact and

Re: [Puppet-dev] Switching from YAML and PSON to JSON

2014-10-23 Thread Spencer Krum
Awesome work Andy. I will be pleased to not see any encoding bugs any more. I also did not know that anecdote about PSON, good stuff. As to your questions abut user use, I use the hiera-file type pretty frequently, and so some of my catalogs have binary data in the 'content' parameter of the file

[Puppet-dev] Switching from YAML and PSON to JSON

2014-10-23 Thread Andy Parker
A while ago we removed support for puppet to *send* YAML on the network. At the same time we converted to using safe_yaml for receiving YAML in order to keep compatibility with existing agents. Instead of YAML all of the communication was done with PSON, which is a variant of JSON that has been in