Merge pull request #22665 from rallytime/pylinting

Python 3 compat changes to salt/states/boto_vpc.py
This commit is contained in:
Justin Findlay 2015-04-14 12:55:56 -06:00
commit c2f4b6472b

View File

@ -78,6 +78,11 @@ config:
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Libs
import salt.utils.dictupdate as dictupdate
@ -665,7 +670,7 @@ def _subnets_present(route_table_name, subnets, tags=None, region=None, key=None
if subnet['id'] == assoc['subnet_id']:
route_subnets.append({'id': assoc['id'], 'subnet_id': assoc['subnet_id'], 'name': subnet['tags']['Name']})
# Build list of subnets to be associated
to_create = filter(lambda x: not any(set(dict(x).items()) & set(dict(f).items()) for f in route_subnets), subnets) # pylint: disable=W0141
to_create = [x for x in subnets if not any(set(dict(x).items()) & set(dict(f).items()) for f in route_subnets)]
# Update list of subnets to be associated (add subnet_id if missing)
for item in to_create:
if item['subnet_id'] is None:
@ -673,7 +678,7 @@ def _subnets_present(route_table_name, subnets, tags=None, region=None, key=None
if subnet['tags']['Name'] == item['name']:
item['subnet_id'] = subnet['id']
# Build list of subnets to be disassociated
to_delete = filter(lambda x: not any(set(x.items()) & set(dict(f).items()) for f in subnets), route_subnets) # pylint: disable=W0141
to_delete = [x for x in route_subnets if not any(set(x.items()) & set(dict(f).items()) for f in subnets)]
if to_create or to_delete:
if __opts__['test']:
msg = 'Subnet associations for route table {0} set to be modified.'.format(route_table_name)