Skip to content

Commit

Permalink
Merge pull request #25439 from rallytime/fix-25431
Browse files Browse the repository at this point in the history
Reduce digital_ocean API call frequency
  • Loading branch information
thatch45 committed Jul 15, 2015
2 parents 7d4aee7 + 7138f36 commit 4f91f5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions doc/topics/releases/beryllium.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Salt Cloud Changes

- Modified the Linode Salt Cloud driver to use Linode's native API instead of
depending on apache-libcloud or linode-python.
- When querying for VMs in ``ditigal_ocean.py``, the number of VMs to include in
a page was changed from 20 (default) to 200 to reduce the number of API calls
to Digital Ocean.

JBoss 7 State
=============
Expand Down
6 changes: 3 additions & 3 deletions salt/cloud/clouds/digital_ocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def avail_images(call=None):
ret = {}

while fetch:
items = query(method='images', command='?page=' + str(page))
items = query(method='images', command='?page=' + str(page) + '&per_page=200')

for image in items['images']:
ret[image['id']] = {}
Expand Down Expand Up @@ -172,7 +172,7 @@ def list_nodes(call=None):
ret = {}

while fetch:
items = query(method='droplets', command='?page=' + str(page))
items = query(method='droplets', command='?page=' + str(page) + '&per_page=200')
for node in items['droplets']:
ret[node['name']] = {
'id': node['id'],
Expand Down Expand Up @@ -204,7 +204,7 @@ def list_nodes_full(call=None, forOutput=True):
ret = {}

while fetch:
items = query(method='droplets', command='?page=' + str(page))
items = query(method='droplets', command='?page=' + str(page) + '&per_page=200')
for node in items['droplets']:
ret[node['name']] = {}
for item in six.iterkeys(node):
Expand Down

0 comments on commit 4f91f5b

Please sign in to comment.