summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/type/nameservice/netinfo.rb5
-rwxr-xr-xlib/puppet/type/pfile/ensure.rb18
-rwxr-xr-xtest/other/config.rb6
-rw-r--r--test/puppettest.rb7
4 files changed, 29 insertions, 7 deletions
diff --git a/lib/puppet/type/nameservice/netinfo.rb b/lib/puppet/type/nameservice/netinfo.rb
index d7d11c6d3..f0da5294a 100644
--- a/lib/puppet/type/nameservice/netinfo.rb
+++ b/lib/puppet/type/nameservice/netinfo.rb
@@ -144,7 +144,6 @@ module Puppet
# This is really lame. We have to iterate over each
# of the groups and add us to them.
def setgrouplist(groups)
- self.warning "Setting groups to %s" % groups.inspect
# Get just the groups we need to modify
diff = groups - @is
@@ -169,14 +168,10 @@ module Puppet
next
elsif members.include? user
# I'm in the group and shouldn't be
- self.warning "Removing %s from %s" %
- [user, name]
setuserlist(name, members - [user])
elsif groups.include? name
# I'm not in the group and should be
setuserlist(name, members + [user])
- self.warning "Adding %s to %s" %
- [user, name]
else
# I'm not in the group and shouldn't be
next
diff --git a/lib/puppet/type/pfile/ensure.rb b/lib/puppet/type/pfile/ensure.rb
index 4287c9382..8a653e93b 100755
--- a/lib/puppet/type/pfile/ensure.rb
+++ b/lib/puppet/type/pfile/ensure.rb
@@ -131,6 +131,24 @@ module Puppet
end
end
end
+
+ def sync
+ event = super
+
+ # There are some cases where all of the work does not get done on
+ # file creation, so we have to do some extra checking.
+ @parent.each do |thing|
+ next unless thing.is_a? Puppet::State
+ next if thing == self
+
+ thing.retrieve
+ unless thing.insync?
+ thing.sync
+ end
+ end
+
+ return event
+ end
end
end
diff --git a/test/other/config.rb b/test/other/config.rb
index 23c0e2725..a101bcd16 100755
--- a/test/other/config.rb
+++ b/test/other/config.rb
@@ -546,7 +546,8 @@ yay = /a/path
assert_equal(mode, filemode(path), "Modes are not equal")
- if Process.uid == 0
+ # OS X is broken in how it chgrps files
+ if Process.uid == 0 and Facter["operatingsystem"].value != "Darwin"
assert_equal(user.uid, File.stat(path).uid, "UIDS are not equal")
assert_equal(group.gid, File.stat(path).gid, "GIDS are not equal")
end
@@ -576,7 +577,8 @@ yay = /a/path
assert_equal(mode, filemode(path), "Modes are not equal")
- if Process.uid == 0
+ # OS X is broken in how it chgrps files
+ if Process.uid == 0 and Facter["operatingsystem"].value != "Darwin"
assert_equal(user.uid, File.stat(path).uid, "UIDS are not equal")
assert_equal(group.gid, File.stat(path).gid, "GIDS are not equal")
end
diff --git a/test/puppettest.rb b/test/puppettest.rb
index bcc51cb8a..cb3606e61 100644
--- a/test/puppettest.rb
+++ b/test/puppettest.rb
@@ -34,6 +34,13 @@ module TestPuppet
self.class.to_s + "configdir" + @@testcount.to_s + "/"
)
+ unless defined? $user and $group
+ $user = nonrootuser().uid.to_s
+ $group = nonrootgroup().gid.to_s
+ end
+ Puppet[:user] = $user
+ Puppet[:group] = $group
+
Puppet[:confdir] = @configpath
Puppet[:vardir] = @configpath