From 0cf1ef735de9bc0a7adb07538bbae49aa7297908 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 24 Feb 2012 02:04:50 -0500 Subject: [PATCH] Added an 'ohai' module. Some weird JSON hackage to get it to work. --- ohai | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 ohai diff --git a/ohai b/ohai new file mode 100644 index 00000000000..968c0472367 --- /dev/null +++ b/ohai @@ -0,0 +1,12 @@ +#!/usr/bin/python + +# requires 'ohai' to be installed + +import json +import subprocess + +cmd = subprocess.Popen("/usr/bin/ohai", stdout=subprocess.PIPE, stderr=subprocess.PIPE) +out, err = cmd.communicate() + +# try to cleanup the JSON, for some reason facter --json doesn't need this hack +print json.dumps(json.loads(out))