|
From: <jt...@hy...> - 2007-03-13 21:52:09
|
Author: jtravis Date: 2007-03-13 13:52:03 -0800 (Tue, 13 Mar 2007) New Revision: 3738 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3738 Modified: trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java Log: More tweaks. Make sure to deal with resource stream being null in case something weird happens. Also set the report to blank when update status is none Modified: trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java 2007-03-13 21:27:04 UTC (rev 3737) +++ trunk/src/org/hyperic/hq/bizapp/server/session/UpdateBossEJBImpl.java 2007-03-13 21:52:03 UTC (rev 3738) @@ -74,12 +74,15 @@ private static final Log _log = LogFactory.getLog(UpdateBossEJBImpl.class); private static Properties getTweakProperties() - throws IOException + throws Exception { ClassLoader loader = Thread.currentThread().getContextClassLoader(); InputStream is = loader.getResourceAsStream("META-INF/tweak.properties"); Properties res = new Properties(); + + if (is == null) + return res; try { res.load(is); @@ -95,7 +98,7 @@ String res = p.getProperty("hq.updateNotify.url"); if (res != null) return res; - } catch(IOException e) { + } catch(Exception e) { _log.warn("Unable to get notification url", e); } return CHECK_URL; @@ -227,6 +230,9 @@ return; } + if (curStatus.getMode().equals(UpdateStatusMode.NONE)) + return; + response = response.trim(); curReport = curStatus.getReport() == null ? "" : curStatus.getReport(); @@ -265,6 +271,11 @@ UpdateStatus status = getOrCreateStatus(); status.setMode(mode); + + if (mode.equals(UpdateStatusMode.NONE)) { + status.setIgnored(true); + status.setReport(""); + } } /** |