[cloud] Don't alter dictionary during iteration in elb_target_group_facts, avoiding RuntimeError (#30247)

Don't update the target_group_attributes dict
while iterating over it.

Fixes #30190
pull/30297/merge
Will Thames 7 years ago committed by Ryan Brown
parent ba6d592039
commit fd18d7ebb5

@ -184,11 +184,8 @@ def get_target_group_attributes(connection, module, target_group_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 target_group_attributes.items():
target_group_attributes[k.replace('.', '_')] = v
del target_group_attributes[k]
return target_group_attributes
return dict((k.replace('.', '_'), v)
for (k, v) in target_group_attributes.items())
def get_target_group_tags(connection, module, target_group_arn):

Loading…
Cancel
Save