summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Dibowitz <phil@ipom.com>2021-03-24 17:48:41 -0700
committerPhil Dibowitz <phil@ipom.com>2021-03-24 17:51:29 -0700
commit7b04a288d1d30f2b0ebd09d45cb139d1056da6be (patch)
treefc8f5fabb3e1b88ae78c43160476d36268e650d7
parentf9fbeaf7a3224f00d45d19bdb2801dddcb61dccf (diff)
downloadchef-7b04a288d1d30f2b0ebd09d45cb139d1056da6be.tar.gz
Fix windows_user password idempotency
If we're not trying to set a password - which given #10455 is probably the case - we will always think it's wrong and try to set it. This fixes that. Note it does *not* fix #10657 - do not close that one! Signed-off-by: Phil Dibowitz <phil@ipom.com>
-rw-r--r--lib/chef/provider/user/windows.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/user/windows.rb b/lib/chef/provider/user/windows.rb
index 32b2c35264..8cf4ea475b 100644
--- a/lib/chef/provider/user/windows.rb
+++ b/lib/chef/provider/user/windows.rb
@@ -62,7 +62,7 @@ class Chef
# <false>:: If the users are identical
def compare_user
@change_desc = []
- unless @net_user.validate_credentials(new_resource.password)
+ if new_resource.password && !@net_user.validate_credentials(new_resource.password)
@change_desc << "update password"
end