From 9797857a673c4eee253de54cd7e33c06b51e3dba Mon Sep 17 00:00:00 2001 From: Evgeniy Krysanov Date: Tue, 3 Sep 2019 22:24:41 +0300 Subject: [PATCH] Fix Python 2.7 compat (#58816) --- .../modules/source_control/bitbucket/bitbucket_access_key.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/source_control/bitbucket/bitbucket_access_key.py b/lib/ansible/modules/source_control/bitbucket/bitbucket_access_key.py index e69760b3428..6cf40272270 100644 --- a/lib/ansible/modules/source_control/bitbucket/bitbucket_access_key.py +++ b/lib/ansible/modules/source_control/bitbucket/bitbucket_access_key.py @@ -166,7 +166,7 @@ def get_existing_deploy_key(module, bitbucket): if info['status'] != 200: module.fail_json(msg='Failed to retrieve the list of deploy keys: {0}'.format(info)) - res = next(filter(lambda v: v['label'] == module.params['label'], content['values']), None) + res = next(iter(filter(lambda v: v['label'] == module.params['label'], content['values'])), None) if res is not None: return res