Wiredcraft / dopy

Digital Ocean Python
MIT License
95 stars 62 forks source link

Fix #29 — Fetch paginated responses completely #31

Closed Xowap closed 8 years ago

Xowap commented 9 years ago

As stated in #29, only the first page of response was fetched (which is a bug and not a bloody enhancement, btw).

This PR fixes that with a decorator around the request_v2() method which, in case of GET request, will parse the output, find next page if required and will append the content to the current content.

I can't guarantee I didn't break anything due to the lack of unit tests, but my Ansible script still works.

Also, this project's code seriously requires to get through PEP 8 linting, but that's none of my business.

jeremykendall commented 8 years ago

Bump. I have > 200 droplets and just broke my dynamic inventory script by upgrading to DigitalOcean API V2.

@Xowap 100% agree: #29 is a bug, not an enhancement request.

haz-mat commented 8 years ago

+1, would be great to have this fix pulled.

kmadac commented 8 years ago

+1, pull this request please

whiskybar commented 8 years ago

+1, we need this urgently as Digital Ocean API v1 has been deprecated as of today:

https://developers.digitalocean.com/documentation/v1/

zbal commented 8 years ago

Thanks - PR Merged - will release to pip later on today.

Xowap commented 8 years ago

Good :+1: