summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-08-17 11:19:43 -0500
committerJay Mundrawala <jdmundrawala@gmail.com>2015-08-17 11:19:43 -0500
commitc06e88fee3ab99b728bda3f9018a12e1dfde7289 (patch)
treeb8ff374b1f7b7918b1b81bf3365a49666eec2263
parentbacb2ff93ccc2e14a0b721988e241a1d07f70795 (diff)
downloadchef-jdm/freebsd-pw-fix.tar.gz
Don't modify members of new_resource in pw group implmentationjdm/freebsd-pw-fix
This was causing the ``` Chef::Resource::Group group modify action when there is a group behaves like correct group management when the users exist when append is not set when group already contains some users should remove all existing users and only add the new users to the group ``` spec to fail. The test passes an array which gets modified which breaks the test.
-rw-r--r--lib/chef/provider/group/pw.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/group/pw.rb b/lib/chef/provider/group/pw.rb
index f877ed2424..5b5c8136f1 100644
--- a/lib/chef/provider/group/pw.rb
+++ b/lib/chef/provider/group/pw.rb
@@ -109,7 +109,7 @@ class Chef
else
# Append is not set so we're resetting the membership of
# the group to the given members.
- members_to_be_added = @new_resource.members
+ members_to_be_added = @new_resource.members.dup
@current_resource.members.each do |member|
# No need to re-add a member if it's present in the new
# list of members