Re: [Puppet-dev] Is it possible to call a custom function from a custom type.

2011-03-22 Thread Luke Kanies
Is your code published? You should be using a util class loaded by both the function and the type, and it doesn't look like you are. -- Luke Kanies | +1-615-594-8199 On Mar 22, 2011, at 5:45 PM, Trevor Vaughan wrote: > Ok, so after futzing around with that for a while, I came up with a > solu

Re: [Puppet-dev] Is it possible to call a custom function from a custom type.

2011-03-22 Thread Trevor Vaughan
Ok, so after futzing around with that for a while, I came up with a solution, but it feels...well...bad. In my custom type, I do the following: s = Puppet::Parser::Scope.new Puppet::Parser::Functions.autoloader.loadall I can then call my function with s.function_functionname(args) What are the

Re: [Puppet-dev] Is it possible to call a custom function from a custom type.

2011-03-22 Thread Trevor Vaughan
Hmm...I spoke too soon. Adding the util directory allows the custom function to call it with no problem however the custom type says that the call is an uninitialized constant. I've tried pretty much everything that I can think of while still keeping this in a module. Any examples? Thanks, Tre

[Puppet-dev] Re: [PATCH/puppet 23/23] (#4258) Bug fix: populating instances for aliases

2011-03-22 Thread Juerg Walz
On Mar 23, 6:53 am, Dominic Cleal wrote: > Yep, fixed with pkg.dup. Works for me, too. I've ran a few test with package names and aliases. Juerg -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet

Re: [Puppet-dev] Is it possible to call a custom function from a custom type.

2011-03-22 Thread Trevor Vaughan
Ok, you made that too easy Thanks! Trevor On Tue, Mar 22, 2011 at 7:08 PM, Luke Kanies wrote: > It should generally work in a module, yes. > > On Mar 22, 2011, at 4:06 PM, Trevor Vaughan wrote: > >> Does that work in a module, or would I be placing that into the normal >> util space? >> >>

Re: [Puppet-dev] Is it possible to call a custom function from a custom type.

2011-03-22 Thread Trevor Vaughan
Does that work in a module, or would I be placing that into the normal util space? I'm trying to keep everything in a module. Thanks, Trevor On Tue, Mar 22, 2011 at 7:02 PM, Luke Kanies wrote: > On Mar 22, 2011, at 3:34 PM, Trevor Vaughan wrote: > >> All, >> >> I'm trying to figure out if I ca

Re: [Puppet-dev] Is it possible to call a custom function from a custom type.

2011-03-22 Thread Luke Kanies
It should generally work in a module, yes. On Mar 22, 2011, at 4:06 PM, Trevor Vaughan wrote: > Does that work in a module, or would I be placing that into the normal > util space? > > I'm trying to keep everything in a module. > > Thanks, > > Trevor > > On Tue, Mar 22, 2011 at 7:02 PM, Luke

Re: [Puppet-dev] Is it possible to call a custom function from a custom type.

2011-03-22 Thread Luke Kanies
On Mar 22, 2011, at 3:34 PM, Trevor Vaughan wrote: > All, > > I'm trying to figure out if I can call a custom function that I've > written from a custom type that I'm writing. > > Basically, I'm trying to reuse code and not repeat it all in the type. Kind of, assuming that it's all distributed

Re: [Puppet-dev] [PATCH/puppet 23/23] (#4258) Bug fix: populating instances for aliases

2011-03-22 Thread Dominic Cleal
On 21/03/11 11:50, Dominic Cleal wrote: > On 21/03/11 09:08, Dominic Cleal wrote: >> On 21/03/11 03:54, Juerg Walz wrote: >>> diff --git a/lib/puppet/provider/package/pkgutil.rb >>> b/lib/puppet/provider/package/pkgutil.rb >>> index 350cacc..97625f2 100755 >>> --- a/lib/puppet/provider/package/pkg

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

2011-03-22 Thread Stefan Schulte
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 port { 'telnet': number => '23', protocol=> 'tcp', description => 'Telnet'

[Puppet-dev] [PATCH/puppet 1/2] (#6527) Added pip package provider.

2011-03-22 Thread Matt Robinson
From: Richard Crowley Python's pip package manager is analogous to RubyGems and should be included in Puppet. Reviewed-by: Matt Robinson Signed-off-by: Matt Robinson --- Local-branch: feature/next/6257-pip_package_provider lib/puppet/provider/package/pip.rb | 115 +++ sp

[Puppet-dev] [PATCH/puppet 2/2] (#6527) Fix uninstall problem and refactor

2011-03-22 Thread Matt Robinson
Uninstall wasn't working properly because the instances method relied on the pip command having been defined by calling lazy_pip. This lazy_pip pattern is a nice way of getting around Puppet's problem of disqualifying providers at the beginning of a run because the command doesn't yet exist even t

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

2011-03-22 Thread Stefan Schulte
This provider uses parsedfile to parse entries in /etc/services. Because we use composite keys we have to provide an individual match method to find resources for a single record. Signed-off-by: Stefan Schulte --- Local-branch: feature/next/5660N lib/puppet/provider/port/parsed.rb

[Puppet-dev] Rebased on current next

2011-03-22 Thread Stefan Schulte
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 (including your corrections) - changed separator in the title_pattern from

[Puppet-dev] Is it possible to call a custom function from a custom type.

2011-03-22 Thread Trevor Vaughan
All, I'm trying to figure out if I can call a custom function that I've written from a custom type that I'm writing. Basically, I'm trying to reuse code and not repeat it all in the type. Thanks, Trevor -- Trevor Vaughan Vice President, Onyx Point, Inc (410) 541-6699 tvaug...@onyxpoint.com

[Puppet-dev] [PATCH/facter 1/1] Ensures that ARP facts are returned only on EC2 hosts

2011-03-22 Thread ohadlevy
From: Ohad Levy ARP facts on large network might lead to inconstant values as we are always using the first ARP entry from the output of the ARP command Signed-off-by: Ohad Levy --- lib/facter/arp.rb | 12 lib/facter/ec2.rb | 16 +--- 2 files changed, 13 insertions

Re: [Puppet-dev] [PATCH/facter 1/2] (#2714) Added timeout to prtdiag resulution

2011-03-22 Thread Dominic Cleal
On 22/03/11 20:05, Adrien Thebo wrote: > - prtdiag would hang in specific cases, subsequently hanging facter. >This should kill prtdiag if it takes excessively long. I added a call to prtdiag in the manufacturer/product facts (only for SPARC), so it might be worth updating util/manufacturer.r

[Puppet-dev] [PATCH/facter 3/3] (#5135) Refactored physicalprocessorcount

2011-03-22 Thread Adrien Thebo
- Refactored code to make testing simpler Signed-off-by: Adrien Thebo --- Local-branch: tickets/next/5135 lib/facter/physicalprocessorcount.rb | 14 ++ spec/unit/physicalprocessorcount_spec.rb | 40 ++ 2 files changed, 48 insertions(+), 6 deletions(-)

[Puppet-dev] [PATCH/facter 2/3] Re-factor. Do not use pure-Ruby file reading against "/proc/cpuinfo" and possibly any entry under "/sys" from the sysfs file system.

2011-03-22 Thread Adrien Thebo
From: Krzysztof Wilczynski Signed-off-by: Adrien Thebo --- Local-branch: tickets/next/5135 lib/facter/physicalprocessorcount.rb | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/facter/physicalprocessorcount.rb b/lib/facter/physicalprocessorcount.rb index

[Puppet-dev] [PATCH/facter 1/3] Fix. Using sysfs file system entries to count the number of physical CPUs. Fall-back to "/proc/cpuinfo" included for backward-compatibility with legacy systems.

2011-03-22 Thread Adrien Thebo
From: Krzysztof Wilczynski Signed-off-by: Adrien Thebo --- Local-branch: tickets/next/5135 lib/facter/physicalprocessorcount.rb | 41 ++--- 1 files changed, 37 insertions(+), 4 deletions(-) diff --git a/lib/facter/physicalprocessorcount.rb b/lib/facter/physicalp

[Puppet-dev] [PATCH/facter 1/1] Ensures that ARP facts are returned only on EC2 hosts

2011-03-22 Thread ohadlevy
From: Ohad Levy ARP facts on large network might lead to inconstant values as we are always using the first ARP entry from the output of the ARP command Signed-off-by: Ohad Levy --- lib/facter/arp.rb | 12 lib/facter/ec2.rb | 16 +--- 2 files changed, 13 insertions

[Puppet-dev] [PATCH/facter 1/2] (#2714) Added timeout to prtdiag resulution

2011-03-22 Thread Adrien Thebo
- prtdiag would hang in specific cases, subsequently hanging facter. This should kill prtdiag if it takes excessively long. Signed-off-by: Adrien Thebo --- Local-branch: tickets/next/2714 lib/facter/virtual.rb |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib

[Puppet-dev] [PATCH/facter 2/2] (#2714) Fixed faulty test

2011-03-22 Thread Adrien Thebo
- Looks like some copy/paste added some linux tests that relied on prtdiag, which isn't possible. Corrected them to check against solaris. Signed-off-by: Adrien Thebo --- Local-branch: tickets/next/2714 spec/unit/virtual_spec.rb | 30 -- 1 files changed, 16 i

[Puppet-dev] Re: RFC: Splitting up the file{} type functionality.

2011-03-22 Thread Nigel Kersten
On Tue, Mar 22, 2011 at 12:39 PM, Jeffrey Goldschrafe wrote: > On Monday, March 21, 2011 9:53:26 PM UTC-4, Nigel Kersten wrote: >> >> The file{} type can do all of the following: >> >> * manage single files >> * manage directories >> * manage symlinks >> * manage recursive file copies >> >> The in

[Puppet-dev] [PATCH/puppet 1/2] Fix error "invalid multibyte char (US-ASCII)" under Ruby 1.9

2011-03-22 Thread Matt Robinson
Reviewed-by: Nick Lewis Signed-off-by: Matt Robinson --- Local-branch: ticket/next/maint-fix_require_spec_helper_for_ruby_19 lib/puppet/type/macauthorization.rb |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/puppet/type/macauthorization.rb b/lib/puppet/type/ma

[Puppet-dev] [PATCH/puppet 2/2] maint: Change code for finding spec_helper to work with Ruby 1.9

2011-03-22 Thread Matt Robinson
Running the specs under Ruby 1.9 didn't work using the lambda to recurse down directories to find the spec_helper. Standardizing the way to find spec_helper like the rest of specs seemed like the way to go. Here's the command line perl I used to make the change: perl -p -i -e "s/Dir.chdir.*lambd

Re: [Puppet-dev] Agent side reporting

2011-03-22 Thread R.I.Pienaar
- Original Message - > On Tue, Mar 22, 2011 at 7:55 AM, R.I.Pienaar wrote: > > hello, > > > > In the absence of http://projects.puppetlabs.com/issues/show/4339 > > is there any way we can hook into the reporting process on the > > agent side? I don't have a central node as such so sendin

Re: [Puppet-dev] Agent side reporting

2011-03-22 Thread Nan Liu
On Tue, Mar 22, 2011 at 7:55 AM, R.I.Pienaar wrote: > hello, > > In the absence of http://projects.puppetlabs.com/issues/show/4339 is there > any way we can hook into the reporting process on the agent side? I don't > have a central node as such so sending reports is pointless but I want to get

[Puppet-dev] Re: RFC: Splitting up the file{} type functionality.

2011-03-22 Thread Jeffrey Goldschrafe
On Monday, March 21, 2011 9:53:26 PM UTC-4, Nigel Kersten wrote: > > The file{} type can do all of the following: > > * manage single files > * manage directories > * manage symlinks > * manage recursive file copies > > The intersection of all these bits of functionality makes it difficult > to und

Re: [Puppet-dev] [PATCH/puppet 0/8] Experimental Plugable Puppet Authentication System

2011-03-22 Thread Nigel Kersten
On Sat, Dec 4, 2010 at 9:06 AM, Brice Figureau wrote: > On 01/12/10 00:41, Nick Lewis wrote: >> It would be nice to have a simple alternate authentication system (even >> a "none" system like we tried to write) which would help motivate these >> changes. That would also help figure out the API, si

Re: [Puppet-dev] (#5660) Puppet should handle port entries in /etc/services with a native type

2011-03-22 Thread Markus Roberts
> >validate do |value| > > raise Puppet::Error, "number has to be numeric, not #{value}" > unless value =~ /^[0-9]+$/ > > -raise Puppet::Error, "number #{value} out of range" unless > (0...2**16).include?(Integer(value)) > > just out of curiosity: Will (0...2**16) generate

Re: [Puppet-dev] RFC: Splitting up the file{} type functionality.

2011-03-22 Thread Nigel Kersten
On Tue, Mar 22, 2011 at 4:13 AM, David Schmitt wrote: > On 22.03.2011 02:53, Nigel Kersten wrote: >> >> The file{} type can do all of the following: >> >> * manage single files >> * manage directories >> * manage symlinks >> * manage recursive file copies >> >> The intersection of all these bits o

Re: [Puppet-dev] RFC: Splitting up the file{} type functionality.

2011-03-22 Thread Nick Moffitt
Nigel Kersten: > The file{} type can do all of the following: > > * manage single files > * manage directories > * manage symlinks > * manage recursive file copies I tend to use different defaults for the different types, so I would love to be able to do: File { mode => 0444 } Di

Re: [Puppet-dev] RFC: Splitting up the file{} type functionality.

2011-03-22 Thread David Schmitt
On 22.03.2011 02:53, Nigel Kersten wrote: The file{} type can do all of the following: * manage single files * manage directories * manage symlinks * manage recursive file copies The intersection of all these bits of functionality makes it difficult to understand exactly what is going on when y

Re: [Puppet-dev] Agent side reporting

2011-03-22 Thread R.I.Pienaar
- Original Message - > On Mar 21, 2011, at 1:55 PM, R.I.Pienaar wrote: > > > hello, > > > > In the absence of http://projects.puppetlabs.com/issues/show/4339 > > is there any way we can hook into the reporting process on the > > agent side? I don't have a central node as such so sending

Re: [Puppet-dev] Re: Agent side reporting

2011-03-22 Thread R.I.Pienaar
- Original Message - > This would be a greatly missing feature since I don't use a central > puppetmaster model either. In fact it would be nice to be able to > generate a classes list as well so that I can use it for MCollective > facter attributes to filter against. but mcollective do

[Puppet-dev] Re: Agent side reporting

2011-03-22 Thread james
This would be a greatly missing feature since I don't use a central puppetmaster model either. In fact it would be nice to be able to generate a classes list as well so that I can use it for MCollective facter attributes to filter against. On Mar 21, 1:55 pm, "R.I.Pienaar" wrote: > hello, > > In

Re: [Puppet-dev] (#5660) Puppet should handle port entries in /etc/services with a native type

2011-03-22 Thread Stefan Schulte
On Mon, Mar 21, 2011 at 03:42:33PM -0700, Jacob Helwig wrote: > On Fri, 24 Dec 2010 01:04:12 +0100, Stefan Schulte wrote: > > > > I talked about a resourcetype for /etc/services on the list and a > > resourcetype with name and protoco as a composite key seems be be the > > best way to implement it