File state broken on Windows
State: - file
Name: c:\test
Function: recurse
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "salt/state.py", line 1215, in call
File "salt/states/file.py", line 1295, in recurse
File "salt/states/file.py", line 1249, in manage_directory
File "salt/states/file.py", line 935, in directory
File "salt/modules/file.py", line 1244, in check_perms
NameError: global name '__salt__' is not defined
Dang, I thought we had these all ironed out for windows.
Is this on 0.15.0, @Sacro? Is this the 32bit windows minion? Which OS?
0.15.0, Windows 7 32 bit. Also fails the same on 64 bit.
Still broken on 1.15.1
However the cp module works fine, not sure if that helps debug?
OK, I figured out what's going on here. It has to do with how win_file.py is importing functions from file.py
Working on a fix.
Seems to have reappeared on Windows 7 with version 0.16.3 when trying to apply a small test state 'motd' (C:\MOTD directory already exists):
salt master is a linux box, salt minion is win 7
salt '*' state.highstate test=True machine-name-redacted: State: - file Name: c:\motd\motd Function: managed Result: False Comment: An exception occurred in this state: Traceback (most recent call last): File "salt/state.py", line 1237, in call File "salt/states/file.py", line 828, in managed File "salt/modules/file.py", line 1397, in check_managed File "salt/modules/file.py", line 1187, in get_managed NameError: global name 'salt' is not defined
@smithjm I've created a new issue with the content of your above comment. I'd like to track it there, rather than continuing this old thread.
https://github.com/saltstack/salt/issues/6697
Thanks!