summaryrefslogtreecommitdiffstats
path: root/inventory/aws
diff options
context:
space:
mode:
Diffstat (limited to 'inventory/aws')
-rwxr-xr-x[-rw-r--r--]inventory/aws/ec2.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/inventory/aws/ec2.py b/inventory/aws/ec2.py
index f4e029553..1a863d8a8 100644..100755
--- 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')