1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fixed tag comparison

This commit is contained in:
whiter 2015-07-07 09:38:33 +10:00 committed by Matt Clay
parent 9a0bc389ef
commit 7160312383

View file

@ -103,7 +103,7 @@ import xml.etree.ElementTree as ET
try: try:
import boto.ec2 import boto.ec2
from boto.s3.connection import OrdinaryCallingFormat from boto.s3.connection import OrdinaryCallingFormat, Location
from boto.s3.tagging import Tags, TagSet from boto.s3.tagging import Tags, TagSet
from boto.exception import BotoServerError, S3CreateError, S3ResponseError from boto.exception import BotoServerError, S3CreateError, S3ResponseError
HAS_BOTO = True HAS_BOTO = True
@ -248,7 +248,7 @@ def create_bucket(connection, module):
else: else:
current_tags_dict = dict((t.key, t.value) for t in current_tags[0]) current_tags_dict = dict((t.key, t.value) for t in current_tags[0])
if sorted(current_tags_dict) != sorted(tags): if current_tags_dict != tags:
try: try:
if tags: if tags:
bucket.set_tags(create_tags_container(tags)) bucket.set_tags(create_tags_container(tags))
@ -386,7 +386,5 @@ def main():
from ansible.module_utils.basic import * from ansible.module_utils.basic import *
from ansible.module_utils.ec2 import * from ansible.module_utils.ec2 import *
# this is magic, see lib/ansible/module_common.py if __name__ == '__main__':
#<<INCLUDE_ANSIBLE_MODULE_COMMON>> main()
main()