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 TypeError actionExecutor.py #99

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Conversation

aroelo
Copy link
Contributor

@aroelo aroelo commented Jun 7, 2023

We currently get this error when the script tries to get the histogram image, but can't find it.
Reason: Err: exit status 1, Stderr: Traceback (most recent call last): File "/home/opsgenie/oec/scripts/actionExecutor.py", line 418, in <module> main() File "/home/opsgenie/oec/scripts/actionExecutor.py", line 367, in main attach("service") File "/home/opsgenie/oec/scripts/actionExecutor.py", line 262, in attach alert_histogram = get_alert_histogram(entity) File "/home/opsgenie/oec/scripts/actionExecutor.py", line 116, in get_alert_histogram return get_image(url, entity) File "/home/opsgenie/oec/scripts/actionExecutor.py", line 108, in get_image response.status_code) + "Reason: " + content) TypeError: must be str, not bytes

The 'response.content' that is returned is in a binary format, which gives a TypeError when it tries to log/print the warning message that the image can not be found.

This PR fixes the TypeError by formatting the content to a string first.

Fix TypeError because response content is binary and not string
@ozlemmcokuk ozlemmcokuk merged commit 873ecb4 into opsgenie:master Mar 5, 2024
@ozlemmcokuk
Copy link
Contributor

Please see the package Nagios-1.1.5_oec-1.1.4

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.

None yet

2 participants