diff options
Diffstat (limited to 'inventory')
-rwxr-xr-x[-rw-r--r--] | inventory/aws/ec2.py | 12 | ||||
-rwxr-xr-x | inventory/gce/gce.py | 2 | ||||
-rwxr-xr-x | inventory/multi_ec2.py | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/inventory/aws/ec2.py b/inventory/aws/ec2.py index f4e029553..f231ff4c2 100644..100755 --- a/inventory/aws/ec2.py +++ b/inventory/aws/ec2.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 ''' EC2 external inventory script @@ -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') diff --git a/inventory/gce/gce.py b/inventory/gce/gce.py index e77178c16..3403f735e 100755 --- a/inventory/gce/gce.py +++ b/inventory/gce/gce.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # Copyright 2013 Google Inc. # # This file is part of Ansible diff --git a/inventory/multi_ec2.py b/inventory/multi_ec2.py index 499264267..5dee7972b 100755 --- a/inventory/multi_ec2.py +++ b/inventory/multi_ec2.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # vim: expandtab:tabstop=4:shiftwidth=4 from time import time |