From 1842e34a738a2c4df6a3e6220b8720885c9cd10f Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Fri, 9 Mar 2018 04:49:29 +0530 Subject: [PATCH] DigitalOcean: typecast map function for Python3 (#37168) 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 (cherry picked from commit 8f3f7f104f6358a8145fbca3002ec46c5278f6a8) --- lib/ansible/modules/cloud/digital_ocean/digital_ocean.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/digital_ocean/digital_ocean.py b/lib/ansible/modules/cloud/digital_ocean/digital_ocean.py index d2946fb8457..d5b884a9678 100644 --- a/lib/ansible/modules/cloud/digital_ocean/digital_ocean.py +++ b/lib/ansible/modules/cloud/digital_ocean/digital_ocean.py @@ -307,7 +307,7 @@ class Droplet(JsonfyMixIn): @classmethod def list_all(cls): json = cls.manager.all_active_droplets() - return map(cls, json) + return [cls(j) for j in 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 [cls(j) for j in json] @classmethod def add(cls, name, key_pub):