Skip to content

Instantly share code, notes, and snippets.

@marianogg9
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marianogg9/e97cd7507d4c7767e3d5 to your computer and use it in GitHub Desktop.
Save marianogg9/e97cd7507d4c7767e3d5 to your computer and use it in GitHub Desktop.
def ec2_node_exists?
states = get_valid_states
filtered_instances = ec2.servers.select { |s| states.include?(s.state) }
instance_names = filtered_instances.collect { |s| s.name }
instance_names.each do |name|
return true if name == @event['client']['name']
end
false # no match found, node doesn't exist
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment