Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ajroetker
Created September 28, 2015 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajroetker/5e9e8b9f8f70620d3685 to your computer and use it in GitHub Desktop.
Save ajroetker/5e9e8b9f8f70620d3685 to your computer and use it in GitHub Desktop.
update the wire-format of example reports
(ns foo
(:require [clojure.java.io :as io]
[puppetlabs.puppetdb.reports :as reports]
[puppetlabs.puppetdb.cheshire :as json]))
(defn update-file-contents [file]
[(.getName file)
(json/generate-string
(reports/wire-v5->wire-v6
(json/parse-string
(slurp file)
true)))])
(doseq [[name contents]
(map update-file-contents
(remove #(.isDirectory %)
(file-seq
(io/file
(io/resource "puppetlabs/puppetdb/benchmark/samples/reports")))))]
(with-open [w (io/writer name)]
(.write w contents)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment