summaryrefslogtreecommitdiff
path: root/lib/chef/provider/group.rb
diff options
context:
space:
mode:
authorSalim Alam <salam@chef.io>2016-04-07 14:50:13 -0700
committerSalim Alam <salam@chef.io>2016-04-07 14:50:13 -0700
commitefc7e38ac32dd362029e65b57ae4825db4d15cb0 (patch)
treefc561ddeeaa2626d6c9c2ad1a65a4e088f78aea4 /lib/chef/provider/group.rb
parentffd053020a2f4d1e9212c05eecbdbd9b28e95acb (diff)
downloadchef-efc7e38ac32dd362029e65b57ae4825db4d15cb0.tar.gz
Don't fail when removing non-existing group member
Diffstat (limited to 'lib/chef/provider/group.rb')
-rw-r--r--lib/chef/provider/group.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chef/provider/group.rb b/lib/chef/provider/group.rb
index fcae24f8f9..8936bd2031 100644
--- a/lib/chef/provider/group.rb
+++ b/lib/chef/provider/group.rb
@@ -94,6 +94,7 @@ class Chef
missing_members = []
@new_resource.members.each do |member|
next if has_current_group_member?(member)
+ validate_member!(member)
missing_members << member
end
if missing_members.length > 0
@@ -122,6 +123,12 @@ class Chef
@current_resource.members.include?(member)
end
+ def validate_member!(member)
+ # Sub-classes can do any validation if needed
+ # and raise an error if validation fails
+ true
+ end
+
def action_create
case @group_exists
when false