DigitalOcean: typecast map function for Python3 (#37126)

In Python2, `map` returns list whereas Python3, `map` function
 returns iterator. This fix typecast map function for Python3.

Fixes: #37114

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2018-03-07 22:01:23 +05:30 committed by ansibot
parent 7c07877b1b
commit 8f3f7f104f

View file

@ -307,7 +307,7 @@ class Droplet(JsonfyMixIn):
@classmethod
def list_all(cls):
json = cls.manager.all_active_droplets()
return map(cls, json)
return list(map(cls, json))
class SSH(JsonfyMixIn):
@ -338,7 +338,7 @@ class SSH(JsonfyMixIn):
@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):