Open darkpixel opened 2 weeks ago
It looks like it's hitting the issue when trying to calculate changes to the file object here: https://github.com/saltstack/salt/blob/master/salt/states/file.py#L849
I'm wondering if https://github.com/saltstack/salt/blob/master/salt/states/file.py#L846 is an inverted if.
The only places _check_directory_win
are called from (in the file.py
state) are file.directory
, file.append
, and file.prepend
.
I guess I'll have to check if file.append
and file.prepend
are turning correctly or if they are spitting out changes:
{name: {"directory": "new"}}
I see what's going on. It's not inverted. If the directory doesn't exist, it just lets you know it's a new directory. If it already exists, it calculates the changes between the existing directory and the state and that's where it fails to find ownership information because the domain is unavailable.
Probably need to wrap it in a try/except for cases when the domain is unavailable.
Description I think this is related to an old bug--either the
file.directory
code wasn't updated asfile.managed
orreg.present
was in bug #51868 , or maybe something got missed in merging.To reproduce: Join a Windows machine (i.e. a laptop) to a domain. Move the machine off the network (i.e. work from home for a day) or make it so it can no longer talk to the domain controller. Apply a state using
file.directory
:Get a traceback:
Windows Minion is 3007.1, and I believe this was probably occurring with older versions, I just wasn't calling
file.directory
on Windows in older versions.