From 8f3f7f104f6358a8145fbca3002ec46c5278f6a8 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Wed, 7 Mar 2018 22:01:23 +0530 Subject: [PATCH] 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 --- 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 d2946fb845..9cc268758d 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 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):