Skip to content

Commit

Permalink
DigitalOcean: typecast map function for Python3 (ansible#37126)
Browse files Browse the repository at this point in the history
In Python2, `map` returns list whereas Python3, `map` function
 returns iterator. This fix typecast map function for Python3.

Fixes: ansible#37114

Signed-off-by: Abhijeet Kasurde <[email protected]>
  • Loading branch information
Akasurde authored and ansibot committed Mar 7, 2018
1 parent 7c07877 commit 8f3f7f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ansible/modules/cloud/digital_ocean/digital_ocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def find(cls, id=None, name=None):
@classmethod
def list_all(cls):
json = cls.manager.all_active_droplets()
return map(cls, json)
return list(map(cls, json))


class SSH(JsonfyMixIn):
Expand Down Expand Up @@ -338,7 +338,7 @@ def find(cls, name):
@classmethod
def list_all(cls):
json = cls.manager.all_ssh_keys()
return map(cls, json)
return list(map(cls, json))

@classmethod
def add(cls, name, key_pub):
Expand Down

0 comments on commit 8f3f7f1

Please sign in to comment.