Created
September 28, 2015 20:56
-
-
Save ajroetker/5e9e8b9f8f70620d3685 to your computer and use it in GitHub Desktop.
update the wire-format of example reports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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