Skip to content

Commit 170b0d5

Browse files
authored
Merge pull request #490 from puppetlabs/MODULES-11458-revert-deferred-function
(MODULES-11458) Revert deferred function
2 parents 3a43382 + d570416 commit 170b0d5

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

lib/puppet/functions/user_password.rb

-12
This file was deleted.

manifests/user.pp

+5-4
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@
281281
}
282282
)
283283
}
284+
$_password = (($password =~ String and $password == '') and $ignore_password_if_empty) ? {
285+
true => undef,
286+
default => $password,
287+
}
284288
$_purge_sshkeys = ($purge_sshkeys and $sshkey_custom_path != undef) ? {
285289
true => [String($sshkey_custom_path)],
286290
default => $purge_sshkeys,
@@ -301,10 +305,7 @@
301305
iterations => $iterations,
302306
managehome => $managehome,
303307
membership => $membership,
304-
password => (($password =~ String and $password == '') and $ignore_password_if_empty) ? {
305-
true => undef,
306-
default => Deferred('user_password', [$password]),
307-
},
308+
password => $_password,
308309
password_max_age => $password_max_age,
309310
purge_ssh_keys => $_purge_sshkeys,
310311
salt => $salt,

spec/acceptance/user_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@
386386
apply_manifest(pp_user_with_sensitive_password, catch_failures: true)
387387

388388
expect(user('sensitive_user')).to exist
389-
expect(user('sensitive_user').encrypted_password).not_to be_empty
389+
expect(user('sensitive_user')).to contain_password 'bar'
390390
end
391391
end
392392
end

0 commit comments

Comments
 (0)