From 9deef5626fe2aae08eb11c6caf07a4aa420ad849 Mon Sep 17 00:00:00 2001 From: Sloane Hertel Date: Thu, 1 Mar 2018 15:30:08 -0500 Subject: [PATCH] Only create tags if tags are provided (#36921) --- lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py index 2dcde18eff..7cb3798d1d 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py @@ -238,12 +238,10 @@ def tags_changed(pcx_id, client, module): tags = [item for sublist in tag_values for item in sublist] if sorted(pcx_tags) == sorted(tags): changed = False - return changed - else: + elif tags: delete_tags(pcx_id, client, module) create_tags(pcx_id, client, module) changed = True - return changed return changed