Fix Python 2.7 compat (#58816)

This commit is contained in:
Evgeniy Krysanov 2019-09-03 22:24:41 +03:00 committed by John R Barker
parent 5f9fe6b9c8
commit 9797857a67

View file

@ -166,7 +166,7 @@ def get_existing_deploy_key(module, bitbucket):
if info['status'] != 200: if info['status'] != 200:
module.fail_json(msg='Failed to retrieve the list of deploy keys: {0}'.format(info)) 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: if res is not None:
return res return res