From bab763de8915380e3e98e3d2bf7454d693ba245b Mon Sep 17 00:00:00 2001 From: Willy Barro Date: Thu, 14 May 2015 10:14:39 -0300 Subject: [PATCH] Fix pushbullet compatibility with python 2.6 Remove dict comprehension usage. --- lib/ansible/modules/extras/notification/pushbullet.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/notification/pushbullet.py b/lib/ansible/modules/extras/notification/pushbullet.py index 5e758507279..5cd75f8e04c 100644 --- a/lib/ansible/modules/extras/notification/pushbullet.py +++ b/lib/ansible/modules/extras/notification/pushbullet.py @@ -144,7 +144,9 @@ def main(): # Search for given device if device is not None: - devices_by_nickname = {d.nickname: d for d in pb.devices} + devices_by_nickname = {} + for d in pb.devices: + devices_by_nickname[d.nickname] = d if device in devices_by_nickname: target = devices_by_nickname[device] @@ -153,7 +155,9 @@ def main(): # Search for given channel if channel is not None: - channels_by_tag = {c.channel_tag: c for c in pb.channels} + channels_by_tag = {} + for c in pb.channels: + channels_by_tag[c.channel_tag] = c if channel in channels_by_tag: target = channels_by_tag[channel]