lib/chef/knife/topo_cookbook_create.rb in knife-topo-0.0.8 vs lib/chef/knife/topo_cookbook_create.rb in knife-topo-0.0.9
- old
+ new
@@ -130,10 +130,11 @@
if value1.is_a?(Hash)
value1.each do |key, value2|
print_attr(file, "#{lhs}['#{key}']", value2)
end
else
- file.write "#{lhs} = \"#{value1}\"\n"
+ rubyString = (value1 == nil) ? "nil" : Chef::JSONCompat.to_json(value1);
+ file.write "#{lhs} = " + rubyString + " \n"
end
end
# Print out attributes hashed by priority
def print_priority_attrs(file, attrs, indent=0)
\ No newline at end of file