mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
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:
committed by
ansibot
parent
7c07877b1b
commit
8f3f7f104f
@@ -307,7 +307,7 @@ class Droplet(JsonfyMixIn):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def list_all(cls):
|
def list_all(cls):
|
||||||
json = cls.manager.all_active_droplets()
|
json = cls.manager.all_active_droplets()
|
||||||
return map(cls, json)
|
return list(map(cls, json))
|
||||||
|
|
||||||
|
|
||||||
class SSH(JsonfyMixIn):
|
class SSH(JsonfyMixIn):
|
||||||
@@ -338,7 +338,7 @@ class SSH(JsonfyMixIn):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def list_all(cls):
|
def list_all(cls):
|
||||||
json = cls.manager.all_ssh_keys()
|
json = cls.manager.all_ssh_keys()
|
||||||
return map(cls, json)
|
return list(map(cls, json))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def add(cls, name, key_pub):
|
def add(cls, name, key_pub):
|
||||||
|
|||||||
Reference in New Issue
Block a user