From 84135ef7add33b4909176e268133d6007cff2dcb Mon Sep 17 00:00:00 2001 From: s-hertel Date: Fri, 10 Feb 2017 15:23:08 -0500 Subject: [PATCH] Removing cmp from ec2_vpc_net.py to be compatible with Python3 (#21202) * Removing cmp to be compatible with Python3 * fix syntax * Added an overlooked return * Fixing making things overly complicated * Simplifying since tags will always be hashable. Don't need to use cmp at all. --- lib/ansible/modules/cloud/amazon/ec2_vpc_net.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_net.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_net.py index 77e5214270a..6a01208eafc 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_net.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_net.py @@ -150,7 +150,7 @@ def update_vpc_tags(vpc, module, vpc_obj, tags, name): tags.update({'Name': name}) try: current_tags = dict((t.name, t.value) for t in vpc.get_all_tags(filters={'resource-id': vpc_obj.id})) - if cmp(tags, current_tags): + if tags != current_tags: if not module.check_mode: vpc.create_tags(vpc_obj.id, tags) return True