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
Rackspace pagination #230
Rackspace pagination #230
Conversation
Rackspace paginates DNS records returned from their API. In list_records, query Rackspace multiple times, if needed, to get the full list of records.
Fix lint warning.
@@ -396,6 +408,15 @@ def _ex_connection_class_kwargs(self): | |||
return kwargs | |||
|
|||
|
|||
def _rackspace_result_has_more(obj): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be on the safe side I would also pass limit and number of items returned in the response.
Then you could also return False
if num_items
< limit
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kami: do you mean the totalEntries
key? (which I think is the total number, so we'd be checking if total_entries <= offset + limit
so something like that?) (I'm using http://docs.rackspace.com/cdns/api/v1.0/cdns-devguide/content/list_domains.html as a reference.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of number of items, so len(records_list['records'])
for records and len(response['domains'])
for zones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kami: Oh, I see. Added a commit to that effect.
@thanatos Looks good. Can you please squash the commits so I can merge patch into trunk? |
@thanatos That's a standard workflow for our project. It keeps history cleaner. |
Patch merged into trunk. Thanks pull request can be closed now. Thanks. |
A set of commits to handle Rackspace's pagination of results in their DNS API in the Rackspace driver.
Originally in pull request #190, but moved here to clean it up.