Skip to content

Commit

Permalink
Merge pull request #490 from puppetlabs/MODULES-11458-revert-deferred…
Browse files Browse the repository at this point in the history
…-function

(MODULES-11458) Revert deferred function
  • Loading branch information
Ramesh7 authored Aug 13, 2024
2 parents 3a43382 + d570416 commit 170b0d5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
12 changes: 0 additions & 12 deletions lib/puppet/functions/user_password.rb

This file was deleted.

9 changes: 5 additions & 4 deletions manifests/user.pp
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@
}
)
}
$_password = (($password =~ String and $password == '') and $ignore_password_if_empty) ? {
true => undef,
default => $password,
}
$_purge_sshkeys = ($purge_sshkeys and $sshkey_custom_path != undef) ? {
true => [String($sshkey_custom_path)],
default => $purge_sshkeys,
Expand All @@ -301,10 +305,7 @@
iterations => $iterations,
managehome => $managehome,
membership => $membership,
password => (($password =~ String and $password == '') and $ignore_password_if_empty) ? {
true => undef,
default => Deferred('user_password', [$password]),
},
password => $_password,
password_max_age => $password_max_age,
purge_ssh_keys => $_purge_sshkeys,
salt => $salt,
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
apply_manifest(pp_user_with_sensitive_password, catch_failures: true)

expect(user('sensitive_user')).to exist
expect(user('sensitive_user').encrypted_password).not_to be_empty
expect(user('sensitive_user')).to contain_password 'bar'
end
end
end

0 comments on commit 170b0d5

Please sign in to comment.