here is a change that enabled sentry entries to be sent when there is output in the stderr but exit code is still 0 #28
Open
rogersprint wants to merge 2 commits intoYipit:masterfrom
Open
here is a change that enabled sentry entries to be sent when there is output in the stderr but exit code is still 0 #28rogersprint wants to merge 2 commits intoYipit:masterfrom
rogersprint wants to merge 2 commits intoYipit:masterfrom
Conversation
|
This seems like it could be useful, and also would not impact preexisting Cron-Sentry installations. |
hltbra
suggested changes
Nov 25, 2019
| with TemporaryFile() as stderr: | ||
| try: | ||
| exit_status = call(self.command, stdout=stdout, stderr=stderr) | ||
| last_lines_stdout = self._get_last_lines(stdout) |
There was a problem hiding this comment.
any reason to move the last_lines_stdout and last_lines_stderr lines to inside the try, @rogersprint? The reason they were outside originally is that only call() should be raising CommandNotFoundError.
|
|
||
| if exit_status != 0: | ||
| self.level = logging.ERROR | ||
| self.report(exit_status, last_lines_stdout, last_lines_stderr, elapsed) |
There was a problem hiding this comment.
won't this report twice if it exits with anything but 0 and has stderr because there's no return exit_status in this if block?
| "last_lines_stdout": expected_stdout, | ||
| "last_lines_stderr": expected_stderr, | ||
| }) | ||
| 'command':mock.ANY, |
There was a problem hiding this comment.
Could you revert all stylistic changes, please? they are not related to the pull request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.