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

Merge pull request #14761 from enbritely/fix-ec2-inventory

Fix AWS EC2 inventory script instance_filters read
This commit is contained in:
Abhijit Menon-Sen 2016-03-17 21:51:43 +05:30
commit f0af07a5f4

View file

@ -388,7 +388,10 @@ class Ec2Inventory(object):
# Instance filters (see boto and EC2 API docs). Ignore invalid filters. # Instance filters (see boto and EC2 API docs). Ignore invalid filters.
self.ec2_instance_filters = defaultdict(list) self.ec2_instance_filters = defaultdict(list)
if config.has_option('ec2', 'instance_filters'): if config.has_option('ec2', 'instance_filters'):
for instance_filter in config.get('ec2', 'instance_filters', '').split(','):
filters = [f for f in config.get('ec2', 'instance_filters').split(',') if f]
for instance_filter in filters:
instance_filter = instance_filter.strip() instance_filter = instance_filter.strip()
if not instance_filter or '=' not in instance_filter: if not instance_filter or '=' not in instance_filter:
continue continue