Permalink
Browse files

Ditch arrays of hashes to avoid indexing bug in chef-server 0.8.6

  • Loading branch information...
1 parent 3505aa4 commit 45a88146ebd432b50f4aa8676eb3a6bb7e468604 @b committed Mar 17, 2010
Showing with 9 additions and 10 deletions.
  1. +5 −6 cassandra/recipes/autoconf.rb
  2. +4 −4 cassandra/templates/default/storage-conf.xml.erb
@@ -23,22 +23,21 @@
# {:id : "clusters",
# {<cluster name> =>
# {:keyspaces =>
-# [{:name => <keyspace name>,
-# :columns => [{<attrib> => <value>}, ...],
+# {<keyspace name> => {
+# :columns => {<column name> => {<attrib> => <value>, ...}, ...},
# :replica_placement_strategy => <strategy>,
# :replication_factor => <factor>,
# :end_point_snitch => <snitch>
-# }],
+# }},
# <other per cluster settings>
# }
# }
# }
#
# COLUMN ATTRIBS
#
-# Simple columns: {:name => <column name>, :compare_with => <comparison>}
-# Super columns: {:name => <column name>, :compare_with => <comparison>,
-# :column_type => "Super", :compare_subcolumns_with => <comparison>}
+# Simple columns: {:compare_with => <comparison>}
+# Super columns: {:compare_with => <comparison>, :column_type => "Super", :compare_subcolumns_with => <comparison>}
#
# Gather the seeds
@@ -3,10 +3,10 @@
<ClusterName><%= @node[:cassandra][:cluster_name] %></ClusterName>
<AutoBootstrap><%= @node[:cassandra][:auto_bootstrap] %></AutoBootstrap>
<Keyspaces>
- <% @node[:cassandra][:keyspaces].each do |keyspace| %>
- <Keyspace Name="<%= keyspace[:name] %>">
- <% keyspace[:columns].each do |column| %>
- <ColumnFamily <%= (column.keys.map do |attrib|
+ <% @node[:cassandra][:keyspaces].each_pair do |kname, keyspace| %>
+ <Keyspace Name="<%= kname %>">
+ <% keyspace[:columns].each_pair do |cname, column| %>
+ <ColumnFamily Name="<%= cname %>" <%= (column.keys.map do |attrib|
(attrib.to_s.split('_').map do |part|
part.capitalize
end).join('') + "=\"" + column[attrib] + "\""

0 comments on commit 45a8814

Please sign in to comment.