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,6 +384,7 @@ class Ec2Inventory(object): ...@@ -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:
......
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