Kjetil Torgrim Homme | 1 Feb 2010 08:37
Picon

Re: [PATCH/puppet 1/1] Fix for #3114 (ruby's arbitrary limit on process groups too low)

Markus Roberts <Markus <at> reality.com> writes:

> In some circumstances ruby's arbitrary limit on process groups is too
> low (32).  This patch raises the limit in the recommended manner, to
> a value which should suffice in all practical cases (1024).
>
> +Process.maxgroups = 1024

ruby-doc.org says "Returns the maximum number of gids allowed in the
supplemental group access list", so there seems to be a disconnect
between the commit comment and the docs.  FWIW, few systems accept more
than 32 supplemental groups, indeed, if you're using NFS without
Kerberos, the practical limit is 16.  what was the problem you were
experiencing?

-- 
Kjetil T. Homme
Redpill Linpro AS - Changing the game

--

-- 
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Peter Meier | 1 Feb 2010 10:17
Picon
Gravatar

Re: Re: [PATCH/puppet 1/1] Fix for #3114 (ruby's arbitrary limit on process groups too low)

> what was the problem you were
> experiencing?

it's in the bug report: http://projects.reductivelabs.com/issues/3114

cheers pete

--

-- 
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Kjetil Torgrim Homme | 1 Feb 2010 13:45
Picon

Re: [PATCH/puppet 1/1] Fix for #3114 (ruby's arbitrary limit on process groups too low)

Peter Meier <peter.meier <at> immerda.ch> writes:

>> what was the problem you were experiencing?
>
> it's in the bug report: http://projects.reductivelabs.com/issues/3114

ah, doh.  just misleading commit text, then.  (*boggles over users with
57 group memberships*)

BTW, you can check your OS' limit for supplemental file groups using
"getconf NGROUPS_MAX"
-- 
Kjetil T. Homme
Redpill Linpro AS - Changing the game

--

-- 
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Alban Browaeys | 1 Feb 2010 19:47
Picon

workaround modules which have a provider dependings on a custom type defined in the same plugin

I opened a ticket for this issue.
http://projects.reductivelabs.com/issues/3136

That is puppet-mysql uses a type it defines in its module provider.
But load_plugin is applied on the list of files sorted alphabetically
by the agent code.
Thus puppet/type is loaded after puppet/provider.

I workaround this by building the files array with puppet://plugins/puppet/type
added first.

From 5b9a2f91c34ef043023927a5d8a38b027be3f3b1 Mon Sep 17 00:00:00 2001
From: Alban Browaeys <prahal <at> yahoo.com>
Date: Mon, 1 Feb 2010 18:48:09 +0100
Subject: [PATCH] Load the plugins type first.

Fix providers which require a type defined in the same module.

Signed-off-by: Alban Browaeys <prahal <at> yahoo.com>
---
 lib/puppet/configurer/downloader.rb |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/lib/puppet/configurer/downloader.rb b/lib/puppet/
configurer/downloader.rb
index 7409fca..19861f0 100644
--- a/lib/puppet/configurer/downloader.rb
+++ b/lib/puppet/configurer/downloader.rb
 <at>  <at>  -30,8 +30,23  <at>  <at>  class Puppet::Configurer::Downloader
         begin
(Continue reading)

Markus Roberts | 1 Feb 2010 22:03
Favicon

Re: workaround modules which have a provider dependings on a custom type defined in the same plugin

Alban --

As I noted on your ticket (#3136) I'm not seeing why adding a require
statement at the top of the provider wouldn't solve this issue.  See,
for example, lib/puppet/provider/package/appdmg.rb which starts thusly
(after the header comments):

require 'puppet/provider/package'
Puppet::Type.type(:package).provide(:appdmg, :parent =>
Puppet::Provider::Package) do
    desc "Package management which copies application bundles to a target."

This is the normal way of dealing with dependencies--make them explicit.

-- Markus

--

-- 
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

James Turnbull | 1 Feb 2010 22:09
Gravatar

[PATCH/puppet 1/1] 2047: Add a not_include into match

From: Bryan Kearney <bkearney <at> redhat.com>

Signed-off-by: James Turnbull <james <at> lovedthanlost.net>
---
 lib/puppet/provider/augeas/augeas.rb |    4 ++++
 lib/puppet/type/augeas.rb            |    1 +
 spec/unit/provider/augeas/augeas.rb  |   10 ++++++++++
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb
index 8dccb4e..ac11bbf 100644
--- a/lib/puppet/provider/augeas/augeas.rb
+++ b/lib/puppet/provider/augeas/augeas.rb
 <at>  <at>  -39,6 +39,7  <at>  <at>  Puppet::Type.type(:augeas).provide(:augeas) do
       "match" => [ :path, :glob ],
       "size" => [:comparator, :int],
       "include" => [:string],
+      "not_include" => [:string],
       "==" => [:glob],
       "!=" => [:glob]
     }
 <at>  <at>  -206,6 +207,9  <at>  <at>  Puppet::Type.type(:augeas).provide(:augeas) do
         when "include"
             arg = clause_array.shift
             return_value = result.include?(arg)
+        when "not_include"
+            arg = clause_array.shift
+            return_value = !result.include?(arg)
         when "=="
             begin
(Continue reading)

James Turnbull | 1 Feb 2010 22:10
Gravatar

[PATCH/puppet 2/2] Fix for #2327, check the return types from augeas and fail where appropriate

From: Bryan Kearney <bkearney <at> redhat.com>

Signed-off-by: James Turnbull <james <at> lovedthanlost.net>
---
 lib/puppet/provider/augeas/augeas.rb |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb
index ac11bbf..d586fc1 100644
--- a/lib/puppet/provider/augeas/augeas.rb
+++ b/lib/puppet/provider/augeas/augeas.rb
 <at>  <at>  -197,6 +197,8  <at>  <at>  Puppet::Type.type(:augeas).provide(:augeas) do

         #Get the values from augeas
         result =  <at> aug.match(path) || []
+        fail("Error trying to match path '#{path}'") if (result == -1)
+
         # Now do the work
         case verb
         when "size"
 <at>  <at>  -321,13 +323,16  <at>  <at>  Puppet::Type.type(:augeas).provide(:augeas) do
                 case command
                     when "set"
                         debug("sending command '#{command}' with params #{cmd_array.inspect}")
-                        aug.set(cmd_array[0], cmd_array[1])
+                        rv = aug.set(cmd_array[0], cmd_array[1])
+                        fail("Error sending command '#{command}' with params #{cmd_array.inspect}/#{e.message}") if (rv)
                     when "rm", "remove"
                         debug("sending command '#{command}' with params #{cmd_array.inspect}")
-                        aug.rm(cmd_array[0])
(Continue reading)

James Turnbull | 1 Feb 2010 22:10
Gravatar

[PATCH/puppet 1/2] 2047: Add a not_include into match

From: Bryan Kearney <bkearney <at> redhat.com>

Signed-off-by: James Turnbull <james <at> lovedthanlost.net>
---
 lib/puppet/provider/augeas/augeas.rb |    4 ++++
 lib/puppet/type/augeas.rb            |    1 +
 spec/unit/provider/augeas/augeas.rb  |   10 ++++++++++
 3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb
index 8dccb4e..ac11bbf 100644
--- a/lib/puppet/provider/augeas/augeas.rb
+++ b/lib/puppet/provider/augeas/augeas.rb
 <at>  <at>  -39,6 +39,7  <at>  <at>  Puppet::Type.type(:augeas).provide(:augeas) do
       "match" => [ :path, :glob ],
       "size" => [:comparator, :int],
       "include" => [:string],
+      "not_include" => [:string],
       "==" => [:glob],
       "!=" => [:glob]
     }
 <at>  <at>  -206,6 +207,9  <at>  <at>  Puppet::Type.type(:augeas).provide(:augeas) do
         when "include"
             arg = clause_array.shift
             return_value = result.include?(arg)
+        when "not_include"
+            arg = clause_array.shift
+            return_value = !result.include?(arg)
         when "=="
             begin
(Continue reading)

Markus Roberts | 1 Feb 2010 22:32
Favicon

Re: [PATCH/puppet 1/1] 2047: Add a not_include into match

+1

--

-- 
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Alban Browaeys | 1 Feb 2010 23:32
Picon

Re: workaround modules which have a provider dependings on a custom type defined in the same plugin



2010/2/1 Markus Roberts <markus <at> reductivelabs.com>
Alban --

As I noted on your ticket (#3136) I'm not seeing why adding a require
statement at the top of the provider wouldn't solve this issue.  See,
for example, lib/puppet/provider/package/appdmg.rb which starts thusly
(after the header comments):

require 'puppet/provider/package'
Puppet::Type.type(:package).provide(:appdmg, :parent =>
Puppet::Provider::Package) do
   desc "Package management which copies application bundles to a target."

This is the normal way of dealing with dependencies--make them explicit.

-- Markus

Because james told me it could be an issue:
<prahal> ok I got rid of the issue with type behing loaded after the provider that requires them by adding 'require "puppet/type"' in the first loaded provider ... seems hackish though
<prahal> I wonder if I ought not to find a better fix before submitting a patch to the author
<Volcane> I'd mail the dev list and ask
<jamesturnbull> prahal: I'd say there is a bug in the type/provider - that is not normal behaviour
<prahal> jamesturnbull, you mean  provider cannot use a type that is defined in the same module (as automatic loader load custom-module/type after custom-module/provider) ?
<prahal> if so yes the module puppet-mysql is heavily broken
<prahal> though I read that a module is not supposed to depend on another module . This means  custom types cannot be loaded in a provider at all
<jamesturnbull> prahal: I don't know this type/provider but I've never needed to put "require" into a provider to make it load the type
<jamesturnbull> prahal: hmmm it should load type first
<prahal> as far as the log show it looks like the directories under lib are loaded in alphabetical order when "Loading downloaded plugin" ie puppet/type is after facter/ puppet/parser puppet/provider
<prahal> I agree that it would make more sense to have the plugin loader load type first else it is not possibble to use them . 
<prahal> as I see now it looks like "Loading downloaded plugin" only happens once . After maybe the type are loaded first but after first deployment not
<jamesturnbull> prahal: can you please log a ticket on this?


So :
require "puppet/type"
is ok in the provider and would load the module type even if they were never loaded previously ?

Best regards,
Alban

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to puppet-dev <at> googlegroups.com.
To unsubscribe from this group, send email to puppet-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Gmane