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

Rackspace pagination #230

Closed
wants to merge 8 commits into from
Closed

Conversation

thanatos
Copy link
Contributor

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.

@@ -396,6 +408,15 @@ def _ex_connection_class_kwargs(self):
return kwargs


def _rackspace_result_has_more(obj):
Copy link
Member

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.

Copy link
Contributor Author

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.)

Copy link
Member

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.

Copy link
Contributor Author

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.

@Kami
Copy link
Member

Kami commented Jan 24, 2014

@thanatos Looks good. Can you please squash the commits so I can merge patch into trunk?

@thanatos
Copy link
Contributor Author

@Kami: That's an odd request. Why not just merge the branch into trunk? If you really want a squashed commit (you'll lose the history?) there's one at thanatos@rackspace-pagination-squished. (1a8b287)

@Kami
Copy link
Member

Kami commented Jan 24, 2014

@thanatos That's a standard workflow for our project. It keeps history cleaner.

@Kami
Copy link
Member

Kami commented Jan 24, 2014

Patch merged into trunk. Thanks pull request can be closed now.

Thanks.

@thanatos thanatos closed this Jan 24, 2014
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