diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py index abab209a05ba..521879377497 100755 --- a/ec2/spark_ec2.py +++ b/ec2/spark_ec2.py @@ -1082,11 +1082,12 @@ def real_main(): time.sleep(30) # Yes, it does have to be this long :-( for group in groups: try: - conn.delete_security_group(group.name) - print "Deleted security group " + group.name + # It is needed to use group_id to make it work with VPC + conn.delete_security_group(group_id=group.id) + print "Deleted security group %s" % group.name except boto.exception.EC2ResponseError: success = False - print "Failed to delete security group " + group.name + print "Failed to delete security group %s" % group.name # Unfortunately, group.revoke() returns True even if a rule was not # deleted, so this needs to be rerun if something fails