Re: [Puppet-dev] [PATCH/facter 1/1] Make the error message for failing to load the pre-requisite Ruby libraries more obvious. (Prompted by #6832)

2011-03-28 Thread Daniel Pittman
On Mon, Mar 28, 2011 at 19:44, Ben Hughes wrote: > On Mon, Mar 28, 2011 at 10:27:07AM -0700, Daniel Pittman wrote: > >> We have internally "deprecated" the sprintf style string builder, so >> when we touch code in the are we rewrite it to use Ruby style #{foo} >> interpolation instead.  That said,

Re: [Puppet-dev] [PATCH/facter 1/1] (#6883) Update Facter install.rb to be slightly more informative.

2011-03-28 Thread Daniel Pittman
On Mon, Mar 28, 2011 at 19:42, Ben Hughes wrote: > Give slightly more information to the user when installing facter and the > pre-requisite Ruby libraries are not installed. Looks great, and this is a clear improvement. Please merge. Daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ✉

Re: [Puppet-dev] [PATCH/facter 1/1] Make the error message for failing to load the pre-requisite Ruby libraries more obvious. (Prompted by #6832)

2011-03-28 Thread Ben Hughes
On Mon, Mar 28, 2011 at 10:27:07AM -0700, Daniel Pittman wrote: > We have internally "deprecated" the sprintf style string builder, so > when we touch code in the are we rewrite it to use Ruby style #{foo} > interpolation instead. That said, not essential to get this > committed... Apologises.

[Puppet-dev] [PATCH/facter 1/1] (#6883) Update Facter install.rb to be slightly more informative.

2011-03-28 Thread Ben Hughes
Give slightly more information to the user when installing facter and the pre-requisite Ruby libraries are not installed. In the case of OpenSSL, the user can have OpenSSL installed, and not the gem/library, but the error message given in no way hints to this. Signed-off-by: Ben Hughes --- Local

Re: [Puppet-dev] RFC on #5158: Make source/content parameters and the file/template functions consistent.

2011-03-28 Thread Nigel Kersten
On Mon, Mar 28, 2011 at 5:21 PM, Markus Roberts wrote: > > We’re also going to introduce a concatenation function called “cat”. >> > > Note there is already a concatenation operator in puppet (from > lib/puppet/parser/ast/leaf.rb): > > > class Concat < AST::Leaf > def evaluate(scope) >

Re: [Puppet-dev] RFC on #5158: Make source/content parameters and the file/template functions consistent.

2011-03-28 Thread Markus Roberts
> We’re also going to introduce a concatenation function called “cat”. > Note there is already a concatenation operator in puppet (from lib/puppet/parser/ast/leaf.rb): class Concat < AST::Leaf def evaluate(scope) @value.collect { |x| x.evaluate(scope) }.collect{ |x| x == :undef ? ''

[Puppet-dev] RFC on #5158: Make source/content parameters and the file/template functions consistent.

2011-03-28 Thread Nigel Kersten
We've gone back and forth on this for a while, I'd like us to get an implementation agreed upon. If the topic doesn't instantly make sense to you, please visit the bug for an overview of our current inconsistent behavior: http://projects.puppetlabs.com/issues/5158 Whenever an array is specified

Re: [Puppet-dev] Rebased on current next

2011-03-28 Thread Jacob Helwig
On Tue, 22 Mar 2011 23:35:09 +0100, Stefan Schulte wrote: > > The tests now work > - The provider-spec for the port type now uses the > »all_parsedfile_providers« helper to test correct file parsing. > - add a validate function to satisfy a failing test > - improve documentation of the type (inc

Re: [Puppet-dev] [PATCH/puppet 2/3] (#5660) Parsedfile provider for port

2011-03-28 Thread Jacob Helwig
On Tue, 22 Mar 2011 23:35:11 +0100, Stefan Schulte wrote: > [...] > + # This method is important for prefetching and is called from the > parsedfile provider. > + # We get one record (one line of /etc/services) and a hash of resources > (what the user > + # specified in manifests). This has

Re: [Puppet-dev] [PATCH/puppet 1/3] (#5660) New Type to handle /etc/services entries

2011-03-28 Thread Nigel Kersten
On Tue, Mar 22, 2011 at 3:35 PM, Stefan Schulte < stefan.schu...@taunusstein.net> wrote: > This new type "port" handles entries in /etc/services. It uses multiple > key_attributes (name and protocol), so you are able to add e.g. > multiple telnet lines for tcp and udp. Sample usage > Is "port" th

Re: [Puppet-dev] [PATCH/puppet 1/3] (#5660) New Type to handle /etc/services entries

2011-03-28 Thread Markus Roberts
> +def self.title_patterns > + [ > +# we have two title_patterns "name" and "name:protocol". We won't > use > +# one pattern (that will eventually set :protocol to nil) because > we > +# want to use a default value for :protocol. And that does only > work > +

Re: [Puppet-dev] [PATCH/puppet 1/3] (#5660) New Type to handle /etc/services entries

2011-03-28 Thread Jacob Helwig
On Tue, 22 Mar 2011 23:35:10 +0100, Stefan Schulte wrote: > [...] > + The second way is the prefered way if you want to specifiy a port that > + uses both tcp and udp as a protocol. You need to define two resources > + for such a port but the resource title still has to be uniq.

Re: [Puppet-dev] [PATCH/puppet 2/3] Fixing Module#path detection

2011-03-28 Thread Markus Roberts
D -- For some reason FileTest.exist? was returning false, > and FileTest.directory? returns true. > >> > >> […] > >>> At best, we have some leaky stubbing in a tests or some other > confounding > >>> factor (but nothing that should require changing lib-code); at worst, > we > >>> have so

Re: [Puppet-dev] [PATCH/puppet 2/3] Fixing Module#path detection

2011-03-28 Thread Daniel Pittman
On Mon, Mar 28, 2011 at 13:32, Luke Kanies wrote: > On Mar 28, 2011, at 1:28 PM, Daniel Pittman wrote: > >> On Mon, Mar 28, 2011 at 11:23, Markus Roberts wrote: >> For some reason FileTest.exist? was returning false, and FileTest.directory? returns true. >> >> […] >>> At best, we have s

Re: [Puppet-dev] [PATCH/puppet 2/3] Fixing Module#path detection

2011-03-28 Thread Luke Kanies
On Mar 28, 2011, at 11:23 AM, Markus Roberts wrote: > L -- > > For some reason FileTest.exist? was returning false, > and FileTest.directory? returns true. > > > # Find this module in the modulepath. > def path > -environment.modulepath.collect { |path| File.join(path, name) }.find { >

Re: [Puppet-dev] [PATCH/puppet 2/3] Fixing Module#path detection

2011-03-28 Thread Luke Kanies
On Mar 28, 2011, at 1:28 PM, Daniel Pittman wrote: > On Mon, Mar 28, 2011 at 11:23, Markus Roberts wrote: > >>> For some reason FileTest.exist? was returning false, >>> and FileTest.directory? returns true. > > […] >> At best, we have some leaky stubbing in a tests or some other confounding >>

Re: [Puppet-dev] [PATCH/puppet 2/3] Fixing Module#path detection

2011-03-28 Thread Daniel Pittman
On Mon, Mar 28, 2011 at 11:23, Markus Roberts wrote: >> For some reason FileTest.exist? was returning false, >> and FileTest.directory? returns true. […] > At best, we have some leaky stubbing in a tests or some other confounding > factor (but nothing that should require changing lib-code); at w

Re: [Puppet-dev] [PATCH/puppet 0/3] #6850 and #6851 - Improving ResourceType listing

2011-03-28 Thread Luke Kanies
Yes it does - I didn't realize there was a ticket open. I'll close this. On Mar 28, 2011, at 12:46 PM, Dan Bode wrote: > does this resolve: > > http://projects.puppetlabs.com/issues/6650 > > ? > > On Mon, Mar 28, 2011 at 10:49 AM, Luke Kanies wrote: > This commit series significantly improve

Re: [Puppet-dev] [PATCH/puppet 0/3] #6850 and #6851 - Improving ResourceType listing

2011-03-28 Thread Dan Bode
does this resolve: http://projects.puppetlabs.com/issues/6650 ? On Mon, Mar 28, 2011 at 10:49 AM, Luke Kanies wrote: > This commit series significantly improves interacting with the list > of Resource Types over the REST api (or locally). > > The first patch simplifies the JSON form of the typ

Re: [Puppet-dev] [PATCH/puppet 2/3] Fixing Module#path detection

2011-03-28 Thread Markus Roberts
L -- For some reason FileTest.exist? was returning false, > and FileTest.directory? returns true. > > > # Find this module in the modulepath. > def path > -environment.modulepath.collect { |path| File.join(path, name) }.find { > |d| FileTest.exist?(d) } > +environment.modulepath.collec

[Puppet-dev] [PATCH/puppet 1/3] Fixed #6850 - Clean up ResourceType#to_pson

2011-03-28 Thread Luke Kanies
There's no value in including the code when we convert a resource type to JSON, since you can't convert it back again, so this removes it. I also cleaned up a few of the other attributes which were producing unnecessary information. Signed-off-by: Luke Kanies Reviewed-by: Daniel Pittman --- li

[Puppet-dev] [PATCH/puppet 3/3] Fixing #6851 - ResourceType#find/search loads types

2011-03-28 Thread Luke Kanies
Previously we could only find types from site.pp, but we now automatically load the specified type (for find) or all types. This also adds a TypeLoader#import_all capable of importing all manifests (ruby or puppet) on a given system. Signed-off-by: Luke Kanies Reviewed-by: Daniel Pittman --- l

[Puppet-dev] [PATCH/puppet 1/1] (#6855) ResourceType#search now accepts a regex

2011-03-28 Thread Luke Kanies
We treat the regex relatively plainly, but this is more reasonable than just '*'. Signed-off-by: Luke Kanies Reviewed-by: Max Martin --- lib/puppet/indirector/resource_type/parser.rb | 13 - spec/unit/indirector/resource_type/parser_spec.rb | 31 +++- 2 files cha

[Puppet-dev] [PATCH/puppet 0/3] #6850 and #6851 - Improving ResourceType listing

2011-03-28 Thread Luke Kanies
This commit series significantly improves interacting with the list of Resource Types over the REST api (or locally). The first patch simplifies the JSON form of the type - it removes empty fields, mostly, but also skips trying to serialize any code attached. The third patch automatically loads a

[Puppet-dev] [PATCH/puppet 2/3] Fixing Module#path detection

2011-03-28 Thread Luke Kanies
For some reason FileTest.exist? was returning false, and FileTest.directory? returns true. I've also added much better tests for this behavior. Signed-off-by: Luke Kanies Reviewed-by: Daniel Pittman --- lib/puppet/module.rb |2 +- spec/unit/module_spec.rb | 39 +++

Re: [Puppet-dev] [PATCH/facter 1/1] Make the error message for failing to load the pre-requisite Ruby libraries more obvious. (Prompted by #6832)

2011-03-28 Thread Matt Robinson
On Mon, Mar 28, 2011 at 10:27 AM, Daniel Pittman wrote: > On Sun, Mar 27, 2011 at 20:09, Ben Hughes wrote: > > > > Signed-off-by: Ben Hughes > > --- > > Local-branch: tickets/master/6832 > > install.rb |2 +- > > 1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/install.

Re: [Puppet-dev] [PATCH/facter 1/1] Make the error message for failing to load the pre-requisite Ruby libraries more obvious. (Prompted by #6832)

2011-03-28 Thread Daniel Pittman
On Sun, Mar 27, 2011 at 20:09, Ben Hughes wrote: > > Signed-off-by: Ben Hughes > --- > Local-branch: tickets/master/6832 >  install.rb |    2 +- >  1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/install.rb b/install.rb > index eb91e7c..42acfb9 100755 > --- a/install.rb > +++ b/