diff --git a/chef/src/main/java/org/jclouds/ohai/WhiteListCompliantJVM.java b/chef/src/main/java/org/jclouds/ohai/WhiteListCompliantJVM.java index 750f98bd39..93b5c96ecc 100644 --- a/chef/src/main/java/org/jclouds/ohai/WhiteListCompliantJVM.java +++ b/chef/src/main/java/org/jclouds/ohai/WhiteListCompliantJVM.java @@ -70,18 +70,20 @@ public class WhiteListCompliantJVM implements Supplier> { while (nowBuilder.lastIndexOf("0") != -1 && nowBuilder.lastIndexOf("0") == nowBuilder.length() - 1) nowBuilder.deleteCharAt(nowBuilder.length() - 1); now = nowBuilder.toString(); - returnVal.put("ohai_time", new JsonBall(now)); + returnVal.put("java", new JsonBall(json.toJson(systemProperties))); String platform = systemProperties.getProperty("os.name"); platform = platform.replaceAll("[ -]", "").toLowerCase(); returnVal.put("platform", new JsonBall(platform)); - returnVal.put("platform_version", new JsonBall(systemProperties.getProperty("os.version"))); - returnVal.put("ohai_time", new JsonBall(now)); - returnVal.put("current_user", new JsonBall(systemProperties.getProperty("user.name"))); + if (systemProperties.getProperty("os.version") != null) + returnVal.put("platform_version", new JsonBall(systemProperties.getProperty("os.version"))); + + if (systemProperties.getProperty("user.name") != null) + returnVal.put("current_user", new JsonBall(systemProperties.getProperty("user.name"))); return returnVal; } } \ No newline at end of file