From 841b973d59382192058d05f7a5d46c8e1ea1a875 Mon Sep 17 00:00:00 2001 From: cmluciano Date: Fri, 20 Mar 2015 16:19:04 -0400 Subject: Fix condition of removing a group before user error. This should fix [issue 1586](https://github.com/chef/chef/issues/1586). The issue is that if a group is removed before the user, the GID remained and causes an error. This should remove the check for remove actions. --- lib/chef/provider/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/chef/provider') diff --git a/lib/chef/provider/user.rb b/lib/chef/provider/user.rb index f6ac72448e..de261105b3 100644 --- a/lib/chef/provider/user.rb +++ b/lib/chef/provider/user.rb @@ -90,7 +90,7 @@ class Chef end def define_resource_requirements - requirements.assert(:all_actions) do |a| + requirements.assert(:create, :modify, :manage, :lock, :unlock) do |a| a.assertion { @group_name_resolved } a.failure_message Chef::Exceptions::User, "Couldn't lookup integer GID for group name #{@new_resource.gid}" a.whyrun "group name #{@new_resource.gid} does not exist. This will cause group assignment to fail. Assuming this group will have been created previously." -- cgit v1.2.1