diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-29 19:01:05 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-09-29 19:01:05 +0000 |
commit | 8214c485816bc852ee33636494b4fd447629961f (patch) | |
tree | 0c69412bf59906b08ae6bf027922a63946f4c5d2 /lib/puppet/suidmanager.rb | |
parent | de304e50c085aaaba246862de45163cedf0f617f (diff) | |
download | puppet-8214c485816bc852ee33636494b4fd447629961f.tar.gz puppet-8214c485816bc852ee33636494b4fd447629961f.tar.xz puppet-8214c485816bc852ee33636494b4fd447629961f.zip |
Fixing suidmanager so it uses warnonce instead of using a variable that only existed in Util
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1705 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/suidmanager.rb')
-rw-r--r-- | lib/puppet/suidmanager.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/puppet/suidmanager.rb b/lib/puppet/suidmanager.rb index 4d00f59b0..d6bbc90f1 100644 --- a/lib/puppet/suidmanager.rb +++ b/lib/puppet/suidmanager.rb @@ -1,7 +1,10 @@ require 'facter' +require 'puppet/util/warnings' module Puppet module SUIDManager + include Puppet::Util::Warnings + platform = Facter["kernel"].value [:uid=, :gid=, :uid, :gid].each do |method| define_method(method) do |*args| @@ -9,10 +12,7 @@ module Puppet newmethod = method if platform == "Darwin" - if !@darwinwarned - Puppet.warning "Cannot change real UID on Darwin" - @darwinwarned = true - end + warnonce "Cannot change real UID on Darwin" newmethod = ("e" + method.to_s).intern end @@ -36,10 +36,7 @@ module Puppet # NOTE: this would be much better facilitated with a specialized popen() # (see the test suite for more details.) if (Facter['rubyversion'].value <=> "1.8.4") < 0 - unless @@alreadywarned - Puppet.warning "Cannot capture STDERR when running as another user on Ruby < 1.8.4" - @@alreadywarned = true - end + warnonce "Cannot capture STDERR when running as another user on Ruby < 1.8.4" output = %x{#{command}} else output = %x{#{command} 2>&1} |