diff options
author | Luke Kanies <luke@madstop.com> | 2009-10-26 22:54:38 -0700 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-10-27 16:59:12 +1100 |
commit | 20e5222de71f68780063d774e83fd1debe64ba86 (patch) | |
tree | 9a6e69dabe9e2ce34d7a49687bb2cdf232aa6b00 /lib/puppet | |
parent | 09fb3f707dfce31a11eda2f35bd77e65c911c15f (diff) | |
download | puppet-20e5222de71f68780063d774e83fd1debe64ba86.tar.gz puppet-20e5222de71f68780063d774e83fd1debe64ba86.tar.xz puppet-20e5222de71f68780063d774e83fd1debe64ba86.zip |
Fixing #2689 - file owner warnings are reduced
We now only warn when there's an actual change to make,
and we only make one warning per process run.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rwxr-xr-x | lib/puppet/type/file/owner.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/puppet/type/file/owner.rb b/lib/puppet/type/file/owner.rb index 1dff59cb3..e5ca06a86 100755 --- a/lib/puppet/type/file/owner.rb +++ b/lib/puppet/type/file/owner.rb @@ -28,10 +28,7 @@ module Puppet end def insync?(current) - unless Puppet::Util::SUIDManager.uid == 0 - warning "Cannot manage ownership unless running as root" - return true - end + return true unless should @should.each do |value| if value =~ /^\d+$/ @@ -44,6 +41,12 @@ module Puppet return true if uid == current end + + unless Puppet::Util::SUIDManager.uid == 0 + warnonce "Cannot manage ownership unless running as root" + return true + end + return false end |