Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix pkg.install when pkg already installed #48932
What does this PR do?
Fixes an issue with pkg.install on Windows where the
Adds tests to test valid output.
What issues does this PR fix or reference?
Commits signed with GPG?
If pkg.install or pkg.remove end up not making any changes to the target system they return an empty dict indicating no changes. This is the salt standard for pkg.install and pkg.remove is to return differences in the packages and their version. Current release of 2016.11, 2017 and 2018 behaviour this way.
The PR will move win_pkg away from that standard, cause states/pkg.py to get data it would not normal expect. i.e.
This PR will change the output to
Instead of standard empty dict for no changes in software or version
Which will result in output like
The return results from pkg.install and pkg.remove and other functions used by states/pkg.py need to match the other pkg modules. (ignoring package name differences between platforms)
@damon-atkins I have modified the PR to return an empty dict when there are no changes. I have also added tests to ensure correct returns in those scenarios. Thank you for educating me on proper salt behavior in regards to the pkg modules. Elsewhere in salt, execution module outputs are not standardized, by design apparently (I asked around). But in the case of the pkg system, there is some standardization. Thanks for keeping me straight.