Hi
I'm trying to build a simple state module around nssm, but I'm running into a problem where any output on stdout gets interpolated with lots of whitespace.
For a service named "myService" running an executable "myService.exe" installed in a python virtualenv at "C:\env\service", I see the following when running a query through Salt
PS C:\Users\blaffoy> salt-call cmd.run "C:\\env\\service\\Scripts\\nssm.exe get myService application"
[INFO ] Executing command 'C:\\\\env\\\\service\\\\Scripts\\\\nssm.exe get myService application' in directory 'C:\\Users\\blaffoy'
INFO ] output: / e n v / s e r v i c e / S c r i p t s / m y S e r v i c e . e x e
local:
/ e n v / s e r v i c e / S c r i p t s / m y S e r v i c e . e x e
Where I expect to see output as I get on the command line:
PS C:\Users\blaffoy> C:\env\service\Scripts\nssm.exe get myService application
/env/service/Scripts/myService.exe
Does anybody have any ideas about why this might be happening?
Other command line output from Windows on Salt looks normal. I tried setting the shell=powershell and shell=cmd, but from looking the salt/modules/cmdmod.py, I don't think this has any effect in Windows. Also, if I make a call to this same command line in a Python shell using subprocess.Popen, the output appears correct. From reading salt/utils/timed_subprocess.py, Salt uses subprocess.Popen to implement cmd.run. I don't see anywhere in the call chain where the values might be modified.
I'm running different versions for the salt-minion and salt-master. Could this be the source of the problem? Unfortunately, I'm tied to an older version of salt on Windows due to the bug outlined here (
https://github.com/saltstack/salt/issues/8405), but I make use of some of the newer features of salt on Ubuntu machines.
Versions Reports:
Minion:
PS C:\Users\blaffoy-admin> salt-call.exe --versions-report
Salt: 2014.1.13
Python: 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]
Jinja2: 2.7.1
M2Crypto: 0.21.1
msgpack-python: 0.4.2
msgpack-pure: Not Installed
pycrypto: 2.6
PyYAML: 3.11
PyZMQ: 14.1.1
ZMQ: 4.0.4
Master:
blaffoy@lon-cfp-dev-002:~$ salt-call --versions-report
Salt: 2014.7.1
Python: 2.7.6 (default, Mar 22 2014, 22:59:56)
Jinja2: 2.7.3
M2Crypto: 0.22
msgpack-python: 0.4.5
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.11
ioflo: Not Installed
PyZMQ: 14.4.1
RAET: Not Installed
ZMQ: 4.0.4
Mako: 0.9.1
Any input appreciated
Barry