From: <jsh...@rh...> - 2009-09-02 16:06:44
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><style type="text/css"><!-- #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } --></style> <title>[rhq-project.org rhq] [5064] Don't abort discovery if you come across a bad entry in the registry (like an empty name).</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>5064</dd> <dt>Author</dt> <dd>jshaughn</dd> <dt>Date</dt> <dd>2009-09-02 11:06:33 -0500 (Wed, 02 Sep 2009)</dd> </dl> <h3>Log Message</h3> <pre>Don't abort discovery if you come across a bad entry in the registry (like an empty name). Also, set installDate in the packageDetails so everything isn't set to epoch.</pre> <h3>Modified Paths</h3> <ul> <li><a href="#rhqtrunkmodulespluginsplatformsrcmainjavaorgrhqpluginsplatformwinWindowsSoftwareDelegatejava">rhq/trunk/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/win/WindowsSoftwareDelegate.java</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="rhqtrunkmodulespluginsplatformsrcmainjavaorgrhqpluginsplatformwinWindowsSoftwareDelegatejava"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/win/WindowsSoftwareDelegate.java (5063 => 5064)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/win/WindowsSoftwareDelegate.java 2009-09-02 15:51:56 UTC (rev 5063) +++ rhq/trunk/modules/plugins/platform/src/main/java/org/rhq/plugins/platform/win/WindowsSoftwareDelegate.java 2009-09-02 16:06:33 UTC (rev 5064) </span><span class="lines">@@ -67,15 +67,23 @@ </span><span class="cx"> String version = getStringValue(packageKey, "DisplayVersion"); if (displayName != null && installDateString != null && version != null) { </span><span class="rem">- if (version.length() == 0) </span><span class="add">+ if (version.length() == 0) { </span><span class="cx"> version = "1"; </span><span class="rem">- - ResourcePackageDetails details = new ResourcePackageDetails(new PackageDetailsKey(displayName, - version, type.getName(), "noarch")); - details.setFileCreatedDate(getDate(installDateString)); - details.setFileSize((long) packageKey.getIntValue("EstimatedSize", 0)); - details.setDeploymentTimeConfiguration(getConfigurations(packageKey)); - installedSoftware.add(details); </span><span class="add">+ } + try { + ResourcePackageDetails details = new ResourcePackageDetails(new PackageDetailsKey(displayName, + version, type.getName(), "noarch")); + details.setFileCreatedDate(getDate(installDateString)); + details.setInstallationTimestamp(getDate(installDateString)); + details.setFileSize((long) packageKey.getIntValue("EstimatedSize", 0)); + details.setDeploymentTimeConfiguration(getConfigurations(packageKey)); + installedSoftware.add(details); + } catch (IllegalArgumentException e) { + if (log.isDebugEnabled()) { + log.debug("Skipping windows package discovery for illegal entry [name=" + displayName + + ",version=" + version + ",installDate=" + installDateString + "]", e); + } + } </span><span class="cx"> } } } catch (Win32Exception e) { </span> </pre> </div> </div> </body> </html> |