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:
parent
7c07877b1b
commit
8f3f7f104f
1 changed files with 2 additions and 2 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue