diff options
Diffstat (limited to 'lib/chef/provider/group')
-rw-r--r-- | lib/chef/provider/group/groupadd.rb | 5 | ||||
-rw-r--r-- | lib/chef/provider/group/usermod.rb | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/chef/provider/group/groupadd.rb b/lib/chef/provider/group/groupadd.rb index eb1972d96e..cb480aab54 100644 --- a/lib/chef/provider/group/groupadd.rb +++ b/lib/chef/provider/group/groupadd.rb @@ -65,7 +65,7 @@ class Chef end def modify_group_members - if(@new_resource.append) + if @new_resource.append if @new_resource.members && !@new_resource.members.empty? members_to_be_added = [ ] @new_resource.members.each do |member| @@ -89,7 +89,8 @@ class Chef end end else - Chef::Log.debug("#{@new_resource} setting group members to: #{@new_resource.members.join(", ")}") + members_description = @new_resource.members.empty? ? "none" : @new_resource.members.join(", ") + Chef::Log.debug("#{@new_resource} setting group members to: #{members_description}") set_members(@new_resource.members) end end diff --git a/lib/chef/provider/group/usermod.rb b/lib/chef/provider/group/usermod.rb index 4863c6ee4a..ca035d0fc8 100644 --- a/lib/chef/provider/group/usermod.rb +++ b/lib/chef/provider/group/usermod.rb @@ -17,12 +17,15 @@ # require 'chef/provider/group/groupadd' +require 'chef/mixin/shell_out' class Chef class Provider class Group class Usermod < Chef::Provider::Group::Groupadd + include Chef::Mixin::ShellOut + def load_current_resource super end @@ -44,7 +47,7 @@ class Chef requirements.assert(:all_actions) do |a| a.assertion { @new_resource.excluded_members.empty? } - a.failure_message Chef::Exceptions::Group "excluded_members is not supported by #{self.to_s}" + a.failure_message Chef::Exceptions::Group, "excluded_members is not supported by #{self.to_s}" # No whyrun alternative - this action is simply not supported. end end |