+1

And ftr, this usage of the Settings class to create directories is a  
clear indication that we don't have a terribly simple API internally  
for making changes.

Although... It actually got a lot simpler in 0.25.  We could probably  
get the same behaviour with something like:

file = Puppet::Type.type(:file).new(...args...)
catalog = Puppet::Resource::Catalog.new
catalog.add_resource file
catalog.apply

We should be able to decorate the individual resources to make this  
even easier, so you could just do Type.new(...).apply.

But this patch works for now, anyway.

On Sep 17, 2009, at 7:50 PM, Markus Roberts wrote:

>
> Internally the service user & group should only be referenced by the
> place-holder string 'service' which is replaced with the actual user
> or group as needed at the puppet/OS border.  This patch corrects to
> places in reports where Puppet[:user] and Puupet[:group] were being
> used instead.
>
> Signed-off-by: Markus Roberts <[email protected]>
> ---
> lib/puppet/reports/rrdgraph.rb |    2 +-
> lib/puppet/reports/store.rb    |    4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lib/puppet/reports/rrdgraph.rb b/lib/puppet/reports/ 
> rrdgraph.rb
> index 0c1cbf2..3e2eeb7 100644
> --- a/lib/puppet/reports/rrdgraph.rb
> +++ b/lib/puppet/reports/rrdgraph.rb
> @@ -104,7 +104,7 @@ Puppet::Reports.register_report(:rrdgraph) do
>         unless File.directory?(hostdir) and FileTest.writable? 
> (hostdir)
>             # Some hackishness to create the dir with all of the  
> right modes and ownership
>             config = Puppet::Util::Settings.new
> -            config.setdefaults(:reports, :hostdir => {:default =>  
> hostdir, :owner => Puppet[:user], :mode => 0755, :group =>  
> Puppet[:group], :desc => "eh"})
> +            config.setdefaults(:reports, :hostdir => {:default =>  
> hostdir, :owner => 'service', :mode => 0755, :group =>  
> 'service', :desc => "eh"})
>
>             # This creates the dir.
>             config.use(:reports)
> diff --git a/lib/puppet/reports/store.rb b/lib/puppet/reports/store.rb
> index 720e78c..04eff82 100644
> --- a/lib/puppet/reports/store.rb
> +++ b/lib/puppet/reports/store.rb
> @@ -16,8 +16,8 @@ Puppet::Reports.register_report(:store) do
>             "client-#{client}-dir" => { :default => dir,
>                 :mode => 0750,
>                 :desc => "Client dir for %s" % client,
> -                :owner => Puppet[:user],
> -                :group => Puppet[:group]
> +                :owner => 'service',
> +                :group => 'service'
>             }
>         )
>
> -- 
> 1.6.4
>
>
> >


-- 
I had a linguistics professor who said that it's man's ability to use
language that makes him the dominant species on the planet. That may
be. But I think there's one other thing that separates us from animals.
We aren't afraid of vacuum cleaners. --Jeff Stilson
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


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

Reply via email to