-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update windows pkg.[install|remove] error logic #33321
Conversation
@lorengordon Could you rebase this? It's getting some strange lint errors. |
Sure, that is definitely strange, considering I updated my fork from upstream this morning before I started working on this. Gimme a few min, adding similar retcode logic to pkg.remove... |
* Use `cmd.run_all` to capture the entire return dictionary. * Send `output_loglevel='quiet'` to `cmd.run_all` to suppress its outputting of errors on non-zero return codes. * Check the return code to determine whether the install failed. * Catch retcode == 3010 as a successful install that just requires a reboot. * Improve the error message when a package is not detected in the registry, particularly to mention packages that install as Windows updates. * Add a message to the return dictionary about successful vs failed installs. This helps minimize confusion where the package is not detected in the registry. Fixes saltstack#33298
@lorengordon The testing guy updated the tests a few hours ago |
@twangboy, right on. Rebased the branch, hopefully it is good now. |
@twangboy @lorengordon thanks for this, but error and return codes for msi installers (and other windows installers) are something that I think the pkg installer file should allow for specifically on a case by case basis. It is very common for windows installers as well as msi installers to return non zero exit codes. Most windows package managers I worked with sofar have had a 'flag' or 'parameter' that one can pass to the pkg manager to let it know which exit codes (they are really just exit codes not necessarily all 'error' codes per se) are valid and to be considered a success. and 3010 is just one of a number of common codes, that eman something in msi installs, but sort of hardcoding this into the pkg installer wholesale I think is not the right approach, it won't 'always' mean that for every piece of windows software. another installer might mean something else entirely with 3010. Just have a look at the wpkg or chocolatey or oneget/nuget or pdq deply 'recipes', this sort of 'hard-coding' of 3010 (maybe I misunderstand it?) looks good, but I don't think is safe or the right way to solve/overcome this. sorry for the rant. I am tired and about to go to bed, but wanted to get this out there before this, as good as it looks at first, makes it into the core of winrepo-ng. |
@TheBigBear, understood, this just a simple fix to address a bug in a point release. I thought about adding such a flag to the pkg definition, but adding features and flags is something that would go into develop first. I would recommend submitting your comment as an issue requesting a new feature. |
What does this PR do?
cmd.run_all
to capture the entire return dictionary.output_loglevel='quiet'
tocmd.run_all
when installing to suppress its outputting of errors on non-zero return codes.What issues does this PR fix or reference?
Fixes #33298
Tests written?
No