salt icon indicating copy to clipboard operation
salt copied to clipboard

minionfs salt:// with windows paths not working.

Open Lomexian opened this issue 10 years ago • 3 comments

Description of Issue

When using a windows based minion and following the tutorial for minionfs (https://docs.saltstack.com/en/latest/topics/tutorials/minionfs.html) cp.push works fine and uploads files to (by default) /var/cache/salt/master/minions//files/ File gets created under a path mirroring the source i.e c:/temp/file.txt When using cp.get_file trying to use salt:///c:/temp/file.txt fails to find any file to get.

Attempting to escape the colon with \ also fails (i.e salt://minion/c:/temp/file.txt) Removing the colon from the c: folder by renaming the folder then allows the fs call (i.e salt://minion/c/temp/file.txt) so minionfs is working fine.

Setup

A windows minion and saltmaster

Steps to Reproduce Issue

create file c:\temp\test.txt on windows minion on master: salt 'minion' cp.push c:\temp\test.txt salt 'minion' cp.getfile salt://minion/c:/temp/test.txt c:\temp\test2.txt

Versions Report

Salt Version: Salt: 2016.3.1

Dependency Versions: cffi: Not Installed cherrypy: 3.6.0 dateutil: Not Installed gitdb: 0.5.4 gitpython: 0.3.2 RC1 ioflo: Not Installed Jinja2: 2.2.1 libgit2: Not Installed libnacl: Not Installed M2Crypto: 0.20.2 Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pygit2: Not Installed Python: 2.6.6 (r266:84292, Jul 23 2015, 15:22:56) python-gnupg: Not Installed PyYAML: 3.10 PyZMQ: 14.3.1 RAET: Not Installed smmap: 0.8.1 timelib: Not Installed Tornado: 4.2.1 ZMQ: 3.2.5

System Versions: dist: centos 6.7 Final machine: x86_64 release: 2.6.32-573.26.1.el6.x86_64 system: Linux version: CentOS 6.7 Final

Lomexian avatar Aug 23 '16 11:08 Lomexian

workaround is to use the upload_path argument of cp.push to write it as a linux path, or at least without a windows drive letter syntax e.g: salt 'minion' cp.push c:\temp\test.txt upload_path='temp\test.txt' salt 'minion' cp.getfile salt://minion/temp/test.txt c:\temp\test2.txt

Lomexian avatar Aug 23 '16 14:08 Lomexian

@Lomexian I am able to replicate this behavior on windows 2012 as shown with my test case below:

Proof that the file was copied properly to the master from windows:

[ch3ll@thecakeisalie salt]$ sudo salt-run fileserver.file_list | grep -i win2
- win2012/c:/temp/test.txt

and attempting to run the command:

[ch3ll@thecakeisalie salt]$ sudo salt 'win*' cp.get_file salt://win2012/c:/temp/test.txt c:\temp\test_blah.txt
win2012:
[ch3ll@thecakeisalie salt]$ sudo salt 'win*' cmd.run 'dir c:\temp\'
win2012:
     Volume in drive C has no label.
     Volume Serial Number is 20A1-1419

     Directory of c:\temp

    01/25/2016  04:14 PM    <DIR>          .
    01/25/2016  04:14 PM    <DIR>          ..
    01/25/2016  04:13 PM    <DIR>          New folder
    01/25/2016  04:14 PM                12 test.txt
                   1 File(s)             12 bytes
                   3 Dir(s)  30,089,637,888 bytes free
[ch3ll@thecakeisalie salt]$ 

It does not get copied to the windows minion. I believe this is related to #35296 and seems to be the same behavior where there are issues with the c:. thanks we will need to get this fixed up

Ch3LL avatar Aug 24 '16 16:08 Ch3LL

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] avatar Jun 25 '18 15:06 stale[bot]