summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcmluciano <cmlucian@us.ibm.com>2015-03-20 16:19:04 -0400
committercmluciano <cmlucian@us.ibm.com>2015-04-30 14:08:51 -0400
commit841b973d59382192058d05f7a5d46c8e1ea1a875 (patch)
treefaaf270c13eca632f70c70391715031138c041bb
parent77e32218bcec1a6b0934d826919b8e1ba0b6dbc0 (diff)
downloadchef-841b973d59382192058d05f7a5d46c8e1ea1a875.tar.gz
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.
-rw-r--r--lib/chef/provider/user.rb2
-rw-r--r--spec/unit/http_spec.rb2
2 files changed, 2 insertions, 2 deletions
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."
diff --git a/spec/unit/http_spec.rb b/spec/unit/http_spec.rb
index 4d851df951..a654d14aa2 100644
--- a/spec/unit/http_spec.rb
+++ b/spec/unit/http_spec.rb
@@ -89,4 +89,4 @@ describe Chef::HTTP do
end # head
-end
+end \ No newline at end of file