Skip to content

Instantly share code, notes, and snippets.

@joshmyers
Created September 15, 2013 13:05
Show Gist options
  • Save joshmyers/6570593 to your computer and use it in GitHub Desktop.
Save joshmyers/6570593 to your computer and use it in GitHub Desktop.
servers = Array.new
cassandra_nodes.each do |cass_node|
servers << { "name" : "#{cass_node}", "port": "#{['jmxtrans']['jmx_port']}", "type": "jmx" }
end
@meatballhat
Copy link

Is this what you mean, maybe? 😸

servers = cassandra_nodes.map do |n|
  {'name' => n, 'port' => node['jmxtrans']['jmx_port'], 'type' => 'jmx'}
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment