How do save list to json in disk


#1

Why??? Does not to_json work?

redis_queue = [“queue”]

redis_queue = node[‘monitor’][‘redis_queue’]
redis_queue=redis_queue.to_json

file “/var/redis_queue_list.json” do
owner 'root’
group 'root’
mode '0666’
content "#{redis_queue}"
end

This is what he file looks like

[“queue”]

Why will my recipe not save in a valid json format?

My python script bombs when trying to read

raise ValueError("No JSON object could be decoded")

ValueError: No JSON object could be decoded

thanks


#2

That look like perfectly valid json:
echo -n ‘[“queue”]’ | python -m json.tool
[
“queue”
]

-Greg

On Thu, Dec 11, 2014 at 2:29 PM, David Montgomery <davidmontgomery@gmail.com

wrote:

Why??? Does not to_json work?

redis_queue = [“queue”]

redis_queue = node[‘monitor’][‘redis_queue’]
redis_queue=redis_queue.to_json

file “/var/redis_queue_list.json” do
owner 'root’
group 'root’
mode '0666’
content "#{redis_queue}"
end

This is what he file looks like

[“queue”]

Why will my recipe not save in a valid json format?

My python script bombs when trying to read

raise ValueError("No JSON object could be decoded")

ValueError: No JSON object could be decoded

thanks