salt icon indicating copy to clipboard operation
salt copied to clipboard

File state broken on Windows

Open Sacro opened this issue 13 years ago • 7 comments

        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

Sacro avatar May 07 '13 10:05 Sacro

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?

UtahDave avatar May 07 '13 14:05 UtahDave

0.15.0, Windows 7 32 bit. Also fails the same on 64 bit.

Sacro avatar May 07 '13 15:05 Sacro

Still broken on 1.15.1

Sacro avatar May 13 '13 12:05 Sacro

However the cp module works fine, not sure if that helps debug?

Sacro avatar May 13 '13 12:05 Sacro

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.

UtahDave avatar May 14 '13 22:05 UtahDave

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 avatar Aug 14 '13 15:08 smithjm

@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!

UtahDave avatar Aug 14 '13 16:08 UtahDave