summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2016-03-16 11:57:47 +0000
committerThom May <thom@may.lt>2016-03-16 11:57:47 +0000
commit1ec54c1c3577e3a74e8b2ae7e4354894eb60c772 (patch)
treef306e8c09d955949fbf7a6cb61ddbf93b32115df
parent3174ec22b6987629a9f392ef9459ca8c0988d756 (diff)
parent603f8ea366302964dff4d439501065d99a7ff2fa (diff)
downloadchef-1ec54c1c3577e3a74e8b2ae7e4354894eb60c772.tar.gz
Merge pull request #4701 from mawinter69/master
fix for https://github.com/chef/chef/issues/4689
-rw-r--r--lib/chef/provider/group/suse.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/chef/provider/group/suse.rb b/lib/chef/provider/group/suse.rb
index f6f4fa1e11..a79038e25e 100644
--- a/lib/chef/provider/group/suse.rb
+++ b/lib/chef/provider/group/suse.rb
@@ -39,12 +39,14 @@ class Chef
end
def set_members(members)
- unless @current_resource.members.empty?
- shell_out!("groupmod -R #{@current_resource.members.join(',')} #{@new_resource.group_name}")
+ to_delete = @current_resource.members - members
+ to_delete.each do |member|
+ remove_member(member)
end
- unless members.empty?
- shell_out!("groupmod -A #{members.join(',')} #{@new_resource.group_name}")
+ to_add = members - @current_resource.members
+ to_add.each do |member|
+ add_member(member)
end
end