Created
January 25, 2018 02:01
-
-
Save jpadams/6ce14b8932bffcd674b50c0053dabd1c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| facts = [ | |
| { | |
| "name": "processors", | |
| "value": "{\"isa\":\"x64\",\"count\":4,\"models\":[\"Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz\",\"Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz\",\"Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz\",\"Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz\"],\"physicalcount\":4}", | |
| "environment": "production", | |
| "id": "mission-3-processors" | |
| } | |
| ] | |
| function prettyStructured (k,v) { | |
| try {if (k == "value" && typeof(JSON.parse(v)) == "object") { | |
| v = JSON.stringify(JSON.parse(v), null, 2).replace(/\n/g, "\n"); | |
| } } catch(e) {} | |
| return v; | |
| } | |
| j = JSON.stringify(facts, prettyStructured ,2) | |
| print(j) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment