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

Mesos: Prevent requests from using chardet #2192

Merged
merged 1 commit into from Feb 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions checks.d/mesos.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ def get_json(self, url, timeout):
self.warning(msg)
return None

if r.encoding is None:
r.encoding = 'UTF8'

return r.json()

def timeout_event(self, url, timeout, aggregation_key):
Expand Down
3 changes: 3 additions & 0 deletions checks.d/mesos_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ def _get_json(self, url, timeout):
message=msg)
raise CheckException("Cannot connect to mesos, please check your configuration.")

if r.encoding is None:
r.encoding = 'UTF8'

return r.json()

def _get_master_state(self, url, timeout):
Expand Down
3 changes: 3 additions & 0 deletions checks.d/mesos_slave.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ def _get_json(self, url, timeout):
if status is AgentCheck.CRITICAL:
raise CheckException("Cannot connect to mesos, please check your configuration.")

if r.encoding is None:
r.encoding = 'UTF8'

return r.json()

def _get_state(self, url, timeout):
Expand Down