2 commits - java/code
by Šimon Lukašík
java/code/src/com/redhat/rhn/domain/audit/ScapFactory.java | 16 +
java/code/src/com/redhat/rhn/domain/audit/XccdfTestResult.hbm.xml | 11 +
java/code/src/com/redhat/rhn/frontend/action/systems/audit/ScapSetupAction.java | 3
java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SerializerRegistry.java | 1
java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/XccdfTestResultSerializer.java | 95 ++++++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/scap/SystemScapHandler.java | 25 ++
java/code/webapp/WEB-INF/pages/systems/details/audit/listscap.jsp | 2
java/code/webapp/WEB-INF/pages/systems/details/audit/schedulexccdf.jsp | 2
8 files changed, 153 insertions(+), 2 deletions(-)
New commits:
commit 2bbe98bfbb906dc381911a42ce8f8a52b9f1b3f4
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Mon Apr 30 10:43:21 2012 +0200
Requires are better defined elsewhere than in template.
Furthermore, the package is called spacewalk-oscap.
diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/audit/ScapSetupAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/audit/ScapSetupAction.java
index db201ad..31fb82c 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/audit/ScapSetupAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/audit/ScapSetupAction.java
@@ -27,11 +27,14 @@ import com.redhat.rhn.manager.audit.ScapManager;
public abstract class ScapSetupAction extends RhnAction {
private static final String SCAP_ENABLED = "scapEnabled";
+ private static final String REQUIRED_PKG = "requiredPackage";
+ private static final String SPACEWALK_OSCAP = "spacewalk-oscap";
protected void setupScapEnablementInfo(RequestContext context) {
Server server = context.lookupAndBindServer();
User user = context.getLoggedInUser();
boolean enabled = ScapManager.isScapEnabled(server, user);
context.getRequest().setAttribute(SCAP_ENABLED, enabled);
+ context.getRequest().setAttribute(REQUIRED_PKG, SPACEWALK_OSCAP);
}
}
diff --git a/java/code/webapp/WEB-INF/pages/systems/details/audit/listscap.jsp b/java/code/webapp/WEB-INF/pages/systems/details/audit/listscap.jsp
index cd2a122..c8bbbc4 100644
--- a/java/code/webapp/WEB-INF/pages/systems/details/audit/listscap.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/details/audit/listscap.jsp
@@ -17,7 +17,7 @@
<c:choose>
<c:when test="${not requestScope.scapEnabled}">
<p><bean:message key="system.audit.listscap.jsp.missing"
- arg0="spacewalk-openscap"/></p>
+ arg0="${requiredPackage}"/></p>
<br/>
</c:when>
</c:choose>
diff --git a/java/code/webapp/WEB-INF/pages/systems/details/audit/schedulexccdf.jsp b/java/code/webapp/WEB-INF/pages/systems/details/audit/schedulexccdf.jsp
index 1253be0..012808c 100644
--- a/java/code/webapp/WEB-INF/pages/systems/details/audit/schedulexccdf.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/details/audit/schedulexccdf.jsp
@@ -15,7 +15,7 @@
<c:choose>
<c:when test="${not requestScope.scapEnabled}">
<p><bean:message key="system.audit.listscap.jsp.missing"
- arg0="spacewalk-openscap"/></p>
+ arg0="${requiredPackage}"/></p>
</c:when>
<c:otherwise>
<html:form method="post" action="/systems/details/audit/ScheduleXccdf.do">
commit d0bd8f093894e45860a5688a4efed8338175ae9f
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Fri Apr 27 17:53:48 2012 +0200
API: Show OpenSCAP XCCDF Details.
diff --git a/java/code/src/com/redhat/rhn/domain/audit/ScapFactory.java b/java/code/src/com/redhat/rhn/domain/audit/ScapFactory.java
index 4086ecc..769506e 100644
--- a/java/code/src/com/redhat/rhn/domain/audit/ScapFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/audit/ScapFactory.java
@@ -19,6 +19,7 @@ import java.util.HashMap;
import org.apache.log4j.Logger;
import com.redhat.rhn.common.hibernate.HibernateFactory;
+import com.redhat.rhn.domain.user.User;
/**
* ScapFactory - the singleton class used to fetch and store
@@ -44,6 +45,21 @@ public class ScapFactory extends HibernateFactory {
}
/**
+ * Lookup a XCCDF TestResult by the id.
+ * Make sure that a given user can access the data.
+ * @param xid of the XCCDF TestResult to search for
+ * @param user user searching the results
+ * @return the XccdfTestResult found
+ */
+ public static XccdfTestResult lookupTestResultByIdAndUser(Long xid, User user) {
+ HashMap<String, Long> params = new HashMap<String, Long>();
+ params.put("xid", xid);
+ params.put("user_id", user.getId());
+ return (XccdfTestResult)singleton.lookupObjectByNamedQuery(
+ "XccdfTestResult.findByIdAndUser", params);
+ }
+
+ /**
* Get the Logger for the derived class so log messages
* show up on the correct class.
* @return Logger
diff --git a/java/code/src/com/redhat/rhn/domain/audit/XccdfTestResult.hbm.xml b/java/code/src/com/redhat/rhn/domain/audit/XccdfTestResult.hbm.xml
index 6568b21..2492d4c 100644
--- a/java/code/src/com/redhat/rhn/domain/audit/XccdfTestResult.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/audit/XccdfTestResult.hbm.xml
@@ -30,4 +30,15 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
<query name="XccdfTestResult.findById">
<![CDATA[from com.redhat.rhn.domain.audit.XccdfTestResult as a where a.id = :xid]]>
</query>
+
+ <sql-query name="XccdfTestResult.findByIdAndUser">
+ <![CDATA[SELECT {tr.*}
+ FROM rhnXccdfTestResult {tr},
+ rhnUserServerPerms usp
+ WHERE tr.id = :xid
+ AND usp.server_id = tr.server_id
+ AND usp.user_id = :user_id
+ ]]>
+ <return alias="tr" class="com.redhat.rhn.domain.audit.XccdfTestResult" />
+ </sql-query>
</hibernate-mapping>
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SerializerRegistry.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SerializerRegistry.java
index aaebfbb..07908e7 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SerializerRegistry.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SerializerRegistry.java
@@ -117,6 +117,7 @@ public class SerializerRegistry {
SERIALIZER_CLASSES.add(DistChannelMapSerializer.class);
SERIALIZER_CLASSES.add(ContentSourceSerializer.class);
SERIALIZER_CLASSES.add(XccdfTestResultDtoSerializer.class);
+ SERIALIZER_CLASSES.add(XccdfTestResultSerializer.class);
}
/**
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/XccdfTestResultSerializer.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/XccdfTestResultSerializer.java
new file mode 100644
index 0000000..babc498
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/XccdfTestResultSerializer.java
@@ -0,0 +1,95 @@
+/**
+ * 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.xmlrpc.serializer;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import redstone.xmlrpc.XmlRpcCustomSerializer;
+import redstone.xmlrpc.XmlRpcException;
+import redstone.xmlrpc.XmlRpcSerializer;
+
+import com.redhat.rhn.domain.action.Action;
+import com.redhat.rhn.domain.action.scap.ScapActionDetails;
+import com.redhat.rhn.domain.audit.XccdfBenchmark;
+import com.redhat.rhn.domain.audit.XccdfProfile;
+import com.redhat.rhn.domain.audit.XccdfTestResult;
+import com.redhat.rhn.frontend.xmlrpc.serializer.util.SerializerHelper;
+
+
+/**
+ * XccdfTestResultSerializer
+ * @version $Rev$
+ * @xmlrpc.doc
+ * #struct("OpenSCAP XCCDF Scan")
+ * #prop_desc("int", "xid", "XCCDF TestResult id")
+ * #prop_desc("int", "sid", "serverId")
+ * #prop_desc("int", "action_id", "Id of the parent action.")
+ * #prop_desc("string", "path", "Path to XCCDF document")
+ * #prop_desc("string", "oscap_parameters", "oscap command-line arguments.")
+ * #prop_desc("string", "test_result", "Identifier of XCCDF TestResult.")
+ * #prop_desc("string", "benchmark", "Identifier of XCCDF Benchmark.")
+ * #prop_desc("string", "benchmark_version" , "Version of the Benchmark.")
+ * #prop_desc("string", "profile", "Identifier of XCCDF Profile.")
+ * #prop_desc("string", "profile_title", "Title of XCCDF Profile.")
+ * #prop_desc($date, "start_time", "Client machine time of scan start.")
+ * #prop_desc($date, "end_time", "Client machine time of scan completion.")
+ * #prop_desc("string", "errors", "Stderr output of scan.")
+ * #struct_end()
+ */
+public class XccdfTestResultSerializer implements XmlRpcCustomSerializer {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Class getSupportedClass() {
+ return XccdfTestResult.class;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void serialize(Object value, Writer output,
+ XmlRpcSerializer builtInSerializer) throws XmlRpcException, IOException {
+ XccdfTestResult testResult = (XccdfTestResult) value;
+ ScapActionDetails actionDetails = testResult.getScapActionDetails();
+ XccdfBenchmark benchmark = testResult.getBenchmark();
+ XccdfProfile profile = testResult.getProfile();
+ Action parentAction = actionDetails.getParentAction();
+
+ SerializerHelper helper = new SerializerHelper(builtInSerializer);
+ addToHelper(helper, "xid", testResult.getId());
+ addToHelper(helper, "sid", testResult.getServer().getId());
+ addToHelper(helper, "path", actionDetails.getPath());
+ addToHelper(helper, "oscap_parameters", actionDetails.getParametersContents());
+ addToHelper(helper, "test_result", testResult.getIdentifier());
+ addToHelper(helper, "benchmark", benchmark.getIdentifier());
+ addToHelper(helper, "benchmark_version", benchmark.getVersion());
+ addToHelper(helper, "profile", profile.getIdentifier());
+ addToHelper(helper, "profile_title", profile.getTitle());
+ addToHelper(helper, "start_time", testResult.getStartTime());
+ addToHelper(helper, "end_time", testResult.getEndTime());
+ addToHelper(helper, "errors", testResult.getErrrosContents());
+ addToHelper(helper, "action_id", parentAction.getId());
+ helper.writeTo(output);
+ }
+
+ private static void addToHelper(SerializerHelper helper, String label, Object value) {
+ if (value != null) {
+ helper.add(label, value);
+ }
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/scap/SystemScapHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/scap/SystemScapHandler.java
index 393a0c2..f9dc629 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/scap/SystemScapHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/scap/SystemScapHandler.java
@@ -20,7 +20,10 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import com.redhat.rhn.FaultException;
import com.redhat.rhn.domain.action.scap.ScapAction;
+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.dto.XccdfTestResultDto;
import com.redhat.rhn.frontend.xmlrpc.BaseHandler;
@@ -62,6 +65,28 @@ public class SystemScapHandler extends BaseHandler {
}
/**
+ * Get Details of given OpenSCAP XCCDF scan.
+ * @param sessionKey The session key.
+ * @param xid The id of XCCDF scan.
+ * @return a detasil of OpenSCAP XCCDF scan.
+ *
+ * @xmlrpc.doc Get details of given OpenSCAP XCCDF scan.
+ * @xmlrpc.param #session_key()
+ * @xmlrpc.param #param("int", "Id of XCCDF scan (xid).")
+ * @xmlrpc.returntype $XccdfTestResultSerializer
+ */
+ public XccdfTestResult getXccdfScanDetails(String sessionKey, Integer xid) {
+ User loggedInUser = getLoggedInUser(sessionKey);
+ XccdfTestResult testResult = ScapFactory.lookupTestResultByIdAndUser(new Long(xid),
+ loggedInUser);
+ if (testResult == null) {
+ throw new FaultException(-1, "scanDoesNotExists",
+ "Scan of id=" + xid + " does not exists or permission error.");
+ }
+ return testResult;
+ }
+
+ /**
* Run OpenSCAP XCCDF Evaluation on a given list of servers
* @param sessionKey The session key.
* @param serverIds The list of server ids,
11 years, 12 months
java/code
by Milan Zazrivec
java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java | 6 -
java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/XmlRpcConfigChannelHelper.java | 6 -
java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/system/SystemDetailsHandler.java | 32 +++++-----
java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ServerActionSerializer.java | 8 +-
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 16 ++---
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/config/ServerConfigHandler.java | 6 -
6 files changed, 37 insertions(+), 37 deletions(-)
New commits:
commit 3a2d61fefa63e6376c7808a93df9326b56d8adc7
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Fri Apr 27 18:34:41 2012 +0200
811470 - proper use of xml entities in documentation
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
index a435ee4..7674fa8 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/ConfigChannelHandler.java
@@ -362,9 +362,9 @@ public class ConfigChannelHandler extends BaseHandler {
* @param path the path of the given text file.
* @param isDir true if this is a directory path, false if its to be a file path
* @param data a map containing properties pertaining to the given path..
- * for directory paths - 'data' will hold values for ->
+ * for directory paths - 'data' will hold values for ->
* owner, group, permissions
- * for file paths - 'data' will hold values for->
+ * for file paths - 'data' will hold values for->
* contents, owner, group, permissions, macro-start-delimiter, macro-end-delimiter
* @return returns the new created or updated config revision..
* @since 10.2
@@ -443,7 +443,7 @@ public class ConfigChannelHandler extends BaseHandler {
* @param channelLabel the label of the config channel.
* @param path the path of the given text file.
* @param data a map containing properties pertaining to the given path..
- * 'data' will hold values for ->
+ * 'data' will hold values for ->
* target_paths, selinux_ctx
* @return returns the new created or updated config revision..
* @since 10.2
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/XmlRpcConfigChannelHelper.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/XmlRpcConfigChannelHelper.java
index 6f08985..01bdac5 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/XmlRpcConfigChannelHelper.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/configchannel/XmlRpcConfigChannelHelper.java
@@ -96,12 +96,12 @@ public class XmlRpcConfigChannelHelper {
* @param path the path of the given text file.
* @param type the config file type
* @param data a map containing properties pertaining to the given path..
- * for directory paths - 'data' will hold values for ->
+ * for directory paths - 'data' will hold values for ->
* owner, group, permissions, revision, selinux_ctx
- * for file paths - 'data' will hold values for->
+ * for file paths - 'data' will hold values for->
* contents, owner, group, permissions, selinux_ctx
* macro-start-delimiter, macro-end-delimiter, revision
- * for symlinks paths - 'data' will hold values for->
+ * for symlinks paths - 'data' will hold values for->
* target_path, revision, selinux_ctx
* @return returns the new created or updated config revision..
*/
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/system/SystemDetailsHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/system/SystemDetailsHandler.java
index 5429d77..17c94fc 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/system/SystemDetailsHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/profile/system/SystemDetailsHandler.java
@@ -408,8 +408,8 @@ public class SystemDetailsHandler extends BaseHandler {
/**
* Returns the set of all keys associated with the indicated kickstart profile.
*
- * @param sessionKey identifies the user's session; cannot be <code>null</code>
- * @param kickstartLabel identifies the profile; cannot be <code>null</code>
+ * @param sessionKey identifies the user's session; cannot be <code>null</code>
+ * @param kickstartLabel identifies the profile; cannot be <code>null</code>
* @return set of all keys associated with the given profile
*
* @xmlrpc.doc Returns the set of all keys associated with the given kickstart
@@ -452,8 +452,8 @@ public class SystemDetailsHandler extends BaseHandler {
/**
* Adds the given list of keys to the specified kickstart profile.
*
- * @param sessionKey identifies the user's session; cannot be <code>null</code>
- * @param kickstartLabel identifies the profile; cannot be <code>null</code>
+ * @param sessionKey identifies the user's session; cannot be <code>null</code>
+ * @param kickstartLabel identifies the profile; cannot be <code>null</code>
* @param descriptions list identifiying the keys to add
* @return 1 if the associations were performed correctly
*
@@ -498,8 +498,8 @@ public class SystemDetailsHandler extends BaseHandler {
/**
* Removes the given list of keys from the specified kickstart profile.
*
- * @param sessionKey identifies the user's session; cannot be <code>null</code>
- * @param kickstartLabel identifies the profile; cannot be <code>null</code>
+ * @param sessionKey identifies the user's session; cannot be <code>null</code>
+ * @param kickstartLabel identifies the profile; cannot be <code>null</code>
* @param descriptions list identifiying the keys to remove
* @return 1 if the associations were performed correctly
*
@@ -544,8 +544,8 @@ public class SystemDetailsHandler extends BaseHandler {
* Returns the set of all file preservations associated with the given kickstart
* profile.
*
- * @param sessionKey identifies the user's session; cannot be <code>null</code>
- * @param kickstartLabel identifies the profile; cannot be <code>null</code>
+ * @param sessionKey identifies the user's session; cannot be <code>null</code>
+ * @param kickstartLabel identifies the profile; cannot be <code>null</code>
* @throws FaultException A FaultException is thrown if:
* - The sessionKey is invalid
* - The kickstartLabel is invalid
@@ -584,8 +584,8 @@ public class SystemDetailsHandler extends BaseHandler {
/**
* Adds the given list of file preservations to the specified kickstart profile.
*
- * @param sessionKey identifies the user's session; cannot be <code>null</code>
- * @param kickstartLabel identifies the profile; cannot be <code>null</code>
+ * @param sessionKey identifies the user's session; cannot be <code>null</code>
+ * @param kickstartLabel identifies the profile; cannot be <code>null</code>
* @param filePreservations list identifying the file preservations to add
* @throws FaultException A FaultException is thrown if:
* - The sessionKey is invalid
@@ -648,8 +648,8 @@ public class SystemDetailsHandler extends BaseHandler {
/**
* Removes the given list of file preservations from the specified kickstart profile.
*
- * @param sessionKey identifies the user's session; cannot be <code>null</code>
- * @param kickstartLabel identifies the profile; cannot be <code>null</code>
+ * @param sessionKey identifies the user's session; cannot be <code>null</code>
+ * @param kickstartLabel identifies the profile; cannot be <code>null</code>
* @param filePreservations list identifying the file preservations to remove
* @throws FaultException A FaultException is thrown if:
* - The sessionKey is invalid
@@ -713,8 +713,8 @@ public class SystemDetailsHandler extends BaseHandler {
/**
* Sets the registration type of a given kickstart profile.
*
- * @param sessionKey identifies the user's session; cannot be <code>null</code>
- * @param kickstartLabel identifies the profile; cannot be <code>null</code>
+ * @param sessionKey identifies the user's session; cannot be <code>null</code>
+ * @param kickstartLabel identifies the profile; cannot be <code>null</code>
* @param registrationType registration type
* @throws FaultException A FaultException is thrown if:
* - The sessionKey is invalid
@@ -753,8 +753,8 @@ public class SystemDetailsHandler extends BaseHandler {
/**
* Returns the registration type of a given kickstart profile.
*
- * @param sessionKey identifies the user's session; cannot be <code>null</code>
- * @param kickstartLabel identifies the profile; cannot be <code>null</code>
+ * @param sessionKey identifies the user's session; cannot be <code>null</code>
+ * @param kickstartLabel identifies the profile; cannot be <code>null</code>
* @throws FaultException A FaultException is thrown if:
* - The sessionKey is invalid
* - The kickstartLabel is invalid
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ServerActionSerializer.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ServerActionSerializer.java
index fdda9da..c100a54 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ServerActionSerializer.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/ServerActionSerializer.java
@@ -49,14 +49,14 @@ import redstone.xmlrpc.XmlRpcSerializer;
* #prop_desc("int", "id", "Id of this action.")
* #prop_desc("string", "version", "Version of action.")
* #prop_desc("string", "completion_time", "The date/time the event was completed.
- * Format ->YYYY-MM-dd hh:mm:ss.ms
- * Eg ->2007-06-04 13:58:13.0. (optional)
+ * Format ->YYYY-MM-dd hh:mm:ss.ms
+ * Eg ->2007-06-04 13:58:13.0. (optional)
* (Deprecated by completed_date)")
* #prop_desc($date, "completed_date", "The date/time the event was completed.
* (optional)")
* #prop_desc("string", "pickup_time", "The date/time the action was picked up.
- * Format ->YYYY-MM-dd hh:mm:ss.ms
- * Eg ->2007-06-04 13:58:13.0. (optional)
+ * Format ->YYYY-MM-dd hh:mm:ss.ms
+ * Eg ->2007-06-04 13:58:13.0. (optional)
* (Deprecated by pickup_date)")
* #prop_desc($date, "pickup_date", "The date/time the action was picked up.
* (optional)")
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index 3aabcad..0bd4298 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -1909,14 +1909,14 @@ public class SystemHandler extends BaseHandler {
* #prop_desc("int", "id", "Id of this action.")
* #prop_desc("string", "version", "Version of action.")
* #prop_desc("string", "completion_time", "The date/time the event was
- * completed. Format ->YYYY-MM-dd hh:mm:ss.ms
- * Eg ->2007-06-04 13:58:13.0. (optional)
+ * completed. Format ->YYYY-MM-dd hh:mm:ss.ms
+ * Eg ->2007-06-04 13:58:13.0. (optional)
* (Deprecated by completed_date)")
* #prop_desc($date, "completed_date", "The date/time the event was completed.
* (optional)")
* #prop_desc("string", "pickup_time", "The date/time the action was picked
- * up. Format ->YYYY-MM-dd hh:mm:ss.ms
- * Eg ->2007-06-04 13:58:13.0. (optional)
+ * up. Format ->YYYY-MM-dd hh:mm:ss.ms
+ * Eg ->2007-06-04 13:58:13.0. (optional)
* (Deprecated by pickup_date)")
* #prop_desc($date, "pickup_date", "The date/time the action was picked up.
* (optional)")
@@ -4571,8 +4571,8 @@ public class SystemHandler extends BaseHandler {
* To create a system record over xmlrpc use system.createSystemRecord
*
* To create a system record in the Web UI please go to
- * System -> <Specified System> -> Provisioning ->
- * Select a Kickstart profile -> Create Cobbler System Record.
+ * System -> <Specified System> -> Provisioning ->
+ * Select a Kickstart profile -> Create Cobbler System Record.
*
* @xmlrpc.param #param("string", "sessionKey")
* @xmlrpc.param #param("int", "serverId")
@@ -4633,8 +4633,8 @@ public class SystemHandler extends BaseHandler {
* To create a system record over xmlrpc use system.createSystemRecord
*
* To create a system record in the Web UI please go to
- * System -> <Specified System> -> Provisioning ->
- * Select a Kickstart profile -> Create Cobbler System Record.
+ * System -> <Specified System> -> Provisioning ->
+ * Select a Kickstart profile -> Create Cobbler System Record.
*
*
* @xmlrpc.param #param("string", "sessionKey")
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/config/ServerConfigHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/config/ServerConfigHandler.java
index 78f9f37..69da4ad 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/config/ServerConfigHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/config/ServerConfigHandler.java
@@ -107,9 +107,9 @@ public class ServerConfigHandler extends BaseHandler {
* @param path the path of the given text file.
* @param isDir true if this is a directory path, false if its to be a file path
* @param data a map containing properties pertaining to the given path..
- * for directory paths - 'data' will hold values for ->
+ * for directory paths - 'data' will hold values for ->
* owner, group, permissions
- * for file paths - 'data' will hold values for->
+ * for file paths - 'data' will hold values for->
* contents, owner, group, permissions, macro-start-delimiter, macro-end-delimiter
* @param commitToLocal true if we want to commit the file to
* the server's local channel false if we want to commit it to sandbox.
@@ -206,7 +206,7 @@ public class ServerConfigHandler extends BaseHandler {
* @param sid the server id.
* @param path the path of the given text file.
* @param data a map containing properties pertaining to the given path..
- * 'data' will hold values for ->
+ * 'data' will hold values for ->
* target_paths, selinux_ctx
* @param commitToLocal true if we want to commit the file to
* the server's local channel false if we want to commit it to sandbox.
11 years, 12 months
Changes to 'refs/tags/spacewalk-oscap-0.0.7-1'
by Jan Pazdziora
Tag 'spacewalk-oscap-0.0.7-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2012-04-27 14:52 +0000
Tagging package [spacewalk-oscap] version [0.0.7-1] in directory [client/rhel/spacewalk-oscap/].
Changes since spacewalk-java-1.8.57-1:
Jan Pazdziora (1):
Automatic commit of package [spacewalk-oscap] release [0.0.7-1].
---
client/rhel/spacewalk-oscap/spacewalk-oscap.spec | 6 +++++-
rel-eng/packages/spacewalk-oscap | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
---
11 years, 12 months
client/rhel rel-eng/packages
by Jan Pazdziora
client/rhel/spacewalk-oscap/spacewalk-oscap.spec | 6 +++++-
rel-eng/packages/spacewalk-oscap | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 1b24be3ab536cbbfabef75c7618e48efb43662d5
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 27 16:52:36 2012 +0200
Automatic commit of package [spacewalk-oscap] release [0.0.7-1].
diff --git a/client/rhel/spacewalk-oscap/spacewalk-oscap.spec b/client/rhel/spacewalk-oscap/spacewalk-oscap.spec
index 9efeedd..297bb32 100644
--- a/client/rhel/spacewalk-oscap/spacewalk-oscap.spec
+++ b/client/rhel/spacewalk-oscap/spacewalk-oscap.spec
@@ -1,5 +1,5 @@
Name: spacewalk-oscap
-Version: 0.0.6
+Version: 0.0.7
Release: 1%{?dist}
Summary: OpenSCAP plug-in for rhn-check
@@ -43,6 +43,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Fri Apr 27 2012 Jan Pazdziora 0.0.7-1
+- Spacewalk-oscap requires oscap tool of particular version.
+ (slukasik(a)redhat.com)
+
* Thu Mar 29 2012 Simon Lukasik <slukasik(a)redhat.com> 0.0.6-1
- When errors occur submit them back to the server. (slukasik(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-oscap b/rel-eng/packages/spacewalk-oscap
index 6d7249e..1fc5561 100644
--- a/rel-eng/packages/spacewalk-oscap
+++ b/rel-eng/packages/spacewalk-oscap
@@ -1 +1 @@
-0.0.6-1 client/rhel/spacewalk-oscap/
+0.0.7-1 client/rhel/spacewalk-oscap/
11 years, 12 months
Changes to 'refs/tags/spacewalk-java-1.8.57-1'
by Jan Pazdziora
Tag 'spacewalk-java-1.8.57-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2012-04-27 14:52 +0000
Tagging package [spacewalk-java] version [1.8.57-1] in directory [java/].
Changes since spacewalk-schema-1.8.24-1:
Jan Pazdziora (1):
Automatic commit of package [spacewalk-java] release [1.8.57-1].
---
java/spacewalk-java.spec | 5 ++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
---
11 years, 12 months
java/spacewalk-java.spec rel-eng/packages
by Jan Pazdziora
java/spacewalk-java.spec | 5 ++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 3ceeb50d20cb4abf59942b1f1a0b535182084d0d
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 27 16:52:06 2012 +0200
Automatic commit of package [spacewalk-java] release [1.8.57-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index aacb4d8..79e1197 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -22,7 +22,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.8.56
+Version: 1.8.57
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -605,6 +605,9 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Fri Apr 27 2012 Jan Pazdziora 1.8.57-1
+- API: List Xccdf Scans for given machine. (slukasik(a)redhat.com)
+
* Fri Apr 27 2012 Tomas Lestach <tlestach(a)redhat.com> 1.8.56-1
- use arch label in distchannel.setDefaultMap API as stated in the API doc
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index cd17448..c09abfc 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.8.56-1 java/
+1.8.57-1 java/
11 years, 12 months
Changes to 'refs/tags/spacewalk-schema-1.8.24-1'
by Jan Pazdziora
Tag 'spacewalk-schema-1.8.24-1' created by Jan Pazdziora <jpazdziora(a)redhat.com> at 2012-04-27 14:51 +0000
Tagging package [spacewalk-schema] version [1.8.24-1] in directory [schema/spacewalk/].
Changes since spacecmd-1.8.5-1:
Jan Pazdziora (2):
We cannot specify tablespace for PostgreSQL.
Automatic commit of package [spacewalk-schema] release [1.8.24-1].
Simon Lukasik (2):
Spacewalk-oscap requires oscap tool of particular version.
API: List Xccdf Scans for given machine.
---
client/rhel/spacewalk-oscap/spacewalk-oscap.spec | 2
java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml | 23 +++
java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java | 17 ++
java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SerializerRegistry.java | 1
java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/XccdfTestResultDtoSerializer.java | 68 ++++++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/scap/SystemScapHandler.java | 28 +++-
java/code/src/com/redhat/rhn/manager/audit/ScapManager.java | 18 ++
rel-eng/packages/spacewalk-schema | 2
schema/spacewalk/spacewalk-schema.spec | 5
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql | 3
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql.oracle | 3
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql.postgresql | 3
12 files changed, 166 insertions(+), 7 deletions(-)
---
11 years, 12 months
2 commits - rel-eng/packages schema/spacewalk
by Jan Pazdziora
rel-eng/packages/spacewalk-schema | 2 +-
schema/spacewalk/spacewalk-schema.spec | 5 ++++-
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql | 3 ---
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql.oracle | 3 +++
schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql.postgresql | 3 +++
5 files changed, 11 insertions(+), 5 deletions(-)
New commits:
commit 74cf67edcee59fb0c2811ac58b8bf65fec23b111
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 27 16:51:16 2012 +0200
Automatic commit of package [spacewalk-schema] release [1.8.24-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema
index 81ac407..b3cc819 100644
--- a/rel-eng/packages/spacewalk-schema
+++ b/rel-eng/packages/spacewalk-schema
@@ -1 +1 @@
-1.8.23-1 schema/spacewalk/
+1.8.24-1 schema/spacewalk/
diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec
index 8ceec68..2ba0dfe 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -2,7 +2,7 @@ Name: spacewalk-schema
Group: Applications/Internet
Summary: Oracle SQL schema for Spacewalk server
-Version: 1.8.23
+Version: 1.8.24
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
@@ -69,6 +69,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/spacewalk-sql*
%changelog
+* Fri Apr 27 2012 Jan Pazdziora 1.8.24-1
+- We cannot specify tablespace for PostgreSQL.
+
* Fri Apr 27 2012 Miroslav Suchý <msuchy(a)redhat.com> 1.8.23-1
- 719609 - add support for armv5 channels
- 719609 - Add support for armv7l cpu and armv7 channels
commit 59708cb28ea1cc382902a608689811fc33473d62
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Apr 27 16:50:24 2012 +0200
We cannot specify tablespace for PostgreSQL.
Addressing
psql:/var/log/spacewalk/schema-upgrade/20120427-092209-script.sql:5723: ERROR: syntax error at or near "["
LINE 3: USING INDEX TABLESPACE [[2m_tbs]];
^
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql
deleted file mode 100644
index 08a314a..0000000
--- a/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql
+++ /dev/null
@@ -1,3 +0,0 @@
-ALTER TABLE rhnChannelArch
- ADD CONSTRAINT rhn_carch_name_uq UNIQUE (name)
- USING INDEX TABLESPACE [[2m_tbs]];
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql.oracle b/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql.oracle
new file mode 100644
index 0000000..08a314a
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql.oracle
@@ -0,0 +1,3 @@
+ALTER TABLE rhnChannelArch
+ ADD CONSTRAINT rhn_carch_name_uq UNIQUE (name)
+ USING INDEX TABLESPACE [[2m_tbs]];
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql.postgresql
new file mode 100644
index 0000000..d4731a9
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.7-to-spacewalk-schema-1.8/034-rhnChannelArch.sql.postgresql
@@ -0,0 +1,3 @@
+-- oracle equivalent source sha1 40478ab5a0e48f867e4e2d5090fc362d9e5e3e32
+ALTER TABLE rhnChannelArch
+ ADD CONSTRAINT rhn_carch_name_uq UNIQUE (name);
11 years, 12 months
2 commits - client/rhel java/code
by Šimon Lukašík
client/rhel/spacewalk-oscap/spacewalk-oscap.spec | 2
java/code/src/com/redhat/rhn/common/db/datasource/xml/scap_queries.xml | 23 +++
java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java | 17 ++
java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SerializerRegistry.java | 1
java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/XccdfTestResultDtoSerializer.java | 68 ++++++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/scap/SystemScapHandler.java | 28 +++-
java/code/src/com/redhat/rhn/manager/audit/ScapManager.java | 18 ++
7 files changed, 155 insertions(+), 2 deletions(-)
New commits:
commit 7f4d409829a08f15a2e0e90ebfc0fdfeb23b45b2
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Fri Apr 27 11:31:02 2012 +0200
API: List Xccdf Scans for given machine.
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 bb750e2..a14dd3b 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
@@ -58,6 +58,29 @@
</query>
</mode>
+<mode name="latest_testresults_by_server" class="com.redhat.rhn.frontend.dto.XccdfTestResultDto">
+ <query params="user_id, sid">
+ SELECT
+ tr.id AS xid,
+ xp.identifier AS profile,
+ ras.path AS path,
+ sa.completion_time AS completed
+ FROM rhnUserServerPerms usp,
+ rhnXccdfTestresult tr,
+ rhnXccdfProfile xp,
+ rhnActionScap ras,
+ rhnServerAction sa
+ WHERE usp.user_id = :user_id
+ AND usp.server_id = :sid
+ AND usp.server_id = tr.server_id
+ AND sa.server_id = tr.server_id
+ AND tr.action_scap_id = ras.id
+ AND sa.action_id = ras.action_id
+ AND tr.profile_id = xp.id
+ ORDER BY completed DESC
+ </query>
+</mode>
+
<query name="testresult_counts" multiple="t" column="xid">
SELECT tr.id as xid, rrt.label, count(rr.id) as count
FROM rhnXccdfTestresult tr,
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 0e650f0..1397c1b 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/XccdfTestResultDto.java
@@ -27,6 +27,7 @@ public class XccdfTestResultDto extends XccdfTestResultCounts {
private String serverName;
private String profile;
private Date completed;
+ private String path;
/**
* Returns id of xccdf:TestResult
@@ -109,4 +110,20 @@ public class XccdfTestResultDto extends XccdfTestResultCounts {
public void setCompleted(Date completedIn) {
this.completed = completedIn;
}
+
+ /**
+ * Returns the path of xccdf document
+ * @return the path
+ */
+ public String getPath() {
+ return this.path;
+ }
+
+ /**
+ * Sets the path of xccdf document
+ * @param pathIn to set
+ */
+ public void setPath(String pathIn) {
+ this.path = pathIn;
+ }
}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SerializerRegistry.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SerializerRegistry.java
index c0eb35f..aaebfbb 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SerializerRegistry.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/SerializerRegistry.java
@@ -116,6 +116,7 @@ public class SerializerRegistry {
SERIALIZER_CLASSES.add(NetworkDtoSerializer.class);
SERIALIZER_CLASSES.add(DistChannelMapSerializer.class);
SERIALIZER_CLASSES.add(ContentSourceSerializer.class);
+ SERIALIZER_CLASSES.add(XccdfTestResultDtoSerializer.class);
}
/**
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/XccdfTestResultDtoSerializer.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/XccdfTestResultDtoSerializer.java
new file mode 100644
index 0000000..2b5a56d
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/XccdfTestResultDtoSerializer.java
@@ -0,0 +1,68 @@
+/**
+ * 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.xmlrpc.serializer;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import redstone.xmlrpc.XmlRpcCustomSerializer;
+import redstone.xmlrpc.XmlRpcException;
+import redstone.xmlrpc.XmlRpcSerializer;
+
+import com.redhat.rhn.frontend.dto.XccdfTestResultDto;
+import com.redhat.rhn.frontend.xmlrpc.serializer.util.SerializerHelper;
+
+
+/**
+ * XccdfTestResultDtoSerializer
+ * @version $Rev$
+ * @xmlrpc.doc
+ * #struct("OpenSCAP XCCDF Scan")
+ * #prop_desc("int", "xid", "XCCDF TestResult ID")
+ * #prop_desc("string", "profile", "XCCDF Profile")
+ * #prop_desc("string", "path", "Path to XCCDF document")
+ * #prop_desc($date, "completed", "Scan completion time")
+ * #struct_end()
+ */
+public class XccdfTestResultDtoSerializer implements XmlRpcCustomSerializer {
+
+ /**
+ * {@inheritDoc}
+ */
+ public Class getSupportedClass() {
+ return XccdfTestResultDto.class;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void serialize(Object value, Writer output,
+ XmlRpcSerializer builtInSerializer) throws XmlRpcException, IOException {
+ XccdfTestResultDto dto = (XccdfTestResultDto) value;
+ SerializerHelper helper = new SerializerHelper(builtInSerializer);
+ addToHelper(helper, "xid", dto.getXid());
+ addToHelper(helper, "profile", dto.getProfile());
+ addToHelper(helper, "path", dto.getPath());
+ addToHelper(helper, "completed", dto.getCompleted());
+ helper.writeTo(output);
+ }
+
+ private static void addToHelper(SerializerHelper helper, String label, Object value) {
+ if (value != null) {
+ helper.add(label, value);
+ }
+ }
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/scap/SystemScapHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/scap/SystemScapHandler.java
index e76c120..393a0c2 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/scap/SystemScapHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/scap/SystemScapHandler.java
@@ -22,10 +22,13 @@ import java.util.List;
import com.redhat.rhn.domain.action.scap.ScapAction;
import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.frontend.dto.XccdfTestResultDto;
import com.redhat.rhn.frontend.xmlrpc.BaseHandler;
-import com.redhat.rhn.manager.action.ActionManager;
import com.redhat.rhn.manager.MissingCapabilityException;
import com.redhat.rhn.manager.MissingEntitlementException;
+import com.redhat.rhn.manager.action.ActionManager;
+import com.redhat.rhn.manager.audit.ScapManager;
+import com.redhat.rhn.manager.system.SystemManager;
/**
* SystemScapHandler
@@ -36,6 +39,29 @@ import com.redhat.rhn.manager.MissingEntitlementException;
public class SystemScapHandler extends BaseHandler {
/**
+ * List OpenSCAP XCCDF scans for a given system.
+ * @param sessionKey The session key.
+ * @param serverId The server ID.
+ * @return a list of dto holding this info.
+ *
+ * @xmlrpc.doc Return a list of finished OpenSCAP scans for a given system.
+ * @xmlrpc.param #session_key()
+ * @xmlrpc.param #param("int", "serverId")
+ * @xmlrpc.returntype
+ * #array()
+ * $XccdfTestResultDtoSerializer
+ * #array_end()
+ */
+ public List<XccdfTestResultDto> listXccdfScans(String sessionKey, Integer serverId) {
+ User loggedInUser = getLoggedInUser(sessionKey);
+
+ /* Make sure the system is available to user and throw a nice exception.
+ * If it was not done, an empty list would be returned. */
+ SystemManager.ensureAvailableToUser(loggedInUser, new Long(serverId));
+ return ScapManager.latestTestResultByServerId(loggedInUser, new Long(serverId));
+ }
+
+ /**
* Run OpenSCAP XCCDF Evaluation on a given list of servers
* @param sessionKey The session key.
* @param serverIds The list of server ids,
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 bea4102..cc2911c 100644
--- a/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
+++ b/java/code/src/com/redhat/rhn/manager/audit/ScapManager.java
@@ -29,6 +29,7 @@ import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.dto.XccdfIdentDto;
import com.redhat.rhn.frontend.dto.XccdfRuleResultDto;
+import com.redhat.rhn.frontend.dto.XccdfTestResultDto;
import com.redhat.rhn.manager.BaseManager;
import com.redhat.rhn.manager.action.ActionManager;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
@@ -70,6 +71,23 @@ public class ScapManager extends BaseManager {
}
/**
+ * Show brief results of all scans accessible by user.
+ * Sorted by date, descending.
+ * @param user The user requesting the data.
+ * @param systemId The id of system
+ * @return The list of scan results.
+ */
+ public static List<XccdfTestResultDto> latestTestResultByServerId(
+ User user, Long systemId) {
+ SelectMode m = ModeFactory.getMode("scap_queries",
+ "latest_testresults_by_server");
+ HashMap<String, Long> params = new HashMap<String, Long>();
+ params.put("user_id", user.getId());
+ params.put("sid", systemId);
+ return (List<XccdfTestResultDto>) m.execute(params);
+ }
+
+ /**
* Show brief results of all scans for given system
* @param server The system for which to search
* @return The list of scan results in brief
commit 98bfd861156a5b6e39ec6b97dde31b58653ca8ab
Author: Simon Lukasik <slukasik(a)redhat.com>
Date: Fri Apr 27 13:51:37 2012 +0200
Spacewalk-oscap requires oscap tool of particular version.
In rhel 5.7 there is oscap tool which takes slightly different
command-line arguments.
diff --git a/client/rhel/spacewalk-oscap/spacewalk-oscap.spec b/client/rhel/spacewalk-oscap/spacewalk-oscap.spec
index b861b0c..9efeedd 100644
--- a/client/rhel/spacewalk-oscap/spacewalk-oscap.spec
+++ b/client/rhel/spacewalk-oscap/spacewalk-oscap.spec
@@ -11,7 +11,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel
BuildRequires: rhnlib
-Requires: openscap-utils
+Requires: openscap-utils >= 0.8.0
Requires: libxslt
Requires: rhnlib
Requires: rhn-check
11 years, 12 months
Changes to 'refs/tags/spacecmd-1.8.5-1'
by shardy
Tag 'spacecmd-1.8.5-1' created by Steven Hardy <shardy(a)redhat.com> at 2012-04-27 12:30 +0000
Tagging package [spacecmd] version [1.8.5-1] in directory [spacecmd/].
Changes since spacewalk-search-1.8.2-1:
Steven Hardy (5):
spacecmd : enhancement Add system_listconfigfiles
spacecmd : Fix usage for configchannel_addfile
spacecmd : move file_needs_b64_enc into utils
spacecmd : enhancement add system_addconfigfile
Automatic commit of package [spacecmd] release [1.8.5-1].
---
rel-eng/packages/spacecmd | 2
spacecmd/spacecmd.spec | 8 +
spacecmd/src/lib/configchannel.py | 204 +++++++++++++++----------------
spacecmd/src/lib/system.py | 250 ++++++++++++++++++++++++++++++++++++++
spacecmd/src/lib/utils.py | 16 ++
5 files changed, 373 insertions(+), 107 deletions(-)
---
11 years, 12 months