Skip to content

Commit

Permalink
Modified the way '_find_zone_or_region' gets data from the 'instances…
Browse files Browse the repository at this point in the history
….aggregatedList' api by using the method 'request_aggregated_items' which correctly paginates

Signed-off-by: Quentin Pradet <quentinp@apache.org>
  • Loading branch information
Léo Ferlin-Sutton authored and pquentin committed May 1, 2018
1 parent 1b5b710 commit e15d3a1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libcloud/compute/drivers/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -7885,8 +7885,7 @@ def _find_zone_or_region(self, name, res_type, region=False,
rz = 'zone'
rz_name = None
res_name = res_name or res_type
request = '/aggregated/%s' % (res_type)
res_list = self.connection.request(request).object
res_list = self.connection.request_aggregated_items(res_type)
for k, v in res_list['items'].items():
for res in v.get(res_type, []):
if res['name'] == name:
Expand Down

0 comments on commit e15d3a1

Please sign in to comment.