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.
This commit is contained in:
s-hertel 2017-02-10 15:23:08 -05:00 committed by Ryan Brown
parent 2dc42fce80
commit 84135ef7ad

View file

@ -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