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.
self.ec2_instance_filters = defaultdict(list)
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()
if not instance_filter or '=' not in instance_filter:
continue