salt icon indicating copy to clipboard operation
salt copied to clipboard

state pkg.removed do not work on windows minion

Open Grokzen opened this issue 13 years ago • 4 comments

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

Grokzen avatar Apr 14 '13 20:04 Grokzen

Thanks for the report and the details!

UtahDave avatar Apr 16 '13 16:04 UtahDave

oh forgot to mention the release it was tested on, 0.14.0 on both master and minion :]

Grokzen avatar Apr 16 '13 18:04 Grokzen

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.

UtahDave avatar Apr 22 '13 23:04 UtahDave

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

emmellee avatar Jan 23 '14 19:01 emmellee