summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/provider/group/solaris.rb20
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/chef/provider/group/solaris.rb b/lib/chef/provider/group/solaris.rb
index f5df203b78..4d913fba30 100644
--- a/lib/chef/provider/group/solaris.rb
+++ b/lib/chef/provider/group/solaris.rb
@@ -35,28 +35,16 @@ class Chef
super
requirements.assert(:all_actions) do |a|
- a.assertion { ::File.exist?("/usr/sbin/usermod") }
- a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/sbin/usermod for #{new_resource}"
+ a.assertion { ::File.exist?("/usr/sbin/usermod") && ::File.exist?("/usr/sbin/groupmod") }
+ a.failure_message Chef::Exceptions::Group, "Could not find binary /usr/sbin/usermod or /usr/sbin/groupmod for #{new_resource}"
# No whyrun alternative: this component should be available in the base install of any given system that uses it
end
-
- requirements.assert(:modify, :manage) do |a|
- a.assertion { (new_resource.members.empty? && new_resource.excluded_members.empty?) || new_resource.append }
- a.failure_message Chef::Exceptions::Group, "setting group members directly is not supported by #{self}, must set append true in group"
- # No whyrun alternative - this action is simply not supported.
- end
end
def set_members(members)
+ # Set the group to have exactly the list of members passed to it.
unless members.empty?
- members.each do |member|
- add_member(member)
- end
- end
- unless excluded_members.empty?
- excluded_members.each do |excluded_member|
- remove_member(excluded_member)
- end
+ shell_out!("groupmod", "-U", members.join(","), new_resource.group_name)
end
end