<% zk_properties = scope.lookupvar('zookeeper::_properties') -%>
<%# sort the properties list for ruby <= 1.8 #-%>
<% rv=RUBY_VERSION.split('.') -%>
<% if rv[0] <= '1' and rv[1] <= '8' -%>
<% zk_properties_keys = zk_properties.keys.sort -%>
<% else -%>
<% zk_properties_keys = zk_properties.keys -%>
<% end -%>
export JVMFLAGS="<% zk_properties_keys.each do |p| -%>
<% value = zk_properties[p] -%>
<% if value != '::undef' -%>
-D<%= p -%>=<%= value.gsub(/([\$\\ "])/, '\\\\\\1').gsub(/\n/, '') -%> <% end -%>
<% end -%>
"

<% zk_properties = scope.lookupvar('zookeeper::_properties') -%>
<%# sort the properties list for ruby <= 1.8 #-%>
<% rv=RUBY_VERSION.split('.') -%>
<% if rv[0] <= '1' and rv[1] <= '8' -%>
<% zk_properties_keys = zk_properties.keys.sort -%>
<% else -%>
<% zk_properties_keys = zk_properties.keys -%>
<% end -%>
export JVMFLAGS="<% zk_properties_keys.each do |p| -%>
<% value = zk_properties[p].to_s -%>
<% if value != '::undef' -%>
-D<%= p -%>=<%= value.gsub(/([\$\\ "])/, '\\\\\\1').gsub(/\n/, '') -%> <% end -%>
<% end -%>
"

Support also numbers in properties
Support also numbers in properties
