Move function to the end, use a better argument name.
Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/5214fcae Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/5214fcae Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/5214fcae Branch: refs/heads/trunk Commit: 5214fcae751b677e700199f95b8722af05879807 Parents: caa689d Author: Tomaz Muraus <[email protected]> Authored: Fri Jan 24 22:42:14 2014 +0100 Committer: Tomaz Muraus <[email protected]> Committed: Fri Jan 24 22:42:14 2014 +0100 ---------------------------------------------------------------------- libcloud/dns/drivers/rackspace.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/5214fcae/libcloud/dns/drivers/rackspace.py ---------------------------------------------------------------------- diff --git a/libcloud/dns/drivers/rackspace.py b/libcloud/dns/drivers/rackspace.py index 84b9ab8..ea7dfef 100644 --- a/libcloud/dns/drivers/rackspace.py +++ b/libcloud/dns/drivers/rackspace.py @@ -409,19 +409,6 @@ class RackspaceDNSDriver(DNSDriver, OpenStackDriverMixin): return kwargs -def _rackspace_result_has_more(obj, result_length, limit): - # If rackspace returns less than the limit, then we've reached the end of - # the result set. - if result_length < limit: - return False - # Paginated results return links to the previous and next sets of data, but - # 'next' only exists when there is more to get. - for item in obj.get('links', ()): - if item['rel'] == 'next': - return True - return False - - class RackspaceUSDNSDriver(RackspaceDNSDriver): name = 'Rackspace DNS (US)' type = Provider.RACKSPACE_US @@ -438,3 +425,17 @@ class RackspaceUKDNSDriver(RackspaceDNSDriver): def __init__(self, *args, **kwargs): kwargs['region'] = 'uk' super(RackspaceUKDNSDriver, self).__init__(*args, **kwargs) + + +def _rackspace_result_has_more(response, result_length, limit): + # If rackspace returns less than the limit, then we've reached the end of + # the result set. + if result_length < limit: + return False + + # Paginated results return links to the previous and next sets of data, but + # 'next' only exists when there is more to get. + for item in response.get('links', ()): + if item['rel'] == 'next': + return True + return False
