From 8279328096bceca3d79b51d711433991aef06bf4 Mon Sep 17 00:00:00 2001 From: Thomas Wiest Date: Fri, 13 Mar 2015 17:01:40 -0400 Subject: fixed bug in AwsUtil that was causing it to blow up on hosts without an environment set. --- bin/awsutil.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bin') diff --git a/bin/awsutil.py b/bin/awsutil.py index b6b323778..979455c13 100644 --- a/bin/awsutil.py +++ b/bin/awsutil.py @@ -87,6 +87,10 @@ class AwsUtil(object): inst_by_env = {} for dns, host in inv['_meta']['hostvars'].items(): + # If you don't have an environment tag, we're going to ignore you + if not host.has_key('ec2_tag_environment'): + continue + if host['ec2_tag_environment'] not in inst_by_env: inst_by_env[host['ec2_tag_environment']] = {} host_id = "%s:%s" % (host['ec2_tag_Name'],host['ec2_id']) -- cgit v1.2.3