client/tools rel-eng/packages
by Michael Mraka
client/tools/rhnpush/rhnpush.spec | 7 ++++++-
rel-eng/packages/rhnpush | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
New commits:
commit ee84c52b51bdf99935b63d2673b1b9cde1509c91
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jul 13 14:35:35 2012 +0200
Automatic commit of package [rhnpush] release [5.5.49-1].
diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec
index c6a1a5a..7764fa1 100644
--- a/client/tools/rhnpush/rhnpush.spec
+++ b/client/tools/rhnpush/rhnpush.spec
@@ -4,7 +4,7 @@ Name: rhnpush
Group: Applications/System
License: GPLv2
URL: http://fedorahosted.org/spacewalk
-Version: 5.5.48
+Version: 5.5.49
Release: 1%{?dist}
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -63,6 +63,11 @@ rm -rf $RPM_BUILD_ROOT
%doc COPYING
%changelog
+* Fri Jul 13 2012 Michael Mraka <michael.mraka(a)redhat.com> 5.5.49-1
+- fixed man page
+- removed dead --no-cache option
+- fixed --no-session-caching option
+
* Fri Jul 13 2012 Michael Mraka <michael.mraka(a)redhat.com> 5.5.48-1
- 838044 - solaris2mpm on RHEL5 is not supported
- remove trailing '/' from from archive dir
diff --git a/rel-eng/packages/rhnpush b/rel-eng/packages/rhnpush
index 88264fe..1b2ab70 100644
--- a/rel-eng/packages/rhnpush
+++ b/rel-eng/packages/rhnpush
@@ -1 +1 @@
-5.5.48-1 client/tools/rhnpush/
+5.5.49-1 client/tools/rhnpush/
11 years, 9 months
4 commits - client/tools proxy/proxy
by Michael Mraka
client/tools/rhnpush/rhnpush.py | 4 +---
client/tools/rhnpush/rhnpush.sgml | 9 ---------
client/tools/rhnpush/rhnpush_config.py | 1 -
client/tools/rhnpush/rhnpushrc | 3 ---
client/tools/rhnpush/uploadLib.py | 2 +-
proxy/proxy/pm/rhn_package_manager.py | 1 -
proxy/proxy/pm/rhn_package_manager.sgml | 6 ------
7 files changed, 2 insertions(+), 24 deletions(-)
New commits:
commit 8c1bcd725e934a36a74f192b910518e8ced07742
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jul 13 14:33:17 2012 +0200
fixed man page
diff --git a/client/tools/rhnpush/rhnpush.sgml b/client/tools/rhnpush/rhnpush.sgml
index 59602e0..6a69bc0 100644
--- a/client/tools/rhnpush/rhnpush.sgml
+++ b/client/tools/rhnpush/rhnpush.sgml
@@ -90,9 +90,6 @@ Utility to push binary and source RPMs into an RHN channel.
<arg>-N</arg> <arg>--new-cache</arg>
</cmdsynopsis>
<cmdsynopsis>
- <arg>--no-cache</arg>
- </cmdsynopsis>
- <cmdsynopsis>
<arg>--no-session-caching</arg>
</cmdsynopsis>
<cmdsynopsis>
@@ -283,12 +280,6 @@ Utility to push binary and source RPMs into an RHN channel.
<para>create a new username/password cache</para>
</listitem>
</varlistentry>
- <varlistentry>
- <term>--no-cache</term>
- <listitem>
- <para>Do not create username/password cache</para>
- </listitem>
- </varlistentry>
<varlistentry>
<term>--no-session-caching</term>
<listitem>
diff --git a/proxy/proxy/pm/rhn_package_manager.sgml b/proxy/proxy/pm/rhn_package_manager.sgml
index 1e904ee..a7fe175 100644
--- a/proxy/proxy/pm/rhn_package_manager.sgml
+++ b/proxy/proxy/pm/rhn_package_manager.sgml
@@ -169,12 +169,6 @@ Manages RPM packages for the RHN proxy
</listitem>
</varlistentry>
<varlistentry>
- <term>--no-cache</term>
- <listitem>
- <para>Do not create username/password cache</para>
- </listitem>
- </varlistentry>
- <varlistentry>
<term>--no-session-caching</term>
<listitem>
<para>This option disabled session token authentication. Useful if you want to push to two or more different servers.</para>
commit 86a98a75634ee585d17f8d2fe9db252f4cf038ff
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jul 13 14:31:09 2012 +0200
removed dead --no-cache option
this option is dead since we started to use session authentication
diff --git a/proxy/proxy/pm/rhn_package_manager.py b/proxy/proxy/pm/rhn_package_manager.py
index b394b1f..86abeda 100755
--- a/proxy/proxy/pm/rhn_package_manager.py
+++ b/proxy/proxy/pm/rhn_package_manager.py
@@ -71,7 +71,6 @@ def main():
Option( '--copyonly', action='store_true', help="Only copy packages; don't reimport"),
Option( '--test', action='store_true', help='Only print the packages to be pushed'),
Option('-N','--new-cache', action='store_true', help='Create a new username/password cache'),
- Option( '--no-cache', action='store_true', help='Do not create a username/password cache'),
Option( '--no-ssl', action='store_true', help='Turn off SSL (not recommended).'),
Option( '--no-session-caching', action='store_true',
help='Disables session-token authentication.'),
commit 4435de0e59ffc6e50f1a9e48688c2f21d6c22e8b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jul 13 14:15:08 2012 +0200
removed dead --no-cache option
this option is dead since we started to use session authentication
diff --git a/client/tools/rhnpush/rhnpush.py b/client/tools/rhnpush/rhnpush.py
index 5f94fe4..815eb19 100755
--- a/client/tools/rhnpush/rhnpush.py
+++ b/client/tools/rhnpush/rhnpush.py
@@ -76,7 +76,6 @@ def main():
Option( '--test', action='store_true', help='Only print the packages to be pushed'),
Option('-?','--usage', action='store_true', help='Briefly describe the options'),
Option('-N','--new-cache', action='store_true', help='Create a new username/password cache'),
- Option( '--no-cache', action='store_true', help='Do not create a username/password cache'),
Option( '--extended-test', action='store_true', help='Perform a more verbose test'),
Option( '--no-session-caching', action='store_true',
help='Disables session-token authentication.'),
@@ -85,9 +84,8 @@ def main():
]
#Having to maintain a store_true list is ugly. I'm trying to get rid of this.
- #12/22/05 wregglej 173287 Added no_cache to true_list so it's value gets changed from a string to an int.
true_list = ['usage', 'test', 'source', 'header', 'nullorg', 'newest',\
- 'nosig', 'force', 'list', 'stdin', 'new_cache','extended_test', 'no_cache',\
+ 'nosig', 'force', 'list', 'stdin', 'new_cache','extended_test', \
'no_session_caching', 'tolerant']
optionParser = OptionParser(option_list=optionsTable, usage="%prog [OPTION] [<package>]")
manager = rhnpush_confmanager.ConfManager(optionParser, true_list)
diff --git a/client/tools/rhnpush/rhnpush_config.py b/client/tools/rhnpush/rhnpush_config.py
index 3562115..8f4e75b 100644
--- a/client/tools/rhnpush/rhnpush_config.py
+++ b/client/tools/rhnpush/rhnpush_config.py
@@ -54,7 +54,6 @@ class rhnpushConfigParser:
'channel' : '',
'cache_lifetime' : '600',
'new_cache' : '0',
- 'no_cache' : '0',
'extended_test' : '0',
'no_session_caching' : '0',
'proxy' : '',
diff --git a/client/tools/rhnpush/rhnpushrc b/client/tools/rhnpush/rhnpushrc
index 625a04f..30de125 100644
--- a/client/tools/rhnpush/rhnpushrc
+++ b/client/tools/rhnpush/rhnpushrc
@@ -64,9 +64,6 @@ cache_lifetime = 600
#Reset the cache
new_cache = 0
-#Disable user/pass caching.
-no_cache = 0
-
#Run the extended version of the test
extended_test = 0
commit ee1ac53ccef616aa27ebd456f06c5ce5379b3571
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jul 13 14:18:41 2012 +0200
fixed --no-session-caching option
diff --git a/client/tools/rhnpush/uploadLib.py b/client/tools/rhnpush/uploadLib.py
index 3c7bb32..04b4e3b 100644
--- a/client/tools/rhnpush/uploadLib.py
+++ b/client/tools/rhnpush/uploadLib.py
@@ -424,7 +424,7 @@ class UploadClass:
self.session = rhnpush_cache.RHNPushSession()
self.session.setSessionString(session)
- if not self.options.no_cache:
+ if not self.options.no_session_caching:
self.session.writeSession()
def authenticate(self):
11 years, 9 months
8 commits - java/code web/html
by Šimon Lukašík
java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml | 32 +-
java/code/src/com/redhat/rhn/domain/audit/XccdfTestResult.java | 28 +
java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffAction.java | 38 ++
java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java | 122 ++++++++
java/code/src/com/redhat/rhn/frontend/action/audit/scap/validation/xccdfDiff.xsd | 16 +
java/code/src/com/redhat/rhn/frontend/action/systems/audit/ListScapAction.java | 7
java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultCounts.java | 12
java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java | 46 +++
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 22 +
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 57 +++
java/code/src/com/redhat/rhn/manager/audit/ScapManager.java | 56 +--
java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultComparator.java | 143 ++++++++++
java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java | 110 +++++++
java/code/src/com/redhat/rhn/manager/audit/scap/TestResultDiffer.java | 116 ++++++++
java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml | 3
java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiff.jsp | 37 ++
java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp | 134 +++++++++
java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf | 71 +---
java/code/webapp/WEB-INF/pages/systems/details/audit/xccdfdetails.jsp | 15 +
java/code/webapp/WEB-INF/struts-config.xml | 22 +
web/html/nav/sitenav-authenticated.xml | 3
21 files changed, 1001 insertions(+), 89 deletions(-)
New commits:
commit 4a312bbe7e711ae4594b7cbe671d26a9ce08ea22
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Wed Jul 11 15:45:02 2012 +0200
Show XCCDF-diff icon on the XCCDF-Details page.
diff --git a/java/code/src/com/redhat/rhn/domain/audit/XccdfTestResult.java b/java/code/src/com/redhat/rhn/domain/audit/XccdfTestResult.java
index ceb251d..7c422c8 100644
--- a/java/code/src/com/redhat/rhn/domain/audit/XccdfTestResult.java
+++ b/java/code/src/com/redhat/rhn/domain/audit/XccdfTestResult.java
@@ -19,6 +19,8 @@ import java.util.Date;
import com.redhat.rhn.common.hibernate.HibernateFactory;
import com.redhat.rhn.domain.action.scap.ScapActionDetails;
import com.redhat.rhn.domain.server.Server;
+import com.redhat.rhn.manager.audit.ScapManager;
+import com.redhat.rhn.manager.audit.scap.RuleResultDiffer;
/**
@@ -37,6 +39,9 @@ public class XccdfTestResult {
private Date endTime;
private byte[] errors;
+ private Long comparableId = null;
+ private String diffIcon = null;
+
/**
* Getter for id
* @return Long to get
@@ -188,4 +193,27 @@ public class XccdfTestResult {
public String getErrrosContents() {
return HibernateFactory.getByteArrayContents(this.errors);
}
+
+ /**
+ * Return the TestResult with metadata similar to the this one
+ * @return id of testresult
+ */
+ public Long getComparableId() {
+ if (comparableId == null) {
+ comparableId = ScapManager.previousComparableTestResult(id);
+ }
+ return comparableId;
+ }
+
+ /**
+ * Return name of the list icon, which best refers to the state of diff.
+ * The diff between current TestResult and previous comparable TestResult.
+ * @return the result
+ */
+ public String getDiffIcon() {
+ if (diffIcon == null) {
+ diffIcon = new RuleResultDiffer(getComparableId(), id).overallComparison();
+ }
+ return diffIcon;
+ }
}
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index 05def74..a70da57 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -12084,6 +12084,12 @@ the <strong>Red Hat Enterprise Linux System Administration Guide.</stro
<trans-unit id="system.audit.xccdfdetails.jsp.unknown">
<source>Unknown</source>
</trans-unit>
+ <trans-unit id="system.audit.xccdfdetails.jsp.diff">
+ <source>diff to previous</source>
+ </trans-unit>
+ <trans-unit id="system.audit.xccdfdetails.jsp.nodiff">
+ <source>No comparable scan was found.</source>
+ </trans-unit>
<trans-unit id="system.audit.xccdfdetails.jsp.reschedule">
<source>reschedule</source>
</trans-unit>
diff --git a/java/code/webapp/WEB-INF/pages/systems/details/audit/xccdfdetails.jsp b/java/code/webapp/WEB-INF/pages/systems/details/audit/xccdfdetails.jsp
index fa07347..23826f8 100644
--- a/java/code/webapp/WEB-INF/pages/systems/details/audit/xccdfdetails.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/details/audit/xccdfdetails.jsp
@@ -13,6 +13,21 @@
<%@ include file="/WEB-INF/pages/common/fragments/systems/system-header.jspf" %>
<div class="toolbar">
+ <c:choose>
+ <c:when test="${not empty testResult.comparableId}">
+ <a href="/rhn/audit/scap/DiffSubmit.do?first=${testResult.comparableId}&second=${testResult.id}&view=changed">
+ <img src="/img/rhn-listicon-${testResult.diffIcon}.gif"
+ alt="<bean:message key="scapdiff.jsp.i.${current.diffIcon}"/>"
+ title="<bean:message key="scapdiff.jsp.i.${current.diffIcon}"/>"/>
+ <bean:message key="system.audit.xccdfdetails.jsp.diff"/>
+ </a>
+ </c:when>
+ <c:otherwise>
+ <bean:message key="system.audit.xccdfdetails.jsp.nodiff"/>
+ </c:otherwise>
+ </c:choose>
+ |
+
<a href="/rhn/systems/details/audit/ScheduleXccdf.do?sid=${param.sid}&path=${testResult.scapActionDetails.path}¶ms=${testResult.scapActionDetails.parametersContents}">
<img src="/img/restart.png" alt="<bean:message key="system.audit.xccdfdetails.jsp.reschedule"/>"/>
<bean:message key="system.audit.xccdfdetails.jsp.reschedule"/>
commit 5d6c7c23649c6157bb735a54c04dddfcdf439024
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Wed Jul 11 14:33:27 2012 +0200
Show icon when referencing to XCCDF-diff
The icon will be either:
- green - when there is no difference
- orange - when there is some difference
- red - when the second scan differs considerably
(exists some rule which started to fail)
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java b/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java
index 17273e8..11f87b8 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java
@@ -17,6 +17,7 @@ package com.redhat.rhn.frontend.dto;
import java.util.Date;
import com.redhat.rhn.manager.audit.ScapManager;
+import com.redhat.rhn.manager.audit.scap.RuleResultDiffer;
/**
* Simple DTO for transfering data from the DB to the UI through datasource.
@@ -32,6 +33,9 @@ public class XccdfTestResultDto extends XccdfTestResultCounts {
private Date completed;
private String path;
+ private Long comparableId = null;
+ private String diffIcon = null;
+
/**
* Returns id of xccdf:TestResult
* @return the xid
@@ -159,6 +163,21 @@ public class XccdfTestResultDto extends XccdfTestResultCounts {
* @return id of testresult
*/
public Long getComparableId() {
- return ScapManager.previousComparableTestResult(xid);
+ if (comparableId == null) {
+ comparableId = ScapManager.previousComparableTestResult(xid);
+ }
+ return comparableId;
+ }
+
+ /**
+ * Return name of the list icon, which best refers to the state of diff.
+ * The diff between current TestResult and previous comparable TestResult.
+ * @return the result
+ */
+ public String getDiffIcon() {
+ if (diffIcon == null) {
+ diffIcon = new RuleResultDiffer(getComparableId(), xid).overallComparison();
+ }
+ return diffIcon;
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index dc27959..05def74 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -11969,9 +11969,6 @@ the <strong>Red Hat Enterprise Linux System Administration Guide.</stro
<trans-unit id="system.audit.listscap.jsp.total">
<source>Total</source>
</trans-unit>
- <trans-unit id="system.audit.listscap.jsp.diff">
- <source>Diff</source>
- </trans-unit>
<trans-unit id="system.audit.listscap.jsp.legend">
<source>Xccdf Legend</source>
</trans-unit>
@@ -12225,6 +12222,15 @@ the <strong>Red Hat Enterprise Linux System Administration Guide.</stro
<trans-unit id="scapdiff.jsp.instructions">
<source>Specify Id of scans (the xid).</source>
</trans-unit>
+ <trans-unit id="scapdiff.jsp.i.checked">
+ <source>No difference compared to the previous.</source>
+ </trans-unit>
+ <trans-unit id="scapdiff.jsp.i.alert">
+ <source>There are differences to the previous.</source>
+ </trans-unit>
+ <trans-unit id="scapdiff.jsp.i.error">
+ <source>This scan found more failures than the previous.</source>
+ </trans-unit>
</group>
<!-- Action common -->
diff --git a/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultComparator.java b/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultComparator.java
index d7c4429..8d5e3a2 100644
--- a/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultComparator.java
+++ b/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultComparator.java
@@ -21,6 +21,11 @@ import com.redhat.rhn.frontend.dto.XccdfRuleResultDto;
* @version $Rev$
*/
public class RuleResultComparator {
+ private static final String PASS = "pass";
+ private static final String FAIL = "fail";
+ private static final String ERROR = "error";
+ private static final String INFORMATIONAL = "informational";
+ private static final String FIXED = "fixed";
/* The constructors ensure that at least one of the following items is not null. */
private XccdfRuleResultDto first;
@@ -109,4 +114,30 @@ public class RuleResultComparator {
public XccdfRuleResultDto getSecond() {
return second;
}
+
+ /**
+ * Returns true if the second rule-result evaluation was notably worse than the first.
+ * The result represents the top-level view of the comparison. The objective is
+ * to detect possible deterioration of the machine state or the suspicion of such.
+ * @return true - if the second evaluation is considered 'worse'
+ */
+ public boolean isTheSecondWorse() {
+ if (second == null) {
+ return false;
+ }
+ String sLabel = second.getLabel();
+ if (first == null) {
+ return FAIL.equals(sLabel) || ERROR.equals(sLabel);
+ }
+ String fLabel = first.getLabel();
+ if (fLabel.equals(sLabel)) {
+ return false;
+ }
+ if (FAIL.equals(sLabel) || ERROR.equals(sLabel)) {
+ return true;
+ }
+ return (PASS.equals(fLabel) || INFORMATIONAL.equals(fLabel) ||
+ FIXED.equals(fLabel)) && !(PASS.equals(sLabel) ||
+ INFORMATIONAL.equals(sLabel) || FIXED.equals(sLabel));
+ }
}
diff --git a/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java b/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java
index 2e2dd01..4e3ac4a 100644
--- a/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java
+++ b/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java
@@ -87,4 +87,24 @@ public class RuleResultDiffer {
}
return result;
}
+
+ /**
+ * Returns the top-level state of rule-result's comparison.
+ * @return the state
+ * "checked" = no difference
+ * "alert" = differences
+ * "error" = notable differences (may imply that the second scan is worse)
+ */
+ public String overallComparison() {
+ List<RuleResultComparator> difference = getData(true);
+ if (difference.isEmpty()) {
+ return "checked";
+ }
+ for (RuleResultComparator c : difference) {
+ if (c.isTheSecondWorse()) {
+ return "error";
+ }
+ }
+ return "alert";
+ }
}
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf
index 6327ed6..22d0f89 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf
@@ -4,17 +4,21 @@
<rl:list emptykey="system.audit.listscap.jsp.noscans">
<rl:decorator name="ElaborationDecorator"/>
- <rl:column headerkey="system.audit.listscap.jsp.diff" styleclass="center" headerclass="center">
+ <rl:column headerkey="system.audit.listscap.jsp.testresult">
<c:choose>
<c:when test="${not empty current.comparableId}">
<a href="/rhn/audit/scap/DiffSubmit.do?first=${current.comparableId}&second=${current.xid}&view=changed">
- ${current.comparableId}
- </a>
+ <img src="/img/rhn-listicon-${current.diffIcon}.gif"
+ alt="<bean:message key="scapdiff.jsp.i.${current.diffIcon}"/>"
+ title="<bean:message key="scapdiff.jsp.i.${current.diffIcon}"/>"/></a>
</c:when>
- <c:otherwise>-</c:otherwise>
- </c:choose>
- </rl:column>
- <rl:column headerkey="system.audit.listscap.jsp.testresult">
+ <c:otherwise>
+ <img src="/img/icon_checkin.gif"
+ alt="<bean:message key="system.audit.xccdfdetails.jsp.nodiff"/>"
+ title="<bean:message key="system.audit.xccdfdetails.jsp.nodiff"/>"/>
+ </c:otherwise>
+ </c:choose>
+
<a href="/rhn/systems/details/audit/XccdfDetails.do?sid=${param.sid}&xid=${current.xid}">
${current.testResult}
</a>
commit c97deda22650474d2af9898a625d1b38882b66f6
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Tue Jul 10 10:10:08 2012 +0200
Show XCCDF-diff results on List-Scans page.
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml
index 5102d79..b8916f1 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml
@@ -110,6 +110,23 @@
</query>
</mode>
+<mode name="previous_comparable_tr">
+ <query params="xid">
+ SELECT max(eq.id) as xid
+ FROM rhnXccdfTestResult ref,
+ rhnXccdfBenchmark refb,
+ rhnXccdfTestResult eq,
+ rhnXccdfBenchmark eqb
+ WHERE ref.id = :xid
+ AND eq.id < ref.id
+ AND ref.profile_id = eq.profile_id
+ AND ref.server_id = eq.server_id
+ AND ref.benchmark_id = refb.id
+ AND eq.benchmark_id = eqb.id
+ AND refb.identifier = eqb.identifier
+ </query>
+</mode>
+
<!-- Queries starting with rr_by_idents are binded dynamically
in ScapManager.ruleResultsByIdents() method. -->
<mode name="rr_by_idents" class="com.redhat.rhn.frontend.dto.XccdfRuleResultDto">
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java b/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java
index a539f0c..17273e8 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java
@@ -16,6 +16,8 @@ package com.redhat.rhn.frontend.dto;
import java.util.Date;
+import com.redhat.rhn.manager.audit.ScapManager;
+
/**
* Simple DTO for transfering data from the DB to the UI through datasource.
* @version $Rev$
@@ -151,4 +153,12 @@ public class XccdfTestResultDto extends XccdfTestResultCounts {
public void setPath(String pathIn) {
this.path = pathIn;
}
+
+ /**
+ * Return the TestResult with metadata similar to the this one
+ * @return id of testresult
+ */
+ public Long getComparableId() {
+ return ScapManager.previousComparableTestResult(xid);
+ }
}
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index d56b49d..dc27959 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -11969,6 +11969,9 @@ the <strong>Red Hat Enterprise Linux System Administration Guide.</stro
<trans-unit id="system.audit.listscap.jsp.total">
<source>Total</source>
</trans-unit>
+ <trans-unit id="system.audit.listscap.jsp.diff">
+ <source>Diff</source>
+ </trans-unit>
<trans-unit id="system.audit.listscap.jsp.legend">
<source>Xccdf Legend</source>
</trans-unit>
diff --git a/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java b/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
index 3db3dd9..8f2800f 100644
--- a/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
+++ b/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
@@ -132,6 +132,22 @@ public class ScapManager extends BaseManager {
}
/**
+ * Get a TestResult with metadata similar to the given.
+ * Which has been evaluated on the same machine just before the given.
+ * So it makes a sence to compare these two.
+ * @param testResultId referential TestResult
+ * @return result or null (if not any)
+ */
+ public static Long previousComparableTestResult(Long testResultId) {
+ SelectMode m = ModeFactory.getMode("scap_queries",
+ "previous_comparable_tr");
+ HashMap<String, Long> params = new HashMap<String, Long>();
+ params.put("xid", testResultId);
+ DataResult<Map> toReturn = m.execute(params);
+ return (Long) toReturn.get(0).get("xid");
+ }
+
+ /**
* Get xccdf:rule-result-s or xccdf:TestResult-s by ident's ids
* @param inParams direct parameters for query.
* user_id is the only compulsory
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf
index 974393e..6327ed6 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf
@@ -4,6 +4,16 @@
<rl:list emptykey="system.audit.listscap.jsp.noscans">
<rl:decorator name="ElaborationDecorator"/>
+ <rl:column headerkey="system.audit.listscap.jsp.diff" styleclass="center" headerclass="center">
+ <c:choose>
+ <c:when test="${not empty current.comparableId}">
+ <a href="/rhn/audit/scap/DiffSubmit.do?first=${current.comparableId}&second=${current.xid}&view=changed">
+ ${current.comparableId}
+ </a>
+ </c:when>
+ <c:otherwise>-</c:otherwise>
+ </c:choose>
+ </rl:column>
<rl:column headerkey="system.audit.listscap.jsp.testresult">
<a href="/rhn/systems/details/audit/XccdfDetails.do?sid=${param.sid}&xid=${current.xid}">
${current.testResult}
commit 73facd816a3888cca4975e574b1deef9b7968dd6
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Tue Jul 10 10:43:45 2012 +0200
Rewrite ListScap page query with Dto & elaborator.
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml
index 4a00164..5102d79 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml
@@ -12,22 +12,19 @@
</query>
</mode>
-<mode name="show_system_scans">
+<mode name="show_system_scans" class="com.redhat.rhn.frontend.dto.XccdfTestResultDto">
+ <elaborator name="testresult_counts"/>
<query params="sid">
- SELECT tr.id, tr.identifier as test_result, rrt.label, count(*) as figure,
- TO_CHAR(sa.completion_time, 'YYYY-MM-DD HH24:MI:SS') AS completion_time
+ SELECT tr.id as xid,
+ tr.identifier as test_result,
+ sa.completion_time as completed
FROM rhnXccdfTestresult tr,
- rhnXccdfRuleresult rr,
- rhnXccdfRuleresultType rrt,
rhnActionScap ras,
rhnServerAction sa
WHERE tr.server_id = :sid
- AND tr.id = rr.testresult_id
- AND rr.result_id = rrt.id
AND tr.action_scap_id = ras.id
AND sa.server_id = tr.server_id
AND sa.action_id = ras.action_id
- GROUP BY tr.id, tr.identifier, rrt.label, sa.completion_time
ORDER BY tr.id DESC
</query>
</mode>
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/audit/ListScapAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/audit/ListScapAction.java
index c1f7315..25ea384 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/audit/ListScapAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/audit/ListScapAction.java
@@ -23,10 +23,12 @@ import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
+import com.redhat.rhn.common.db.datasource.DataResult;
import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.struts.RhnHelper;
import com.redhat.rhn.frontend.taglibs.list.ListTagHelper;
+import com.redhat.rhn.frontend.taglibs.list.TagHelper;
import com.redhat.rhn.frontend.taglibs.list.helper.ListHelper;
import com.redhat.rhn.frontend.taglibs.list.helper.Listable;
import com.redhat.rhn.manager.audit.ScapManager;
@@ -62,6 +64,9 @@ public class ListScapAction extends ScapSetupAction implements Listable {
*/
public List getResult(RequestContext context) {
Server server = context.lookupAndBindServer();
- return ScapManager.allScans(server);
+ DataResult results = ScapManager.allScans(server);
+ TagHelper.bindElaboratorTo("groupSet", results.getElaborator(),
+ context.getRequest());
+ return results;
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultCounts.java b/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultCounts.java
index 2624792..4e7c263 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultCounts.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultCounts.java
@@ -169,6 +169,18 @@ public abstract class XccdfTestResultCounts extends BaseDto {
return getError() + getUnknown() + getNotchecked();
}
+ /**
+ * Get the total number of rule-results within given testResult
+ * @return the count
+ */
+ public Long getSum() {
+ Long sum = new Long(0);
+ for (Long i : (List<Long>) this.count) {
+ sum += i;
+ }
+ return sum;
+ }
+
private Long getCountOf(String resultLabel) {
Long result = getCountMap().get(resultLabel);
return (result != null) ? result : 0;
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java b/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java
index ec1a710..a539f0c 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java
@@ -24,6 +24,7 @@ public class XccdfTestResultDto extends XccdfTestResultCounts {
private Long xid;
private Long sid;
+ private String testResult;
private String serverName;
private String profile;
private Date completed;
@@ -70,6 +71,22 @@ public class XccdfTestResultDto extends XccdfTestResultCounts {
}
/**
+ * Returns xccdf idref of the TestResult
+ * @return the identifier
+ */
+ public String getTestResult() {
+ return testResult;
+ }
+
+ /**
+ * Sets the xccdf idref of the TestResult
+ * @param testResultIn to set
+ */
+ public void setTestResult(String testResultIn) {
+ this.testResult = testResultIn;
+ }
+
+ /**
* Returns name of the targeted system
* @return the name
*/
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
index 8ff7a04..3fe1dd9 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
@@ -7742,10 +7742,13 @@ Follow this url to see the full list of inactive systems:
<source>Matching Field Value</source>
</trans-unit>
+ <trans-unit id="xid">
+ <source>Xid</source>
+ </trans-unit>
<trans-unit id="testResult">
<source>Idref of TestResult</source>
</trans-unit>
- <trans-unit id="completionTime">
+ <trans-unit id="completed">
<source>Completion Time</source>
</trans-unit>
<trans-unit id="pass">
diff --git a/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java b/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
index 1e86614..3db3dd9 100644
--- a/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
+++ b/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
@@ -14,7 +14,6 @@
*/
package com.redhat.rhn.manager.audit;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
@@ -97,13 +96,12 @@ public class ScapManager extends BaseManager {
* @param server The system for which to search
* @return The list of scan results in brief
*/
- public static List allScans(Server server) {
+ public static DataResult allScans(Server server) {
SelectMode m = ModeFactory.getMode("scap_queries",
"show_system_scans");
HashMap params = new HashMap();
params.put("sid", server.getId());
- DataResult dr = m.execute(params);
- return transposeView(dr);
+ return makeDataResult(params, new HashMap(), null, m);
}
/**
@@ -252,35 +250,6 @@ public class ScapManager extends BaseManager {
return m.execute(params).size() >= 1;
}
- private static List<Map<String, Object>> transposeView(DataResult testResultsRaw) {
- List<Map<String, Object>> resultView = new ArrayList<Map<String, Object>>();
- Map<String, Object> currResult = null;
- for (Map row : (DataResult<Map>) testResultsRaw) {
- if (currResult != null &&
- ((Long) currResult.get("id")).equals(row.get("id"))) {
- String label = (String) row.get("label");
- Long figure = (Long) row.get("figure");
- currResult.put(label, figure);
- currResult.put("sum", ((Long) currResult.get("sum")) + figure);
- }
- else {
- if (currResult != null) {
- resultView.add(currResult);
- }
- currResult = new HashMap<String, Object>();
- currResult.put("id", row.get("id"));
- currResult.put("testResult", row.get("test_result"));
- currResult.put((String) row.get("label"), row.get("figure"));
- currResult.put("sum", row.get("figure"));
- currResult.put("completionTime", row.get("completion_time"));
- }
- }
- if (currResult != null) {
- resultView.add(currResult);
- }
- return resultView;
- }
-
private static HashSet<Long> idsInDataResultToSet(DataResult dataIn) {
HashSet<Long> result = new HashSet<Long>();
for (Map<String, Long> map : (List<Map<String, Long>>) dataIn) {
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf
index bbadbe9..974393e 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/audit/scap-list.jspf
@@ -2,14 +2,15 @@
<rhn:csrf />
<rl:list emptykey="system.audit.listscap.jsp.noscans">
+ <rl:decorator name="ElaborationDecorator"/>
<rl:column headerkey="system.audit.listscap.jsp.testresult">
- <a href="/rhn/systems/details/audit/XccdfDetails.do?sid=${param.sid}&xid=${current.id}">
+ <a href="/rhn/systems/details/audit/XccdfDetails.do?sid=${param.sid}&xid=${current.xid}">
${current.testResult}
</a>
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.completed">
- ${current.completionTime}
+ ${current.completed}
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.percentage">
<c:choose>
@@ -24,68 +25,38 @@
</c:choose>
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.pass.abb">
- <c:choose>
- <c:when test="${empty current.pass}">0</c:when>
- <c:otherwise>${current.pass}</c:otherwise>
- </c:choose>
+ ${current.pass}
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.fail.abb">
- <c:choose>
- <c:when test="${empty current.fail}">0</c:when>
- <c:otherwise>${current.fail}</c:otherwise>
- </c:choose>
+ ${current.fail}
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.error.abb">
- <c:choose>
- <c:when test="${empty current.error}">0</c:when>
- <c:otherwise>${current.error}</c:otherwise>
- </c:choose>
+ ${current.error}
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.unknown.abb">
- <c:choose>
- <c:when test="${empty current.unknown}">0</c:when>
- <c:otherwise>${current.unknown}</c:otherwise>
- </c:choose>
+ ${current.unknown}
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.notapplicable.abb">
- <c:choose>
- <c:when test="${empty current.notapplicable}">0</c:when>
- <c:otherwise>${current.notapplicable}</c:otherwise>
- </c:choose>
+ ${current.notapplicable}
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.notchecked.abb">
- <c:choose>
- <c:when test="${empty current.notchecked}">0</c:when>
- <c:otherwise>${current.notchecked}</c:otherwise>
- </c:choose>
+ ${current.notchecked}
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.notselected.abb">
- <c:choose>
- <c:when test="${empty current.notselected}">0</c:when>
- <c:otherwise>${current.notselected}</c:otherwise>
- </c:choose>
+ ${current.notselected}
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.informational.abb">
- <c:choose>
- <c:when test="${empty current.informational}">0</c:when>
- <c:otherwise>${current.informational}</c:otherwise>
- </c:choose>
+ ${current.informational}
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.fixed.abb">
- <c:choose>
- <c:when test="${empty current.fixed}">0</c:when>
- <c:otherwise>${current.fixed}</c:otherwise>
- </c:choose>
+ ${current.fixed}
</rl:column>
<rl:column headerkey="system.audit.listscap.jsp.total">
- <c:choose>
- <c:when test="${empty current.sum}">0</c:when>
- <c:otherwise>${current.sum}</c:otherwise>
- </c:choose>
+ ${current.sum}
</rl:column>
</rl:list>
<rl:csv name="groupSet"
- exportColumns="id,testResult,completionTime,pass,fail,error,unknown,notapplicable,notchecked,notselected,informational,fixed,sum"/>
+ exportColumns="xid,testResult,completed,pass,fail,error,unknown,notapplicable,notchecked,notselected,informational,fixed,sum"/>
</rl:listset>
<rhn:tooltip><bean:message key="system.audit.listscap.jsp.tooltip"/></rhn:tooltip>
commit 19be5aa0fdf18e44d04503f5d5de591a49eec54f
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Mon Jul 2 14:50:47 2012 +0200
XCCDF Diff shall compare also scan's metadata.
diff --git a/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java
index 5c25ee2..0dcb31d 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java
@@ -28,6 +28,7 @@ import org.apache.struts.action.ActionMessages;
import org.apache.struts.action.DynaActionForm;
import com.redhat.rhn.domain.audit.ScapFactory;
+import com.redhat.rhn.domain.audit.XccdfTestResult;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.struts.RhnAction;
@@ -39,6 +40,7 @@ import com.redhat.rhn.frontend.taglibs.list.helper.Listable;
import com.redhat.rhn.manager.audit.ScapManager;
import com.redhat.rhn.manager.audit.scap.RuleResultComparator;
import com.redhat.rhn.manager.audit.scap.RuleResultDiffer;
+import com.redhat.rhn.manager.audit.scap.TestResultDiffer;
/**
* Static action page.
@@ -48,6 +50,7 @@ public class XccdfDiffSubmitAction extends RhnAction implements Listable {
private static final String SECOND = "second";
private static final String VIEW = "view";
private static final String FULL = "full";
+ private static final String CHANGED = "changed";
private static final String MISSING_MSG = "message.xccdfdiff.missing";
/** {@inheritDoc} */
@@ -67,6 +70,7 @@ public class XccdfDiffSubmitAction extends RhnAction implements Listable {
Long first = (Long) form.get(FIRST);
Long second = (Long) form.get(SECOND);
User user = context.getLoggedInUser();
+ String view = getView(request);
if (!ScapManager.isAvailableToUser(user, first)) {
errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
@@ -82,14 +86,19 @@ public class XccdfDiffSubmitAction extends RhnAction implements Listable {
mapping.findForward("error"), request.getParameterMap());
}
- request.setAttribute(VIEW, getView(request));
+ XccdfTestResult firstTr = ScapFactory.lookupTestResultById(first);
+ XccdfTestResult secondTr = ScapFactory.lookupTestResultById(second);
+ request.setAttribute("metadataList", FULL.equals(view) ?
+ TestResultDiffer.diff(firstTr, secondTr) :
+ TestResultDiffer.diff(firstTr, secondTr, CHANGED.equals(view)));
+ request.setAttribute(VIEW, view);
ListHelper helper = new ListHelper(this, request);
helper.execute();
request.setAttribute(ListTagHelper.PARENT_URL, request.getRequestURI() +
"?" + FIRST + "=" + first + "&" + SECOND + "=" + second +
- "&" + VIEW + "=" + getView(request));
+ "&" + VIEW + "=" + view);
return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
}
@@ -103,7 +112,7 @@ public class XccdfDiffSubmitAction extends RhnAction implements Listable {
if (FULL.equals(view)) {
return differ.getData();
}
- return differ.getData("changed".equals(view));
+ return differ.getData(CHANGED.equals(view));
}
private String getView(HttpServletRequest request) {
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index d6a1b9b..d56b49d 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -12093,6 +12093,9 @@ the <strong>Red Hat Enterprise Linux System Administration Guide.</stro
<context-group name="ctx">
<context context-type="sourcefile">View of SCAP XCCDF Scan</context>
</context-group>
+ <trans-unit id="xccdfdiff.fieldnames">
+ <source>Field Names</source>
+ </trans-unit>
<trans-unit id="xccdfdiff.firstscan">
<source>First Scan</source>
</trans-unit>
diff --git a/java/code/src/com/redhat/rhn/manager/audit/scap/TestResultDiffer.java b/java/code/src/com/redhat/rhn/manager/audit/scap/TestResultDiffer.java
new file mode 100644
index 0000000..5750c78
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/manager/audit/scap/TestResultDiffer.java
@@ -0,0 +1,116 @@
+/**
+ * Copyright (c) 2012 Red Hat, Inc.
+ *
+ * This software is licensed to you under the GNU General Public License,
+ * version 2 (GPLv2). There is NO WARRANTY for this software, express or
+ * implied, including the implied warranties of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+ * along with this software; if not, see
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *
+ * Red Hat trademarks are not licensed under GPLv2. No permission is
+ * granted to use or replicate Red Hat trademarks that are incorporated
+ * in this software or its documentation.
+ */
+package com.redhat.rhn.manager.audit.scap;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import com.redhat.rhn.domain.audit.XccdfTestResult;
+
+/**
+ * TestResultDiffer - Facility for comparison of xccdf:TestResult
+ */
+public class TestResultDiffer {
+ private static final String DIFFERS = "differs";
+ private static final String FIRST = "first";
+ private static final String SECOND = "second";
+
+ private TestResultDiffer() { }
+
+ /**
+ * Make a full diff of TestResult's metadata
+ * @param first the first TestResult to compare
+ * @param second the second TestResult to compare
+ * @return the diff
+ */
+ public static List<HashMap<String, Object>> diff(XccdfTestResult first,
+ XccdfTestResult second) {
+ List<HashMap<String, Object>> result = new ArrayList<HashMap<String, Object>>();
+ result.add(buildItem("id", linkToScan(first), linkToScan(second)));
+ result.add(buildItem("system.audit.xccdfdetails.jsp.benchmarkid",
+ first.getBenchmark().getIdentifier(),
+ second.getBenchmark().getIdentifier()));
+ result.add(buildItem("system.audit.xccdfdetails.jsp.version",
+ first.getBenchmark().getVersion(),
+ second.getBenchmark().getVersion()));
+ result.add(buildItem("system.audit.xccdfdetails.jsp.profileid",
+ first.getProfile().getIdentifier(),
+ second.getProfile().getIdentifier()));
+ result.add(buildItem("system.audit.xccdfdetails.jsp.title",
+ first.getProfile().getTitle(),
+ second.getProfile().getTitle()));
+ result.add(buildItem("system.audit.xccdfdetails.jsp.path",
+ first.getScapActionDetails().getPath(),
+ second.getScapActionDetails().getPath()));
+ result.add(buildItem("system.audit.schedulexccdf.jsp.arguments",
+ first.getScapActionDetails().getParametersContents(),
+ second.getScapActionDetails().getParametersContents()));
+ result.add(buildItem("systemlist.jsp.system",
+ linkToSystemListScap(first), linkToSystemListScap(second)));
+ result.add(buildItem("configoverview.jsp.scheduledBy", first
+ .getScapActionDetails().getParentAction().getSchedulerUser().getLogin(),
+ second.getScapActionDetails().getParentAction().getSchedulerUser()
+ .getLogin()));
+ result.add(buildItem("system.audit.xccdfdetails.jsp.started",
+ first.getStartTime(), second.getStartTime()));
+ result.add(buildItem("system.audit.xccdfdetails.jsp.completed",
+ first.getEndTime(), second.getEndTime()));
+ return result;
+ }
+
+ /**
+ * Make a subset of diff between TestResult's metadata
+ * @param first the first TestResult to compare
+ * @param second the second TestResult to compare
+ * @param differs defines resulting subset
+ * True - filters out items which does not differ
+ * False - filters out items which differs
+ * @return the result
+ */
+ public static List<HashMap<String, Object>> diff(XccdfTestResult first,
+ XccdfTestResult second, Boolean differs) {
+ if (differs == null) {
+ return diff(first, second);
+ }
+ List<HashMap<String, Object>> result = new ArrayList<HashMap<String, Object>>();
+ for (HashMap<String, Object> item : diff(first, second)) {
+ if (differs.equals(item.get(DIFFERS))) {
+ result.add(item);
+ }
+ }
+ return result;
+ }
+
+ private static HashMap<String, Object> buildItem(String localizationString,
+ Object first, Object second) {
+ HashMap<String, Object> item = new HashMap<String, Object>();
+ item.put("msg", localizationString);
+ item.put(FIRST, first == null ? "" : first);
+ item.put(SECOND, second == null ? "" : second);
+ item.put(DIFFERS, !item.get(FIRST).equals(item.get(SECOND)));
+ return item;
+ }
+
+ private static String linkToScan(XccdfTestResult tr) {
+ return "<a href=\"/rhn/systems/details/audit/XccdfDetails.do?sid=" +
+ tr.getServer().getId() + "&xid=" + tr.getId() + "\">" +
+ tr.getId() + "</a>";
+ }
+
+ private static String linkToSystemListScap(XccdfTestResult tr) {
+ return "<a href=\"/rhn/systems/details/audit/ListScap.do?sid=" +
+ tr.getServer().getId() + "\">" + tr.getServer().getName() + "</a>";
+ }
+}
diff --git a/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp b/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp
index 966ae1a..ed2446f 100644
--- a/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp
+++ b/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp
@@ -51,9 +51,45 @@ div.differs {
<rl:listset name="groupSet" legend="xccdf">
<rhn:csrf/>
+ <h2><bean:message key="system.audit.xccdfdetails.jsp.header"/></h2>
+
+ <rl:list emptykey="generic.jsp.none" dataset="metadataList" name="1">
+ <rl:column headerkey="xccdfdiff.fieldnames">
+ <c:if test="${not empty current.msg}">
+ <strong><bean:message key="${current.msg}"/>:</strong>
+ </c:if>
+ </rl:column>
+
+ <rl:column headerkey="xccdfdiff.firstscan">
+ <c:if test="${current.differs == true}"><div class="differs"></c:if>
+ <c:choose>
+ <c:when test="${not empty current.first}">
+ ${current.first}
+ </c:when>
+ <c:otherwise>
+ <c:out value="-"/>
+ </c:otherwise>
+ </c:choose>
+ <c:if test="${current.differs == true}"></div></c:if>
+ </rl:column>
+
+ <rl:column headerkey="xccdfdiff.secondscan">
+ <c:if test="${current.differs == true}"><div class="differs"></c:if>
+ <c:choose>
+ <c:when test="${not empty current.second}">
+ ${current.second}
+ </c:when>
+ <c:otherwise>
+ <c:out value="-"/>
+ </c:otherwise>
+ </c:choose>
+ <c:if test="${current.differs == true}"></div></c:if>
+ </rl:column>
+ </rl:list>
+
<h2><bean:message key="system.audit.xccdfdetails.jsp.xccdfrules"/></h2>
- <rl:list emptykey="generic.jsp.none">
+ <rl:list emptykey="generic.jsp.none" name="2">
<rl:decorator name="PageSizeDecorator"/>
<rl:column headerkey="system.audit.xccdfdetails.jsp.idref" sortattr="documentIdref"
commit 451e1cae5ed6eb35246fbf6d3898789ed5295e3a
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Mon Jul 2 11:26:16 2012 +0200
Make sure that the user has permission to see the scan (when diffing).
diff --git a/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java
index d0d4b6e..5c25ee2 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java
@@ -23,8 +23,12 @@ import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
import org.apache.struts.action.DynaActionForm;
+import com.redhat.rhn.domain.audit.ScapFactory;
+import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.struts.RhnAction;
import com.redhat.rhn.frontend.struts.RhnHelper;
@@ -32,6 +36,7 @@ import com.redhat.rhn.frontend.struts.RhnValidationHelper;
import com.redhat.rhn.frontend.taglibs.list.ListTagHelper;
import com.redhat.rhn.frontend.taglibs.list.helper.ListHelper;
import com.redhat.rhn.frontend.taglibs.list.helper.Listable;
+import com.redhat.rhn.manager.audit.ScapManager;
import com.redhat.rhn.manager.audit.scap.RuleResultComparator;
import com.redhat.rhn.manager.audit.scap.RuleResultDiffer;
@@ -43,12 +48,14 @@ public class XccdfDiffSubmitAction extends RhnAction implements Listable {
private static final String SECOND = "second";
private static final String VIEW = "view";
private static final String FULL = "full";
+ private static final String MISSING_MSG = "message.xccdfdiff.missing";
/** {@inheritDoc} */
public ActionForward execute(ActionMapping mapping,
ActionForm formIn,
HttpServletRequest request,
HttpServletResponse response) {
+ RequestContext context = new RequestContext(request);
DynaActionForm form = (DynaActionForm) formIn;
ActionErrors errors = RhnValidationHelper.validateDynaActionForm(this, form);
if (!errors.isEmpty()) {
@@ -59,7 +66,22 @@ public class XccdfDiffSubmitAction extends RhnAction implements Listable {
Long first = (Long) form.get(FIRST);
Long second = (Long) form.get(SECOND);
- // TODO: ensure that scans of given ids exist
+ User user = context.getLoggedInUser();
+
+ if (!ScapManager.isAvailableToUser(user, first)) {
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
+ MISSING_MSG, first, user.getLogin()));
+ }
+ if (!ScapManager.isAvailableToUser(user, second)) {
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
+ MISSING_MSG, second, user.getLogin()));
+ }
+ if (!errors.isEmpty()) {
+ getStrutsDelegate().saveMessages(request, errors);
+ return getStrutsDelegate().forwardParams(
+ mapping.findForward("error"), request.getParameterMap());
+ }
+
request.setAttribute(VIEW, getView(request));
ListHelper helper = new ListHelper(this, request);
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index 13233a7..d6a1b9b 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -6114,6 +6114,12 @@ value for this entitlement, excluding the default organization's consumption.</s
<context context-type="sourcefile">/rhn/schedule/ActionDetails.do</context>
</context-group>
</trans-unit>
+ <trans-unit id="message.xccdfdiff.missing">
+ <source>XCCDF scan of id={0} could not be found for user {1}.</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">/rhn/audit/scap/Diff.do</context>
+ </context-group>
+ </trans-unit>
<trans-unit id="message.entitlement.missing">
<source>One or more of the selected systems lack the {0} entitlement.</source>
<context-group name="ctx">
diff --git a/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java b/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
index d8080bf..1e86614 100644
--- a/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
+++ b/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
@@ -240,9 +240,10 @@ public class ScapManager extends BaseManager {
* Checks if the user has permission to see the XCCDF scan.
* @param user User being checked.
* @param testResultId ID of the XCCDF scan being checked.
+ * @return true - when available
* @retutn true if the user can access the TestResult, false otherwise.
*/
- private static boolean isAvailableToUser(User user, Long testResultId) {
+ public static boolean isAvailableToUser(User user, Long testResultId) {
SelectMode m = ModeFactory.getMode("scap_queries",
"is_available_to_user");
HashMap<String, Long> params = new HashMap<String, Long>();
commit cda3a638cbfa06730c5c5b99676ae25da3a9bdff
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Fri Jun 29 17:04:11 2012 +0200
Diff should show: either all, changed, or invariant items
diff --git a/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java
index 58b1b54..d0d4b6e 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java
@@ -41,6 +41,8 @@ import com.redhat.rhn.manager.audit.scap.RuleResultDiffer;
public class XccdfDiffSubmitAction extends RhnAction implements Listable {
private static final String FIRST = "first";
private static final String SECOND = "second";
+ private static final String VIEW = "view";
+ private static final String FULL = "full";
/** {@inheritDoc} */
public ActionForward execute(ActionMapping mapping,
@@ -58,12 +60,14 @@ public class XccdfDiffSubmitAction extends RhnAction implements Listable {
Long first = (Long) form.get(FIRST);
Long second = (Long) form.get(SECOND);
// TODO: ensure that scans of given ids exist
+ request.setAttribute(VIEW, getView(request));
ListHelper helper = new ListHelper(this, request);
helper.execute();
request.setAttribute(ListTagHelper.PARENT_URL, request.getRequestURI() +
- "?" + FIRST + "=" + first + "&" + SECOND + "=" + second);
+ "?" + FIRST + "=" + first + "&" + SECOND + "=" + second +
+ "&" + VIEW + "=" + getView(request));
return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
}
@@ -72,7 +76,16 @@ public class XccdfDiffSubmitAction extends RhnAction implements Listable {
public List<RuleResultComparator> getResult(RequestContext context) {
Long first = context.getRequiredParam(FIRST);
Long second = context.getRequiredParam(SECOND);
+ String view = getView(context.getRequest());
RuleResultDiffer differ = new RuleResultDiffer(first, second);
- return differ.getData();
+ if (FULL.equals(view)) {
+ return differ.getData();
+ }
+ return differ.getData("changed".equals(view));
+ }
+
+ private String getView(HttpServletRequest request) {
+ String view = request.getParameter(VIEW);
+ return (view == null || "".equals(view)) ? FULL : view;
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index 539746f..13233a7 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -12093,6 +12093,12 @@ the <strong>Red Hat Enterprise Linux System Administration Guide.</stro
<trans-unit id="xccdfdiff.secondscan">
<source>Second Scan</source>
</trans-unit>
+ <trans-unit id="xccdfdiff.view.changed">
+ <source>Only Changed Items</source>
+ </trans-unit>
+ <trans-unit id="xccdfdiff.view.same">
+ <source>Only Invariant Items</source>
+ </trans-unit>
</group>
<group>
diff --git a/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java b/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java
index 0449cdd..2e2dd01 100644
--- a/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java
+++ b/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java
@@ -70,4 +70,21 @@ public class RuleResultDiffer {
public List<RuleResultComparator> getData() {
return new ArrayList<RuleResultComparator>(dataMap.values());
}
+
+ /**
+ * Get list of comparators betwen rule-results (a subset).
+ * @param differs defines resulting subset.
+ * True - filters out those which does not differ.
+ * False - filters out those which differs.
+ * @return results
+ */
+ public List<RuleResultComparator> getData(Boolean differs) {
+ List<RuleResultComparator> result = new ArrayList<RuleResultComparator>();
+ for (RuleResultComparator item : dataMap.values()) {
+ if (item.getDiffers() == differs) {
+ result.add(item);
+ }
+ }
+ return result;
+ }
}
diff --git a/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp b/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp
index 32e14a0..966ae1a 100644
--- a/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp
+++ b/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp
@@ -25,8 +25,34 @@ div.differs {
<bean:message key="scapdiff.jsp.toolbar"/>
</rhn:toolbar>
+<div style="float: right;">
+ <c:if test="${view != 'full'}">
+ <a href="/rhn/audit/scap/DiffSubmit.do?first=${param.first}&second=${param.second}&view=full">
+ </c:if>
+ <bean:message key="diff.jsp.full"/>
+ <c:if test="${view != 'full'}"></a></c:if>
+
+ |
+ <c:if test="${view != 'changed'}">
+ <a href="/rhn/audit/scap/DiffSubmit.do?first=${param.first}&second=${param.second}&view=changed">
+ </c:if>
+ <bean:message key="xccdfdiff.view.changed"/>
+ <c:if test="${view != 'changed'}"></a></c:if>
+
+ |
+ <c:if test="${view != 'same'}">
+ <a href="/rhn/audit/scap/DiffSubmit.do?first=${param.first}&second=${param.second}&view=same">
+ </c:if>
+ <bean:message key="xccdfdiff.view.same"/>
+ <c:if test="${view != 'same'}"></a></c:if>
+</div>
+
+
<rl:listset name="groupSet" legend="xccdf">
<rhn:csrf/>
+
+ <h2><bean:message key="system.audit.xccdfdetails.jsp.xccdfrules"/></h2>
+
<rl:list emptykey="generic.jsp.none">
<rl:decorator name="PageSizeDecorator"/>
commit c716c4428502308d28cc354f5cabc0e4226e16a2
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Tue Jun 26 12:20:01 2012 +0200
OpenSCAP Integration -- XCCDF Scan Diff
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml
index 53a9a35..4a00164 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml
@@ -568,7 +568,7 @@
WHERE rim.rresult_id = :rr_id
AND rim.ident_id = xi.id
AND xi.identsystem_id = xis.id
- ORDER BY xis.system
+ ORDER BY xis.system, xi.identifier
</query>
</mode>
diff --git a/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffAction.java b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffAction.java
new file mode 100644
index 0000000..7b53a94
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffAction.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2012 Red Hat, Inc.
+ *
+ * This software is licensed to you under the GNU General Public License,
+ * version 2 (GPLv2). There is NO WARRANTY for this software, express or
+ * implied, including the implied warranties of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+ * along with this software; if not, see
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *
+ * Red Hat trademarks are not licensed under GPLv2. No permission is
+ * granted to use or replicate Red Hat trademarks that are incorporated
+ * in this software or its documentation.
+ */
+package com.redhat.rhn.frontend.action.audit.scap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+
+import com.redhat.rhn.frontend.struts.RhnHelper;
+
+/**
+ * Static action page.
+ */
+public class XccdfDiffAction extends org.apache.struts.action.Action {
+
+ /** {@inheritDoc} */
+ public ActionForward execute(ActionMapping mapping,
+ ActionForm formIn,
+ HttpServletRequest request,
+ HttpServletResponse response) {
+ return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java
new file mode 100644
index 0000000..58b1b54
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/XccdfDiffSubmitAction.java
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2012 Red Hat, Inc.
+ *
+ * This software is licensed to you under the GNU General Public License,
+ * version 2 (GPLv2). There is NO WARRANTY for this software, express or
+ * implied, including the implied warranties of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+ * along with this software; if not, see
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *
+ * Red Hat trademarks are not licensed under GPLv2. No permission is
+ * granted to use or replicate Red Hat trademarks that are incorporated
+ * in this software or its documentation.
+ */
+package com.redhat.rhn.frontend.action.audit.scap;
+
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.struts.action.ActionErrors;
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.DynaActionForm;
+
+import com.redhat.rhn.frontend.struts.RequestContext;
+import com.redhat.rhn.frontend.struts.RhnAction;
+import com.redhat.rhn.frontend.struts.RhnHelper;
+import com.redhat.rhn.frontend.struts.RhnValidationHelper;
+import com.redhat.rhn.frontend.taglibs.list.ListTagHelper;
+import com.redhat.rhn.frontend.taglibs.list.helper.ListHelper;
+import com.redhat.rhn.frontend.taglibs.list.helper.Listable;
+import com.redhat.rhn.manager.audit.scap.RuleResultComparator;
+import com.redhat.rhn.manager.audit.scap.RuleResultDiffer;
+
+/**
+ * Static action page.
+ */
+public class XccdfDiffSubmitAction extends RhnAction implements Listable {
+ private static final String FIRST = "first";
+ private static final String SECOND = "second";
+
+ /** {@inheritDoc} */
+ public ActionForward execute(ActionMapping mapping,
+ ActionForm formIn,
+ HttpServletRequest request,
+ HttpServletResponse response) {
+ DynaActionForm form = (DynaActionForm) formIn;
+ ActionErrors errors = RhnValidationHelper.validateDynaActionForm(this, form);
+ if (!errors.isEmpty()) {
+ getStrutsDelegate().saveMessages(request, errors);
+ return getStrutsDelegate().forwardParams(
+ mapping.findForward("error"), request.getParameterMap());
+ }
+
+ Long first = (Long) form.get(FIRST);
+ Long second = (Long) form.get(SECOND);
+ // TODO: ensure that scans of given ids exist
+
+ ListHelper helper = new ListHelper(this, request);
+ helper.execute();
+
+ request.setAttribute(ListTagHelper.PARENT_URL, request.getRequestURI() +
+ "?" + FIRST + "=" + first + "&" + SECOND + "=" + second);
+
+ return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
+ }
+
+ /** {@inheritDoc} */
+ public List<RuleResultComparator> getResult(RequestContext context) {
+ Long first = context.getRequiredParam(FIRST);
+ Long second = context.getRequiredParam(SECOND);
+ RuleResultDiffer differ = new RuleResultDiffer(first, second);
+ return differ.getData();
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/action/audit/scap/validation/xccdfDiff.xsd b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/validation/xccdfDiff.xsd
new file mode 100644
index 0000000..419322c
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/action/audit/scap/validation/xccdfDiff.xsd
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+
+<schema targetNamespace="http://rhn.redhat.com"
+ xmlns="http://www.w3.org/1999/XMLSchema"
+ xmlns:rhn="http://rhn.redhat.com">
+ <attribute name="first">
+ <simpleType baseType="long">
+ <minInclusive value="1"/>
+ </simpleType>
+ </attribute>
+ <attribute name="second">
+ <simpleType baseType="long">
+ <minInclusive value="1"/>
+ </simpleType>
+ </attribute>
+</schema>
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
index 6110fe1..8ff7a04 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml
@@ -379,6 +379,12 @@ http://www.oasis-open.org/committees/xliff/documents/xliff-core-1.1.xsd"
<context context-type="sourcefile">Navigation Menu</context>
</context-group>
</trans-unit>
+ <trans-unit id="XCCDF Diff">
+<source>XCCDF Diff</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">Navigation Menu</context>
+ </context-group>
+ </trans-unit>
<trans-unit id="audit.nav.logreview">
<source>Log Review</source>
<context-group name="ctx">
@@ -1406,6 +1412,17 @@ http://www.oasis-open.org/committees/xliff/documents/xliff-core-1.1.xsd"
<context context-type="sourcefile">/rhn/systems/details/audit/ScheduleXccdf.do</context>
</context-group>
</trans-unit>
+ <group>
+ <context-group name="ctx">
+ <context context-type="sourcefile">/rhn/audit/scap/Diff.do</context>
+ </context-group>
+ <trans-unit id="first">
+ <source>First Scan Id</source>
+ </trans-unit>
+ <trans-unit id="second">
+ <source>Second Scan Id</source>
+ </trans-unit>
+ </group>
<trans-unit id="message.perms_updated">
<source>Permissions Updated</source>
<context-group name="ctx">
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index b404edc..539746f 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -12085,6 +12085,18 @@ the <strong>Red Hat Enterprise Linux System Administration Guide.</stro
<group>
<context-group name="ctx">
+ <context context-type="sourcefile">View of SCAP XCCDF Scan</context>
+ </context-group>
+ <trans-unit id="xccdfdiff.firstscan">
+ <source>First Scan</source>
+ </trans-unit>
+ <trans-unit id="xccdfdiff.secondscan">
+ <source>Second Scan</source>
+ </trans-unit>
+ </group>
+
+ <group>
+ <context-group name="ctx">
<context context-type="sourcefile">Detailed view of single SCAP XCCDF rule-result</context>
</context-group>
<trans-unit id="system.audit.ruledetails.jsp.heading">
@@ -12182,6 +12194,21 @@ the <strong>Red Hat Enterprise Linux System Administration Guide.</stro
</trans-unit>
</group>
+ <group>
+ <context-group name="ctx">
+ <context context-type="sourcefile">Diff of OpenSCAP XCCDF scans</context>
+ </context-group>
+ <trans-unit id="scapdiff.jsp.toolbar">
+ <source>OpenSCAP Diff</source>
+ </trans-unit>
+ <trans-unit id="scapdiff.jsp.summary">
+ <source>Compare XCCDF scans rule by rule.</source>
+ </trans-unit>
+ <trans-unit id="scapdiff.jsp.instructions">
+ <source>Specify Id of scans (the xid).</source>
+ </trans-unit>
+ </group>
+
<!-- Action common -->
<group>
<context-group name="ctx">
diff --git a/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java b/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
index 3c71e14..d8080bf 100644
--- a/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
+++ b/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
@@ -111,7 +111,7 @@ public class ScapManager extends BaseManager {
* @param testResultId of XccdfTestResult of the test for which to search
* @return the list of rule-results
*/
- public static DataResult ruleResultsPerScan(Long testResultId) {
+ public static List<XccdfRuleResultDto> ruleResultsPerScan(Long testResultId) {
SelectMode m = ModeFactory.getMode("scap_queries",
"show_ruleresults");
HashMap params = new HashMap();
diff --git a/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultComparator.java b/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultComparator.java
new file mode 100644
index 0000000..d7c4429
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultComparator.java
@@ -0,0 +1,112 @@
+/**
+ * Copyright (c) 2012 Red Hat, Inc.
+ *
+ * This software is licensed to you under the GNU General Public License,
+ * version 2 (GPLv2). There is NO WARRANTY for this software, express or
+ * implied, including the implied warranties of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+ * along with this software; if not, see
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *
+ * Red Hat trademarks are not licensed under GPLv2. No permission is
+ * granted to use or replicate Red Hat trademarks that are incorporated
+ * in this software or its documentation.
+ */
+package com.redhat.rhn.manager.audit.scap;
+
+import com.redhat.rhn.frontend.dto.XccdfRuleResultDto;
+
+/**
+ * RuleResultComparator
+ * @version $Rev$
+ */
+public class RuleResultComparator {
+
+ /* The constructors ensure that at least one of the following items is not null. */
+ private XccdfRuleResultDto first;
+ private XccdfRuleResultDto second;
+
+ /**
+ * Constructor
+ * @param firstIn xccdf:rule-result to compare
+ * @param secondIn xccdf:rule-result to compate
+ */
+ public RuleResultComparator(XccdfRuleResultDto firstIn, XccdfRuleResultDto secondIn) {
+ if (firstIn == null && secondIn == null) {
+ throw new IllegalArgumentException();
+ }
+ first = firstIn;
+ addSecond(secondIn);
+ }
+
+ /**
+ * Constructor
+ * @param firstIn xccdf:rule-result to compare. The other is null for now.
+ */
+ public RuleResultComparator(XccdfRuleResultDto firstIn) {
+ if (firstIn == null) {
+ throw new IllegalArgumentException();
+ }
+ first = firstIn;
+ second = null;
+ }
+
+ /**
+ * Add second item for comparison
+ * @param secondIn xccdf:rule-result to compare
+ */
+ public void addSecond(XccdfRuleResultDto secondIn) {
+ if (second != null || secondIn == null) {
+ throw new IllegalArgumentException();
+ }
+ if (first != null && second != null &&
+ first.getDocumentIdref() != second.getDocumentIdref()) {
+ throw new IllegalArgumentException();
+ }
+ second = secondIn;
+ }
+
+ /**
+ * Get document Idref of xccdf:rule assigned with this comparator
+ * @return the idref
+ */
+ public String getDocumentIdref() {
+ return (first != null ? first : second).getDocumentIdref();
+ }
+
+ /**
+ * Is there difference between first and second
+ * @return true if the two rule-result-s differ
+ * either on xccdf:idents or result of evaluation
+ */
+ public Boolean getDiffers() {
+ return (first == null || second == null ||
+ !first.getLabel().equals(second.getLabel()) ||
+ !first.getIdentsString().equals(second.getIdentsString()));
+ }
+
+ /**
+ * Is there is difference between first and second idents
+ * @return true if the two rule-result-s differ only in xccdf:idents
+ */
+ public Boolean getOnlyIdentDiffers() {
+ return getDiffers() && first != null && second != null &&
+ first.getLabel().equals(second.getLabel());
+ }
+
+ /**
+ * Get first xccdf:rule-result
+ * @return the answer
+ */
+ public XccdfRuleResultDto getFirst() {
+ return first;
+ }
+
+ /**
+ * Get second xccdf:rule-result
+ * @return the answer
+ */
+ public XccdfRuleResultDto getSecond() {
+ return second;
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java b/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java
new file mode 100644
index 0000000..0449cdd
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/manager/audit/scap/RuleResultDiffer.java
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2012 Red Hat, Inc.
+ *
+ * This software is licensed to you under the GNU General Public License,
+ * version 2 (GPLv2). There is NO WARRANTY for this software, express or
+ * implied, including the implied warranties of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+ * along with this software; if not, see
+ * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+ *
+ * Red Hat trademarks are not licensed under GPLv2. No permission is
+ * granted to use or replicate Red Hat trademarks that are incorporated
+ * in this software or its documentation.
+ */
+package com.redhat.rhn.manager.audit.scap;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import com.redhat.rhn.frontend.dto.XccdfRuleResultDto;
+import com.redhat.rhn.manager.audit.ScapManager;
+
+/**
+ * RuleResultDiffer - Facility for comparison of xccdf:rule-result-s
+ * assigned with given xccdf:TestResult-s
+ */
+public class RuleResultDiffer {
+ private HashMap<String, RuleResultComparator> dataMap;
+
+ /**
+ * Constructor
+ * @param firstTestResultId id of TestResult to compare
+ * @param secondTestResultId id of TestResult to compare
+ */
+ public RuleResultDiffer(Long firstTestResultId, Long secondTestResultId) {
+ dataMap = new HashMap<String, RuleResultComparator>();
+ addFirstList(ScapManager.ruleResultsPerScan(firstTestResultId));
+ addSecondList(ScapManager.ruleResultsPerScan(secondTestResultId));
+ }
+
+ private void addFirstList(List<XccdfRuleResultDto> listIn) {
+ for (XccdfRuleResultDto rule : listIn) {
+ String idref = rule.getDocumentIdref();
+ if (dataMap.containsKey(idref)) {
+ throw new IllegalArgumentException("Multiple rules with idref=" + idref);
+ }
+ dataMap.put(idref, new RuleResultComparator(rule));
+ }
+ }
+
+ private void addSecondList(List<XccdfRuleResultDto> listIn) {
+ for (XccdfRuleResultDto rule : listIn) {
+ String idref = rule.getDocumentIdref();
+ RuleResultComparator comp = dataMap.get(idref);
+ if (comp == null) {
+ comp = new RuleResultComparator(null, rule);
+ }
+ else {
+ comp.addSecond(rule);
+ }
+ dataMap.put(idref, comp);
+ }
+ }
+
+ /**
+ * Get list of comparators between rule-results
+ * @return results
+ */
+ public List<RuleResultComparator> getData() {
+ return new ArrayList<RuleResultComparator>(dataMap.values());
+ }
+}
diff --git a/java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml b/java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml
index c734eec..5f248e7 100644
--- a/java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml
+++ b/java/code/webapp/WEB-INF/nav/sitenav-authenticated.xml
@@ -177,6 +177,9 @@
<rhn-tab-directory>/rhn/audit</rhn-tab-directory>
<rhn-tab name="OpenSCAP" url="/rhn/audit/ListXccdf.do">
<rhn-tab name="All Scans" url="/rhn/audit/ListXccdf.do"/>
+ <rhn-tab name="XCCDF Diff" url="/rhn/audit/scap/Diff.do">
+ <rhn-tab-url>/rhn/audit/scap/DiffSubmit.do</rhn-tab-url>
+ </rhn-tab>
<rhn-tab name="Advanced Search" url="/rhn/audit/scap/Search.do"/>
</rhn-tab>
<rhn-tab name="audit.nav.logreview" url="/rhn/audit/Overview.do" acl="not is_satellite()">
diff --git a/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiff.jsp b/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiff.jsp
new file mode 100644
index 0000000..5e23a85
--- /dev/null
+++ b/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiff.jsp
@@ -0,0 +1,37 @@
+<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %>
+<%@ taglib uri="http://rhn.redhat.com/tags/list" prefix="rl" %>
+<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
+
+<html:xhtml/>
+<html>
+<head>
+</head>
+<body>
+
+<rhn:toolbar base="h1" img="/img/rhn-icon-search.gif" imgAlt="search.alt.img">
+ <bean:message key="scapdiff.jsp.toolbar"/>
+</rhn:toolbar>
+
+<p><bean:message key="scapdiff.jsp.summary"/></p>
+<p><bean:message key="scapdiff.jsp.instructions"/></p>
+
+<html:form method="get" action="/audit/scap/DiffSubmit.do">
+ <rhn:csrf/>
+
+ <table class="details">
+ <tr>
+ <th><bean:message key="xccdfdiff.firstscan"/>:</th>
+ <td><html:text property="first"/></td>
+ </tr>
+ <tr>
+ <th><bean:message key="xccdfdiff.secondscan"/>:</th>
+ <td><html:text property="second"/>
+ <html:submit/>
+ </td>
+ </table>
+</html:form>
+</body>
+</html>
+
diff --git a/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp b/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp
new file mode 100644
index 0000000..32e14a0
--- /dev/null
+++ b/java/code/webapp/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp
@@ -0,0 +1,72 @@
+<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %>
+<%@ taglib uri="http://rhn.redhat.com/tags/list" prefix="rl" %>
+<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
+
+<html:xhtml/>
+<html>
+<head>
+<style>
+div.differs {
+ background-color: #f5f3c4;
+ display: inline-block;
+ padding-bottom: 2px;
+ padding-left: 9px;
+ padding-right: 9px;
+ margin-bottom: 0px;
+ border-radius: 10px;
+}
+</style>
+</head>
+<body>
+
+<rhn:toolbar base="h1" img="/img/rhn-icon-search.gif" imgAlt="search.alt.img">
+ <bean:message key="scapdiff.jsp.toolbar"/>
+</rhn:toolbar>
+
+<rl:listset name="groupSet" legend="xccdf">
+ <rhn:csrf/>
+ <rl:list emptykey="generic.jsp.none">
+ <rl:decorator name="PageSizeDecorator"/>
+
+ <rl:column headerkey="system.audit.xccdfdetails.jsp.idref" sortattr="documentIdref"
+ sortable="true" styleclass="first-column">
+ <c:out value="${current.documentIdref}"/>
+ </rl:column>
+ <rl:column headerkey="xccdfdiff.firstscan" styleclass="center" headerclass="center">
+ <c:if test="${current.differs == true}"><div class="differs"></c:if>
+ <c:choose>
+ <c:when test="${not empty current.first}">
+ <a href="/rhn/systems/details/audit/RuleDetails.do?sid=${current.first.testResult.server.id}&rrid=${current.first.id}">
+ <c:out value="${current.first.label}"/>
+ </a>
+ <c:if test="${current.onlyIdentDiffers}"><c:out value="(${current.first.identsString})"/></c:if>
+ </c:when>
+ <c:otherwise>
+ <c:out value="-"/>
+ </c:otherwise>
+ </c:choose>
+ </rl:column>
+ <c:if test="${current.differs == true}"></div></c:if>
+ <rl:column headerkey="xccdfdiff.secondscan" styleclass="center" headerclass="center">
+ <c:if test="${current.differs == true}"><div class="differs"></c:if>
+ <c:choose>
+ <c:when test="${not empty current.second}">
+ <a href="/rhn/systems/details/audit/RuleDetails.do?sid=${current.second.testResult.server.id}&rrid=${current.second.id}">
+ <c:out value="${current.second.label}"/>
+ </a>
+ <c:if test="${current.onlyIdentDiffers}"><c:out value="${current.second.identsString}"/></c:if>
+ </c:when>
+ <c:otherwise>
+ <c:out value="-"/>
+ </c:otherwise>
+ </c:choose>
+ <c:if test="${current.differs == true}"></div></c:if>
+ </rl:column>
+ </rl:list>
+</rl:listset>
+
+</body>
+</html>
+
diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml
index bbc4b34..cf844bd 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -254,6 +254,11 @@
<form-property name="end_minute" type="java.lang.Integer"/>
<form-property name="end_am_pm" type="java.lang.Integer"/>
</form-bean>
+ <form-bean name="xccdfDiff"
+ type="com.redhat.rhn.frontend.struts.ScrubbingDynaActionForm">
+ <form-property name="first" type="java.lang.Long"/>
+ <form-property name="second" type="java.lang.Long"/>
+ </form-bean>
<form-bean name="errataSearchForm"
type="com.redhat.rhn.frontend.struts.ScrubbingDynaActionForm">
<form-property name="search_string" type="java.lang.String"/>
@@ -1978,6 +1983,23 @@
<forward name="success" path="/audit/scap/Search.do" redirect="true" />
</action>
+ <action path="/audit/scap/Diff"
+ name="xccdfDiff"
+ scope="request"
+ input="/WEB-INF/pages/audit/scap/xccdfdiff.jsp"
+ type="com.redhat.rhn.frontend.action.audit.scap.XccdfDiffAction">
+ <forward name="default" path="/WEB-INF/pages/audit/scap/xccdfdiff.jsp"/>
+ </action>
+
+ <action path="/audit/scap/DiffSubmit"
+ name="xccdfDiff"
+ scope="request"
+ input="/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp"
+ type="com.redhat.rhn.frontend.action.audit.scap.XccdfDiffSubmitAction">
+ <forward name="default" path="/WEB-INF/pages/audit/scap/xccdfdiffsubmit.jsp"/>
+ <forward name="error" path="/audit/scap/Diff.do"/>
+ </action>
+
<!-- ===== ERRATA ===== -->
<action path="/errata/Search"
name="errataSearchForm"
diff --git a/web/html/nav/sitenav-authenticated.xml b/web/html/nav/sitenav-authenticated.xml
index f2ae908..4d24d85 100644
--- a/web/html/nav/sitenav-authenticated.xml
+++ b/web/html/nav/sitenav-authenticated.xml
@@ -123,6 +123,9 @@
<rhn-tab-directory>/rhn/audit</rhn-tab-directory>
<rhn-tab name="OpenSCAP" url="/rhn/audit/ListXccdf.do">
<rhn-tab name="All Scans" url="/rhn/audit/ListXccdf.do"/>
+ <rhn-tab name="XCCDF Diff" url="/rhn/audit/scap/Diff.do">
+ <rhn-tab-url>/rhn/audit/scap/DiffSubmit.do</rhn-tab-url>
+ </rhn-tab>
<rhn-tab name="Advanced Search" url="/rhn/audit/scap/Search.do"/>
</rhn-tab>
<rhn-tab name="audit.nav.logreview" url="/rhn/audit/Overview.do" acl="not is_satellite()">
11 years, 9 months
Changes to 'refs/tags/spacewalk-jpp-workaround-1.0.4-1'
by Tomas Lestach
Tag 'spacewalk-jpp-workaround-1.0.4-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2012-07-13 09:54 +0000
Tagging package [spacewalk-jpp-workaround] version [1.0.4-1] in directory [spec-tree/spacewalk-jpp-workaround/].
Changes since rhnpush-5.5.48-1:
Tomas Lestach (2):
let the workaround package require fedora struts to ensure the struts-* provides
Automatic commit of package [spacewalk-jpp-workaround] release [1.0.4-1].
---
rel-eng/packages/spacewalk-jpp-workaround | 2 -
spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec | 11 +++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
---
11 years, 9 months
2 commits - rel-eng/packages spec-tree/spacewalk-jpp-workaround
by Tomas Lestach
rel-eng/packages/spacewalk-jpp-workaround | 2 -
spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec | 11 +++++++---
2 files changed, 9 insertions(+), 4 deletions(-)
New commits:
commit d273a2a2f3ecb99a48201b35826cce109c7999b3
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Jul 13 11:54:16 2012 +0200
Automatic commit of package [spacewalk-jpp-workaround] release [1.0.4-1].
diff --git a/rel-eng/packages/spacewalk-jpp-workaround b/rel-eng/packages/spacewalk-jpp-workaround
index b6ddfb8..b9f3e36 100644
--- a/rel-eng/packages/spacewalk-jpp-workaround
+++ b/rel-eng/packages/spacewalk-jpp-workaround
@@ -1 +1 @@
-1.0.3-1 spec-tree/spacewalk-jpp-workaround/
+1.0.4-1 spec-tree/spacewalk-jpp-workaround/
diff --git a/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec b/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
index a1e8466..1ef8133 100644
--- a/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
+++ b/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
@@ -1,5 +1,5 @@
Name: spacewalk-jpp-workaround
-Version: 1.0.3
+Version: 1.0.4
Release: 1%{?dist}
Summary: Workaround package to fulfill jpackage broken dependencies
@@ -57,6 +57,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Jul 13 2012 Tomas Lestach <tlestach(a)redhat.com> 1.0.4-1
+- let the workaround package require fedora struts to ensure the struts-*
+ provides
+
* Fri Jul 13 2012 Tomas Lestach <tlestach(a)redhat.com> 1.0.3-1
- fix typo
commit 60199c09dbdce0b53b9caf65c0205b58a381273c
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Jul 13 11:52:49 2012 +0200
let the workaround package require fedora struts to ensure the struts-* provides
- changing version to 1.3.10 to make sure fedora struts package gets required
diff --git a/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec b/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
index 1bdcae0..a1e8466 100644
--- a/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
+++ b/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
@@ -30,8 +30,9 @@ Obsoletes: spring < 1:1.2.9.0
%endif
%if 0%{?fedora} && 0%{?fedora} >= 17
-Provides: struts-taglib = 1.3.8
-Provides: struts-tiles = 1.3.8
+Provides: struts-taglib = 1.3.10
+Provides: struts-tiles = 1.3.10
+Requires: struts >= 1.3.10
%endif
%description
11 years, 9 months
Changes to 'refs/tags/rhnpush-5.5.48-1'
by Michael Mraka
Tag 'rhnpush-5.5.48-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2012-07-13 09:47 +0000
Tagging package [rhnpush] version [5.5.48-1] in directory [client/tools/rhnpush/].
Changes since spacewalk-jpp-workaround-1.0.3-1:
Michael Mraka (4):
remove trailing '/' from from archive dir
838044 - solaris2mpm needs zipfile with ZIP64 extension
838044 - solaris2mpm on RHEL5 is not supported
Automatic commit of package [rhnpush] release [5.5.48-1].
---
client/tools/rhnpush/archive.py | 8 +++++++-
client/tools/rhnpush/rhnpush.spec | 15 +++++++++++++--
rel-eng/packages/rhnpush | 2 +-
3 files changed, 21 insertions(+), 4 deletions(-)
---
11 years, 9 months
client/tools rel-eng/packages
by Michael Mraka
client/tools/rhnpush/rhnpush.spec | 6 +++++-
rel-eng/packages/rhnpush | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 1d0350d76ee53f7329f3f51adfb296a410f606f5
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jul 13 11:47:06 2012 +0200
Automatic commit of package [rhnpush] release [5.5.48-1].
diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec
index dc45b33..c6a1a5a 100644
--- a/client/tools/rhnpush/rhnpush.spec
+++ b/client/tools/rhnpush/rhnpush.spec
@@ -4,7 +4,7 @@ Name: rhnpush
Group: Applications/System
License: GPLv2
URL: http://fedorahosted.org/spacewalk
-Version: 5.5.47
+Version: 5.5.48
Release: 1%{?dist}
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -63,6 +63,10 @@ rm -rf $RPM_BUILD_ROOT
%doc COPYING
%changelog
+* Fri Jul 13 2012 Michael Mraka <michael.mraka(a)redhat.com> 5.5.48-1
+- 838044 - solaris2mpm on RHEL5 is not supported
+- remove trailing '/' from from archive dir
+
* Tue Jun 26 2012 Michael Mraka <michael.mraka(a)redhat.com> 5.5.47-1
- reuse UploadError from uploadLib
- removed functions not used in rhnpush/rhn-package-manager
diff --git a/rel-eng/packages/rhnpush b/rel-eng/packages/rhnpush
index 0e34df8..88264fe 100644
--- a/rel-eng/packages/rhnpush
+++ b/rel-eng/packages/rhnpush
@@ -1 +1 @@
-5.5.47-1 client/tools/rhnpush/
+5.5.48-1 client/tools/rhnpush/
11 years, 9 months
3 commits - client/tools
by Michael Mraka
client/tools/rhnpush/archive.py | 8 +++++++-
client/tools/rhnpush/rhnpush.spec | 9 ++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
New commits:
commit 29bce43816a01e8ab22b24452f6a81ac864d4787
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jul 13 11:16:23 2012 +0200
838044 - solaris2mpm on RHEL5 is not supported
diff --git a/client/tools/rhnpush/rhnpush.spec b/client/tools/rhnpush/rhnpush.spec
index 38c7e7f..dc45b33 100644
--- a/client/tools/rhnpush/rhnpush.spec
+++ b/client/tools/rhnpush/rhnpush.spec
@@ -39,6 +39,11 @@ rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT/%{rhnroot}
make -f Makefile.rhnpush install PREFIX=$RPM_BUILD_ROOT ROOT=%{rhnroot} \
MANDIR=%{_mandir}
+%if 0%{?rhel} && 0%{?rhel} < 6
+rm -fv $RPM_BUILD_ROOT%{_bindir}/solaris2mpm
+rm -fv $RPM_BUILD_ROOT%{rhnroot}/rhnpush/solaris2mpm.py*
+rm -fv $RPM_BUILD_ROOT%{_mandir}/man8/solaris2mpm.8*
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
@@ -49,10 +54,12 @@ rm -rf $RPM_BUILD_ROOT
%{rhnroot}/rhnpush/*
%attr(755,root,root) %{_bindir}/rhnpush
%attr(755,root,root) %{_bindir}/rpm2mpm
-%attr(755,root,root) %{_bindir}/solaris2mpm
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/sysconfig/rhn/rhnpushrc
%{_mandir}/man8/rhnpush.8*
+%if 0%{?fedora} || 0%{?rhel} > 5
+%attr(755,root,root) %{_bindir}/solaris2mpm
%{_mandir}/man8/solaris2mpm.8*
+%endif
%doc COPYING
%changelog
commit 8aa015a5f281b92772476a9233ec281299bc8af5
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Jul 13 11:09:15 2012 +0200
838044 - solaris2mpm needs zipfile with ZIP64 extension
diff --git a/client/tools/rhnpush/archive.py b/client/tools/rhnpush/archive.py
index 491b068..67c4951 100644
--- a/client/tools/rhnpush/archive.py
+++ b/client/tools/rhnpush/archive.py
@@ -22,6 +22,11 @@ import tempfile
import select
import zipfile
import tarfile
+import sys
+
+if not hasattr(zipfile, 'ZIP64_LIMIT'):
+ sys.stderr.write("%s requires zipfile with ZIP64 support.\n" % sys.argv[0])
+ sys.exit(3)
# exceptions -------------------------------------------------------------
commit 2709293dc2a2ee550751706f5a5eb6c23827375a
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Jul 12 16:23:58 2012 +0200
remove trailing '/' from from archive dir
diff --git a/client/tools/rhnpush/archive.py b/client/tools/rhnpush/archive.py
index 873c870..491b068 100644
--- a/client/tools/rhnpush/archive.py
+++ b/client/tools/rhnpush/archive.py
@@ -240,7 +240,8 @@ class ZipParser(ArchiveParser):
def _explode(self, archive):
"""Explode zip archive"""
- self._archive_dir = os.path.join(self._temp_dir, self._get_archive_dir())
+ self._archive_dir = os.path.join(self._temp_dir,
+ self._get_archive_dir()).rstrip('/')
try:
self.zip_file.extractall(self._temp_dir)
11 years, 9 months
Changes to 'refs/tags/spacewalk-jpp-workaround-1.0.3-1'
by Tomas Lestach
Tag 'spacewalk-jpp-workaround-1.0.3-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2012-07-13 09:29 +0000
Tagging package [spacewalk-jpp-workaround] version [1.0.3-1] in directory [spec-tree/spacewalk-jpp-workaround/].
Changes since spacewalk-jpp-workaround-1.0.2-1:
Tomas Lestach (2):
fix typo
Automatic commit of package [spacewalk-jpp-workaround] release [1.0.3-1].
---
rel-eng/packages/spacewalk-jpp-workaround | 2 +-
spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
---
11 years, 9 months
2 commits - rel-eng/packages spec-tree/spacewalk-jpp-workaround
by Tomas Lestach
rel-eng/packages/spacewalk-jpp-workaround | 2 +-
spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 803fecfdb392697b1463d27ae82f0e6354024334
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Jul 13 11:29:14 2012 +0200
Automatic commit of package [spacewalk-jpp-workaround] release [1.0.3-1].
diff --git a/rel-eng/packages/spacewalk-jpp-workaround b/rel-eng/packages/spacewalk-jpp-workaround
index 2384e2b..b6ddfb8 100644
--- a/rel-eng/packages/spacewalk-jpp-workaround
+++ b/rel-eng/packages/spacewalk-jpp-workaround
@@ -1 +1 @@
-1.0.2-1 spec-tree/spacewalk-jpp-workaround/
+1.0.3-1 spec-tree/spacewalk-jpp-workaround/
diff --git a/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec b/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
index ac4ab89..1bdcae0 100644
--- a/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
+++ b/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
@@ -1,5 +1,5 @@
Name: spacewalk-jpp-workaround
-Version: 1.0.2
+Version: 1.0.3
Release: 1%{?dist}
Summary: Workaround package to fulfill jpackage broken dependencies
@@ -56,6 +56,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Jul 13 2012 Tomas Lestach <tlestach(a)redhat.com> 1.0.3-1
+- fix typo
+
* Fri Jul 13 2012 Tomas Lestach <tlestach(a)redhat.com> 1.0.2-1
- let our workaround package provide struts-taglib and struts-tiles for fc17
- %%defattr is not needed since rpm 4.4
commit b2d5e561c109fd825ce824565b64c065ac261c87
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Fri Jul 13 11:20:41 2012 +0200
fix typo
diff --git a/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec b/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
index 83114da..ac4ab89 100644
--- a/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
+++ b/spec-tree/spacewalk-jpp-workaround/spacewalk-jpp-workaround.spec
@@ -29,7 +29,7 @@ Provides: spring = 1:1.2.9.0
Obsoletes: spring < 1:1.2.9.0
%endif
-%if 0%{?fedora} && 0%{fedora} >= 17
+%if 0%{?fedora} && 0%{?fedora} >= 17
Provides: struts-taglib = 1.3.8
Provides: struts-tiles = 1.3.8
%endif
11 years, 9 months