bin/handler-ec2_node.rb in sensu-plugins-aws-10.1.1 vs bin/handler-ec2_node.rb in sensu-plugins-aws-10.1.2
- old
+ new
@@ -182,10 +182,10 @@
def ec2_node_should_be_deleted?
# Defining region for aws SDK object
ec2 = Aws::EC2::Client.new(region: region)
settings['ec2_node'] = {} unless settings['ec2_node']
instance_states = @event['client']['ec2_states'] || settings['ec2_node']['ec2_states'] || ['shutting-down', 'terminated', 'stopping', 'stopped']
- instance_reasons = @event['client']['ec2_state_reasons'] || settings['ec2_node']['ec2_state_reasons'] || %w(Client.UserInitiatedShutdown Server.SpotInstanceTermination Client.InstanceInitiatedShutdown)
+ instance_reasons = @event['client']['ec2_state_reasons'] || settings['ec2_node']['ec2_state_reasons'] || %w[Client.UserInitiatedShutdown Server.SpotInstanceTermination Client.InstanceInitiatedShutdown]
begin
# Finding the instance
instances = ec2.describe_instances(instance_ids: [instance_id]).reservations[0]
# If instance is empty/nil instance id is not valid so client can be deleted