From 7fd3262c3c8a425b21062fc6e71dd65fadda4112 Mon Sep 17 00:00:00 2001 From: fperks Date: Tue, 6 Oct 2015 09:57:47 -0400 Subject: [PATCH] Fix error on ec2 status change Both `source_dest_check` and `termination_protection` variables are not available within the scope of the startstopec2 instance method. This just pulls them from module.params. --- cloud/amazon/ec2.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloud/amazon/ec2.py b/cloud/amazon/ec2.py index 6572a9286f4..6152d4934c8 100644 --- a/cloud/amazon/ec2.py +++ b/cloud/amazon/ec2.py @@ -1228,6 +1228,8 @@ def startstop_instances(module, ec2, instance_ids, state, instance_tags): wait_timeout = int(module.params.get('wait_timeout')) changed = False instance_dict_array = [] + source_dest_check = module.params.get('source_dest_check') + termination_protection = module.params.get('termination_protection') if not isinstance(instance_ids, list) or len(instance_ids) < 1: # Fail unless the user defined instance tags