DataDog/dd-agent — pull request #1039 by lgtml (2014-07-18 05:07:30+00:00)
Title: Added Mesos/Marathon requests v1/v2 compatibility

# Problem
Marathon check was written for requests v1.x api

# Solution
I added a condition to return if `r.json` is a dict else return the response from the callable method

## Example of error
```python
>>> import requests
>>> r = requests.get('http://localhost:8080/v2/apps')
>>> r.json
>
>>> r.json()
{u'apps':
```

# Tests
- [x] Tested datadog info
```
Checks
======

mesos
-----
- instance #0 [OK]
- Collected 115 metrics, 0 events & 0 service checks

marathon
--------
- instance #0 [OK]
- Collected 141 metrics, 0 events & 0 service checks

network
-------
- instance #0 [OK]
- Collected 11 metrics, 0 events & 0 service checks

Emitters
========

- http_emitter [OK]
```

# Notes
- Since I added the condition to marathon I went ahead and added it to mesos for consistency