backend/satellite_tools/satCerts.py | 32
+++++
java/code/src/com/redhat/rhn/common/errors/NoSuchKickstartExceptionHandler.java | 61
++++++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchKickstartException.java | 56
+++++++++
java/code/webapp/WEB-INF/pages/common/errors/nosuchkickstart.jsp | 16
++
spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf | 3
5 files changed, 167 insertions(+), 1 deletion(-)
New commits:
commit af7c783ab0241b996a8969163c7e2a74d3845f26
Merge: 6a16f53... efa37df...
Author: Pradeep Kilambi <pkilambi(a)redhat.com>
Date: Tue Mar 31 19:44:41 2009 -0400
Merge branch 'vader'
commit efa37dfc2f22740b44ce93d1e02c3541d75d244f
Author: Pradeep Kilambi <pkilambi(a)redhat.com>
Date: Tue Mar 31 19:43:47 2009 -0400
Fixing the first org creation to check for ChannelFamily existance and create row if
missing so the channel shows up in channels tab on sync
diff --git a/backend/satellite_tools/satCerts.py b/backend/satellite_tools/satCerts.py
index 1327ac3..d631a11 100644
--- a/backend/satellite_tools/satCerts.py
+++ b/backend/satellite_tools/satCerts.py
@@ -102,6 +102,7 @@ def create_first_org(owner):
p(owner, pword)
# Now create the first private channel family
create_first_private_chan_family()
+ verify_family_permissions()
return get_org_id()
_query_get_slot_types = rhnSQL.Statement("""
@@ -555,6 +556,37 @@ def create_first_private_chan_family():
org=1, url="First Org Created")
+def verify_family_permissions():
+ """
+ Verify channel family permissions for first org
+ """
+ _query_lookup_cfid = """
+ SELECT CF.id
+ FROM rhnChannelFamily CF
+ WHERE CF.org_id = :orgid
+ AND NOT EXISTS (
+ SELECT 1
+ FROM rhnChannelFamilyPermissions CFP
+ WHERE CFP.org_id = CF.org_id
+ AND CFP.channel_family_id = CF.id)
+ ORDER BY CF.id
+ """
+
+ h = rhnSQL.prepare(_query_lookup_cfid)
+ cfid = h.execute(orgid = 1)
+ if not cfid:
+ return
+
+ _query_create_priv_chfam = """
+ INSERT INTO rhnPrivateChannelFamily
+ (channel_family_id, org_id, max_members, current_members)
+ VALUES (:id, :org_id, NULL, 0)
+ """
+
+ h = rhnSQL.prepare(_query_create_priv_chfam)
+ h.execute(id=cfid['id'], org_id=1)
+
+
if __name__ == '__main__':
from common import initCFG, CFG
commit 04cabe7970333bdef9acc52b9bb91b9ecb6a0b9f
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Mar 31 17:57:43 2009 -0400
487563 - adding enable_snapshots config value to default rhn.conf as per docs
diff --git a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf
b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf
index f5ef1c6..5676130 100644
--- a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf
+++ b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf
@@ -74,4 +74,5 @@
taskomatic.com.redhat.rhn.taskomatic.task.SatelliteCertificateCheck.schedule = 0
# below the current usgage amount.
web.force_unentitlement=0
-
+# system snapshots enabled
+enable_snapshots = 1
commit fe5154b6a09d2af1a5dde8651512c9d314a0e1da
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Tue Mar 31 17:09:44 2009 -0400
458838 - adding new files for kickstart exception 404
diff --git
a/java/code/src/com/redhat/rhn/common/errors/NoSuchKickstartExceptionHandler.java
b/java/code/src/com/redhat/rhn/common/errors/NoSuchKickstartExceptionHandler.java
new file mode 100644
index 0000000..e47e7f7
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/common/errors/NoSuchKickstartExceptionHandler.java
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2009 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.common.errors;
+
+import com.redhat.rhn.common.messaging.MessageQueue;
+import com.redhat.rhn.domain.user.User;
+import com.redhat.rhn.frontend.events.TraceBackEvent;
+import com.redhat.rhn.frontend.struts.RequestContext;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionForward;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ExceptionHandler;
+import org.apache.struts.config.ExceptionConfig;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * PermissionExceptionHandler
+ * @version $Rev$
+ */
+public class NoSuchKickstartExceptionHandler extends ExceptionHandler {
+
+ /**
+ * Custom Handler for HibernateLookupExceptions
+ * {@inheritDoc}
+ */
+ public ActionForward execute(Exception ex, ExceptionConfig exConfig,
+ ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse
response)
+ throws ServletException {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ request.setAttribute("error", ex);
+
+
+ TraceBackEvent evt = new TraceBackEvent();
+ RequestContext requestContext = new RequestContext(request);
+ User usr = requestContext.getLoggedInUser();
+ evt.setUser(usr);
+ evt.setRequest(request);
+ evt.setException(ex);
+ MessageQueue.publish(evt);
+
+ return super.execute(ex, exConfig, mapping, form, request, response);
+ }
+
+}
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchKickstartException.java
b/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchKickstartException.java
new file mode 100644
index 0000000..2170ae4
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchKickstartException.java
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2009 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.
+ */
+
+/*
+ * AUTOMATICALLY GENERATED FILE, DO NOT EDIT.
+ */
+package com.redhat.rhn.frontend.xmlrpc;
+
+import com.redhat.rhn.FaultException;
+
+/**
+ * no such package
+ * <p>
+
+ *
+ * @version definition($Rev: 76724 $)/template($Rev: 67725 $)
+ */
+public class NoSuchKickstartException extends FaultException {
+
+
+ /////////////////////////
+ // Constructors
+ /////////////////////////
+ /**
+ * Constructor
+ */
+ public NoSuchKickstartException() {
+ super(2764 , "noSuchKickstart" , "The kickstart could not be
found");
+ // begin member variable initialization
+ }
+
+ /**
+ * Constructor
+ * @param cause the cause (which is saved for later retrieval
+ * by the Throwable.getCause() method). (A null value is
+ * permitted, and indicates that the cause is nonexistent or
+ * unknown.)
+ */
+ public NoSuchKickstartException(Throwable cause) {
+ super(2764 , "noSuchKickstart" , "The kickstart could not be
found" , cause);
+ // begin member variable initialization
+ }
+
+}
diff --git a/java/code/webapp/WEB-INF/pages/common/errors/nosuchkickstart.jsp
b/java/code/webapp/WEB-INF/pages/common/errors/nosuchkickstart.jsp
new file mode 100644
index 0000000..738831f
--- /dev/null
+++ b/java/code/webapp/WEB-INF/pages/common/errors/nosuchkickstart.jsp
@@ -0,0 +1,16 @@
+<%@ taglib
uri="http://rhn.redhat.com/rhn" prefix="rhn" %>
+<%@ taglib
uri="http://jakarta.apache.org/struts/tags-bean"
prefix="bean" %>
+<html:xhtml/>
+<html>
+<body>
+
+<h1>
+ <img src="/img/rhn-icon-warning.gif"
+ alt="<bean:message key='error.common.errorAlt' />" />
+ <bean:message key="unknown.kickstart" />:
+</h1>
+
+<p><bean:message key="unknown.kickstart.message" /></p>
+
+</body>
+</html>