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): ...@@ -384,8 +384,9 @@ class Ec2Inventory(object):
# Inventory: Group by security group # Inventory: Group by security group
try: try:
key = self.to_safe("security_group_" + instance.security_group.name) if instance.security_group:
self.push(self.inventory, key, dest) key = self.to_safe("security_group_" + instance.security_group.name)
self.push(self.inventory, key, dest)
except AttributeError: except AttributeError:
print 'Package boto seems a bit older.' print 'Package boto seems a bit older.'
print 'Please upgrade boto >= 2.3.0.' 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