Commit c2f8215c by Herby Gillot Committed by James Cammarata

ec2 inventory: Verify that a security group exists before trying to use its name…

ec2 inventory: Verify that a security group exists before trying to use its name as a key in inventory.
parent 20a57dcd
......@@ -384,8 +384,9 @@ class Ec2Inventory(object):
# Inventory: Group by security group
try:
key = self.to_safe("security_group_" + instance.security_group.name)
self.push(self.inventory, key, dest)
if instance.security_group:
key = self.to_safe("security_group_" + instance.security_group.name)
self.push(self.inventory, key, dest)
except AttributeError:
print 'Package boto seems a bit older.'
print 'Please upgrade boto >= 2.3.0.'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment