From 4c409949300274bcd829dda89562402be0f4e976 Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Mon, 9 Mar 2015 10:40:32 -0400 Subject: fixed bug in new ec2.py destination_format code --- inventory/aws/ec2.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 inventory/aws/ec2.py (limited to 'inventory') diff --git a/inventory/aws/ec2.py b/inventory/aws/ec2.py old mode 100644 new mode 100755 index f4e029553..1a863d8a8 --- a/inventory/aws/ec2.py +++ b/inventory/aws/ec2.py @@ -215,8 +215,14 @@ class Ec2Inventory(object): # Destination addresses self.destination_variable = config.get('ec2', 'destination_variable') self.vpc_destination_variable = config.get('ec2', 'vpc_destination_variable') - self.destination_format = config.get('ec2', 'destination_format') - self.destination_format_tags = config.get('ec2', 'destination_format_tags', '').split(',') + + if config.has_option('ec2', 'destination_format') and \ + config.has_option('ec2', 'destination_format_tags'): + self.destination_format = config.get('ec2', 'destination_format') + self.destination_format_tags = config.get('ec2', 'destination_format_tags').split(',') + else: + self.destination_format = None + self.destination_format_tags = None # Route53 self.route53_enabled = config.getboolean('ec2', 'route53') -- cgit v1.2.3