From f52a022022ea4c1e84b30c749d541f0dc232b331 Mon Sep 17 00:00:00 2001 From: Nick Ward Date: Fri, 2 Jun 2017 12:21:39 +0100 Subject: [PATCH] Python3 compatability for elb_application_lb and elb_target_group --- lib/ansible/modules/cloud/amazon/elb_application_lb.py | 6 +----- lib/ansible/modules/cloud/amazon/elb_target_group.py | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/elb_application_lb.py b/lib/ansible/modules/cloud/amazon/elb_application_lb.py index 4e46c2aec11..7c38b95e475 100755 --- a/lib/ansible/modules/cloud/amazon/elb_application_lb.py +++ b/lib/ansible/modules/cloud/amazon/elb_application_lb.py @@ -416,11 +416,7 @@ def get_elb_attributes(connection, module, elb_arn): module.fail_json(msg=e.message, exception=traceback.format_exc(), **camel_dict_to_snake_dict(e.response)) # Replace '.' with '_' in attribute key names to make it more Ansibley - for k, v in dict(elb_attributes).items(): - elb_attributes[k.replace('.', '_')] = v - del elb_attributes[k] - - return elb_attributes + return dict((k.replace('.', '_'), v) for k, v in elb_attributes.items()) def get_listener(connection, module, elb_arn, listener_port): diff --git a/lib/ansible/modules/cloud/amazon/elb_target_group.py b/lib/ansible/modules/cloud/amazon/elb_target_group.py index 60ed46c204b..a8bc3b15acc 100644 --- a/lib/ansible/modules/cloud/amazon/elb_target_group.py +++ b/lib/ansible/modules/cloud/amazon/elb_target_group.py @@ -299,11 +299,7 @@ def get_tg_attributes(connection, module, tg_arn): module.fail_json(msg=e.message, exception=traceback.format_exc(), **camel_dict_to_snake_dict(e.response)) # Replace '.' with '_' in attribute key names to make it more Ansibley - for k, v in tg_attributes.items(): - tg_attributes[k.replace('.', '_')] = v - del tg_attributes[k] - - return tg_attributes + return dict((k.replace('.', '_'), v) for k, v in tg_attributes.items()) def get_target_group_tags(connection, module, target_group_arn):