ec2 inventory: Verify that a security group exists before trying to use its name as a key in inventory.

pull/3920/merge
Herby Gillot 11 years ago committed by James Cammarata
parent 20a57dcdcb
commit c2f8215c06

@ -384,6 +384,7 @@ class Ec2Inventory(object):
# Inventory: Group by security group # Inventory: Group by security group
try: try:
if instance.security_group:
key = self.to_safe("security_group_" + instance.security_group.name) key = self.to_safe("security_group_" + instance.security_group.name)
self.push(self.inventory, key, dest) self.push(self.inventory, key, dest)
except AttributeError: except AttributeError:

Loading…
Cancel
Save