From ee2679346fabadfbbe1a271de15136bd5de05998 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Sun, 25 Jul 2010 20:08:00 -0700 Subject: [PATCH] Issue 191: gae doesn't have os.version --- .../java/org/jclouds/ohai/WhiteListCompliantJVM.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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