state pkg.removed do not work on windows minion
I am messing around with a windows repo and so far i got pkg.installed to work proper and applications install and i can remove them via the pkg.remove module but i am not able to use the pkg.removed state on a windows minion target. It just outputs as follow
----------
State: - pkg
Name: chrome
Function: removed
Result: True
Comment: Package chrome is not installed
Changes:
But when i try to uninstall it via "salt win2k8 pkg.remove chrome" it runs the uninstaller and the application is removed as expected.
After some digging in the code the problem comes from https://github.com/saltstack/salt/blob/develop/salt/states/pkg.py#L626 and i think the problem is that the module call done at https://github.com/saltstack/salt/blob/develop/salt/modules/win_pkg.py#L133 do not return the proper data because i can see all my packages when i run the module pkg.list_pkgs
Thanks for the report and the details!
oh forgot to mention the release it was tested on, 0.14.0 on both master and minion :]
Hm. Ok, so this is another issue where we use the pkg shortname and Windows returns the full package name when we query the system. Still working on a long term fix here.
I've opened Issue #9929 regarding this since this ticket is closed.
But I'm unable to use pkg.removed from within a state file.
C:\salt>salt --versions-report
Salt: 0.17.2
Python: 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Inte
l)]
Jinja2: 2.7.1
M2Crypto: 0.21.1
msgpack-python: 0.3.0
msgpack-pure: Not Installed
pycrypto: 2.6
PyYAML: 3.10
PyZMQ: 13.1.0
ZMQ: 3.2.2