diff options
author | Salim Alam <salam@chef.io> | 2016-04-07 14:50:13 -0700 |
---|---|---|
committer | Salim Alam <salam@chef.io> | 2016-04-07 14:50:13 -0700 |
commit | efc7e38ac32dd362029e65b57ae4825db4d15cb0 (patch) | |
tree | fc561ddeeaa2626d6c9c2ad1a65a4e088f78aea4 /lib/chef/provider/group.rb | |
parent | ffd053020a2f4d1e9212c05eecbdbd9b28e95acb (diff) | |
download | chef-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.rb | 7 |
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 |