opscode/chef — pull request #1929 by jaymzh (2014-08-27 03:56:40+00:00)
Title: Fix dscl_user resource [Chef 10]

tl;dr We are mis-handling the way dscl cache works.

We were getting the case where we would create a user, they'd end
up with the wrong shell, and then the next run would update it.

It turns out because the recent Provider::User::Dscl refactor has a bug in
that we use 'dscl' to set most things (which is good), but then before flushing
the cache, we read the object directly out of the (now-stale) plist file.

We then flush the changes to disk, but immediately overwrite them. Whoops!

This flushes the cache before we read restoring proper behavior and dropping
an unnecessary sleep