diff options
author | Serdar Sutay <serdar@opscode.com> | 2014-09-04 18:01:07 +0300 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2014-09-04 18:01:07 +0300 |
commit | c034791b1579be480d565af0c2442849772dce02 (patch) | |
tree | 33e1162276d71b34767f2121f14d195b88e1edd5 /lib/chef/provider/user/dscl.rb | |
parent | e021ff01a92180099abe2bfbb0a89f821d8f96e5 (diff) | |
download | chef-c034791b1579be480d565af0c2442849772dce02.tar.gz |
Updates based on @jaymzh's comments.
Diffstat (limited to 'lib/chef/provider/user/dscl.rb')
-rw-r--r-- | lib/chef/provider/user/dscl.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb index 19829cff20..a24a047596 100644 --- a/lib/chef/provider/user/dscl.rb +++ b/lib/chef/provider/user/dscl.rb @@ -343,9 +343,11 @@ user password using shadow hash.") command.run_command if @user_info.nil? - # User is just created. Flush the dscl cache for changes to be persisted. + # User is just created. read_user_info() will read the fresh information + # for the user with a cache flush. However with experimentation we've seen + # that dscl cache is not immediately updated after the creation of the user + # This is odd and needs to be investigated further. sleep 3 - shell_out("dscacheutil '-flushcache'") @user_info = read_user_info end @@ -552,6 +554,8 @@ user password using shadow hash.") def read_user_info user_info = nil + # We flush the cache here in order to make sure that we read fresh information + # for the user. shell_out("dscacheutil '-flushcache'") begin |