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

Fix smtp ret require gnupg #38937

Merged
merged 4 commits into from
Jan 26, 2017
Merged

Fix smtp ret require gnupg #38937

merged 4 commits into from
Jan 26, 2017

Conversation

arthru
Copy link
Contributor

@arthru arthru commented Jan 25, 2017

What does this PR do?

This PR makes smtp returner be independant from gnupg installation

What issues does this PR fix or reference?

Can't find an issue for that. I encountered the problem myself.

Previous Behavior

Smtp returner could not be used if gnupg python module is not installed

New Behavior

Smtp returner could be used without gnupg. If gpgowner is set and gnupg is not installed, an error is shown.

Tests written?

No

@arthru
Copy link
Contributor Author

arthru commented Jan 25, 2017

It looks like CI is broken (at least, fails are not due to my code)

Copy link
Contributor

@cachedout cachedout left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending this @arthru

I agree with you that gnupg shouldn't be required simply to use the smtp returner but I'm not sure this is the best way to go about this.

The basic problem is that all bare exceptions are silently caught by the functions which call the returner and so if we raise one in this way, we're effectively just breaking gnupg for people who want to use it but don't have the right deps installed. We need to at least give them a warning. :]

So, we have a couple of options. We can change things so that the exceptions that are raised by returners are caught, logged and displayed to the user. Or, we can log an error where you're now logging the exception and use that to inform the user, or we could even do both.

Either way, I'll accept this PR as soon as it properly informs the user that the required deps are not available if they try to use gnupg. Thanks!

@arthru
Copy link
Contributor Author

arthru commented Jan 26, 2017

I just updated the merge request in order to log an error instead of raising an exception.

Needed for lint check
@cachedout cachedout merged commit 0660cc3 into saltstack:2016.11 Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants