Fix ec2 module source_dest_check when running on non VPC instances (EC2 Classic) (#3243)

This commit is contained in:
Florian Dambrine 2016-09-08 04:25:17 -06:00 committed by René Moser
parent 81aa3a760c
commit aac55fcc62

View file

@ -1309,7 +1309,7 @@ def startstop_instances(module, ec2, instance_ids, state, instance_tags):
for inst in res.instances:
# Check "source_dest_check" attribute
if inst.get_attribute('sourceDestCheck')['sourceDestCheck'] != source_dest_check:
if inst.vpc_id is not None and inst.get_attribute('sourceDestCheck')['sourceDestCheck'] != source_dest_check:
inst.modify_attribute('sourceDestCheck', source_dest_check)
changed = True