[chef] Re: how do save list to json in disk


Chronological Thread 
  • From: Greg Zapp < >
  • To:
  • Subject: [chef] Re: how do save list to json in disk
  • Date: Thu, 11 Dec 2014 15:06:45 +1300

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 < " target="_blank"> > 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







Archive powered by MHonArc 2.6.16.

§