Skip to content
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

Handle Chocolatey's new Enhanced Exit Codes #52209

Merged
merged 2 commits into from Apr 12, 2019

Conversation

@twangboy
Copy link
Contributor

commented Mar 15, 2019

What does this PR do?

Chocolatey has started implementing Enhanced Exit Codes that will effect the stability of the Chocolatey module as future versions are released. This PR handles Enhanced Exit Code 2 added to the Chocolatey list function.

What issues does this PR fix or reference?

chocolatey/choco#1758

Tests written?

No

Commits signed with GPG?

Yes

@garethgreenaway

This comment has been minimized.

Copy link
Member

commented Mar 16, 2019

@twangboy unless this is a CVE, this should go into 2018.3 and we can merge forward.

@twangboy

This comment has been minimized.

Copy link
Contributor Author

commented Mar 21, 2019

@garethgreenaway You're right...

@twangboy twangboy force-pushed the twangboy:fix_choco_retcode branch from d7a85f8 to bfdc47b Mar 21, 2019
@twangboy twangboy requested a review from saltstack/team-core as a code owner Mar 21, 2019
@twangboy twangboy changed the base branch from 2017.7.9 to 2018.3 Mar 21, 2019
@waynew
waynew approved these changes Mar 21, 2019
Copy link
Contributor

left a comment

Not sure if we care to use https://pypi.org/project/enum34/ but I, for one, really like using the Enum class (or IntEnum) from Python 3.4+. It will be nice to have that available. Then we could have something like:

from enum import IntEnum

class ChoclateyExitCode(IntEnum):
    success = 0
    error = 1
    no_result = 2

    @property
    def failed(self):
        return self not in (ExitCode.success, ExitCode.no_result)


# And then used like
if ChoclateyErrorCode(result['retcode']).failed:
    raise CommandExecutionError(...)

There are a number of places having some slightly more user friendly status codes would be nice... but I can wait 🙂

@thatch45 thatch45 merged commit 262516c into saltstack:2018.3 Apr 12, 2019
10 checks passed
10 checks passed
WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint Python lint test has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Details
@twangboy twangboy deleted the twangboy:fix_choco_retcode branch Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.