diff options
-rw-r--r-- | kitchen-tests/cookbooks/end_to_end/recipes/windows.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/windows_security_policy.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb index e518aa522d..0065605ffd 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/windows.rb @@ -39,12 +39,12 @@ windows_security_policy "LockoutBadCount" do end windows_security_policy "LockoutDuration" do - secvalue "30" + secvalue "120" action :set end windows_security_policy "ResetLockoutCount" do - secvalue "15" + secvalue "90" action :set end diff --git a/lib/chef/resource/windows_security_policy.rb b/lib/chef/resource/windows_security_policy.rb index ad6c0b249e..5c683492a3 100644 --- a/lib/chef/resource/windows_security_policy.rb +++ b/lib/chef/resource/windows_security_policy.rb @@ -90,8 +90,8 @@ class Chef current_state = load_security_options if new_resource.secoption == "ResetLockoutCount" - if new_resource.secvalue.to_i > 30 - raise Chef::Exceptions::ValidationFailed, "The \"ResetLockoutCount\" value cannot be greater than 30 minutes" + if new_resource.secvalue.to_i > current_state["LockoutDuration"].to_i + raise Chef::Exceptions::ValidationFailed, "The \"ResetLockoutCount\" value cannot be greater than the value currently set for \"LockoutDuration\"" end end if (new_resource.secoption == "ResetLockoutCount" || new_resource.secoption == "LockoutDuration") && current_state["LockoutBadCount"] == "0" |