Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java | 8 ++++++++
java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java | 3 ++-
java/code/webapp/WEB-INF/pages/channel/manage/repo/deleteconfirm.jsp | 2 +-
3 files changed, 11 insertions(+), 2 deletions(-)
New commits:
commit 303c83106485327979bb2fdaf82f6fb1203bb668
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Thu May 27 14:45:15 2010 -0400
logic to delete content sources from db
diff --git a/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java b/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
index 9e781cf..af58d33 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java
@@ -210,6 +210,14 @@ public class ChannelFactory extends HibernateFactory {
public static void remove(DistChannelMap dcm) {
singleton.removeObject(dcm);
}
+
+ /**
+ * Remove a Content Source from the DB
+ * @param src to be removed from database
+ */
+ public static void remove(ContentSource src) {
+ singleton.removeObject(src);
+ }
/**
* Returns the base channel for the given server id.
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java
index c22f1af..9ce5da8 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java
@@ -22,6 +22,7 @@ import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.redhat.rhn.common.validator.ValidatorException;
+import com.redhat.rhn.domain.channel.ChannelFactory;
import com.redhat.rhn.domain.channel.ContentSource;
import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.struts.RhnAction;
@@ -51,7 +52,7 @@ public class RepoDeleteAction extends RhnAction {
if (context.isSubmitted()) {
try {
- //delete here
+ ChannelFactory.remove(src);
createSuccessMessage(request,
"repos.delete.success", cmd.getLabel());
return mapping.findForward("success");
diff --git a/java/code/webapp/WEB-INF/pages/channel/manage/repo/deleteconfirm.jsp b/java/code/webapp/WEB-INF/pages/channel/manage/repo/deleteconfirm.jsp
index 4e9c3d5..5d18327 100644
--- a/java/code/webapp/WEB-INF/pages/channel/manage/repo/deleteconfirm.jsp
+++ b/java/code/webapp/WEB-INF/pages/channel/manage/repo/deleteconfirm.jsp
@@ -14,7 +14,7 @@
<p><bean:message key="repos.jsp.delete.summary"/></p>
<p><rhn:warning key= "repos.jsp.delete.warning"/></p>
<div>
- <form method="post" action="/rhn/channels/cobbler/manage/repos/RepoDelete.do">
+ <form method="post" action="/rhn/channels/manage/repos/RepoDelete.do">
<h2><bean:message key="repos.jsp.delete.info.header"/></h2>
<table class="details">
<tr>
13 years, 11 months
Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java | 1 +
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
New commits:
commit b6a0e17d4c40ad7d38974c49e728bbbc8679c7f8
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Thu May 27 14:29:35 2010 -0400
minor syntax issue with i18n repo delete strings
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java
index b58b838..c22f1af 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java
@@ -42,6 +42,7 @@ public class RepoDeleteAction extends RhnAction {
RequestContext context = new RequestContext(request);
EditRepoCommand cmd = new EditRepoCommand(context.getLoggedInUser(),
context.getParamAsLong("id"));
+
ContentSource src = cmd.getNewRepo();
request.setAttribute(RepoDetailsAction.LABEL, src.getLabel() );
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 5150b80..cb96841 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
@@ -9290,7 +9290,7 @@ Please note that some manual configuration of these scripts may still be require
<source>Are you sure you want to delete this repository permanently?</source>
</trans-unit>
<trans-unit id="repos.jsp.delete.warning">
- <source>Warning: Deleting this repository will remove any channel mappings this repository is associated with</source>
+ <source>Deleting this repository will remove any channel mappings this repository is associated with</source>
</trans-unit>
<trans-unit id="repos.jsp.delete.info.header">
<source>Repository Information</source>
13 years, 11 months
Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java | 66 ++++++++++
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 18 ++
java/code/webapp/WEB-INF/pages/channel/manage/repo/deleteconfirm.jsp | 53 ++++++++
java/code/webapp/WEB-INF/struts-config.xml | 10 +
4 files changed, 147 insertions(+)
New commits:
commit 893fd9503d953b008099cde8025e97facbb3db59
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Thu May 27 14:19:20 2010 -0400
initial files to support Repo delete
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java
new file mode 100644
index 0000000..b58b838
--- /dev/null
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDeleteAction.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2009--2010 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.channel.manage.repo;
+
+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.common.validator.ValidatorException;
+import com.redhat.rhn.domain.channel.ContentSource;
+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.manager.channel.repo.EditRepoCommand;
+
+/**
+ * RepoDeleteAction
+ * @version $Rev: 1 $
+ */
+public class RepoDeleteAction extends RhnAction {
+ /** {@inheritDoc} */
+ public ActionForward execute(ActionMapping mapping,
+ ActionForm formIn,
+ HttpServletRequest request,
+ HttpServletResponse response) {
+ RequestContext context = new RequestContext(request);
+ EditRepoCommand cmd = new EditRepoCommand(context.getLoggedInUser(),
+ context.getParamAsLong("id"));
+ ContentSource src = cmd.getNewRepo();
+
+ request.setAttribute(RepoDetailsAction.LABEL, src.getLabel() );
+ request.setAttribute(RepoDetailsAction.URL, src.getSourceUrl() );
+ request.setAttribute("id", src.getId());
+
+ if (context.isSubmitted()) {
+ try {
+ //delete here
+ createSuccessMessage(request,
+ "repos.delete.success", cmd.getLabel());
+ return mapping.findForward("success");
+ }
+ catch (ValidatorException ve) {
+ getStrutsDelegate().saveMessages(request, ve.getResult());
+ RhnValidationHelper.setFailedValidation(request);
+ }
+ }
+
+ return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
+ }
+}
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 e4d3056..5150b80 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
@@ -9268,15 +9268,33 @@ Please note that some manual configuration of these scripts may still be require
<trans-unit id="repos.jsp.update.submit">
<source>Update Repository</source>
</trans-unit>
+ <trans-unit id="repos.jsp.delete.submit">
+ <source>Delete Repository</source>
+ </trans-unit>
<trans-unit id="repos.jsp.create.success">
<source>Repository created successfully</source>
</trans-unit>
<trans-unit id="repos.jsp.update.success">
<source>Repository updated successfully</source>
</trans-unit>
+ <trans-unit id="repos.delete.success">
+ <source>Repository deleted successfully</source>
+ </trans-unit>
<trans-unit id="repos.jsp.details.header2">
<source>Repository Details</source>
</trans-unit>
+ <trans-unit id="repos.jsp.delete.header2">
+ <source>Confirm Repository Delete</source>
+ </trans-unit>
+ <trans-unit id="repos.jsp.delete.summary">
+ <source>Are you sure you want to delete this repository permanently?</source>
+ </trans-unit>
+ <trans-unit id="repos.jsp.delete.warning">
+ <source>Warning: Deleting this repository will remove any channel mappings this repository is associated with</source>
+ </trans-unit>
+ <trans-unit id="repos.jsp.delete.info.header">
+ <source>Repository Information</source>
+ </trans-unit>
<!-- TNC -->
<trans-unit id="tnc.jsp.tnc">
diff --git a/java/code/webapp/WEB-INF/pages/channel/manage/repo/deleteconfirm.jsp b/java/code/webapp/WEB-INF/pages/channel/manage/repo/deleteconfirm.jsp
new file mode 100644
index 0000000..4e9c3d5
--- /dev/null
+++ b/java/code/webapp/WEB-INF/pages/channel/manage/repo/deleteconfirm.jsp
@@ -0,0 +1,53 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %>
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
+
+<html:xhtml/>
+<html>
+<body>
+<rhn:toolbar base="h1" img="/img/rhn-icon-info.gif" imgAlt="info.alt.img">
+ <c:out value="${requestScope.label}"/>
+</rhn:toolbar>
+
+<h2><bean:message key="repos.jsp.delete.header2"/></h2>
+<p><bean:message key="repos.jsp.delete.summary"/></p>
+<p><rhn:warning key= "repos.jsp.delete.warning"/></p>
+<div>
+ <form method="post" action="/rhn/channels/cobbler/manage/repos/RepoDelete.do">
+<h2><bean:message key="repos.jsp.delete.info.header"/></h2>
+ <table class="details">
+ <tr>
+ <th>
+ <bean:message key="repos.jsp.create.label"/>
+ </th>
+ <td>
+ <c:out value="${label}"/></pre>
+ </td>
+ </tr>
+ <tr>
+ <th>
+ <bean:message key="repos.jsp.create.url"/>
+ </th>
+ <td>
+ <c:out value="${url}"/></pre>
+ </td>
+ </tr>
+
+ </table>
+ <hr />
+ <table align="right">
+ <tr>
+ <td></td>
+ <rhn:submitted/>
+ <input type="hidden" name="id" value="${requestScope.id}"/>
+ <td align="right"><input type=submit name="dispatch"
+ value="${rhn:localize('repos.jsp.delete.submit')}"/></td>
+ </tr>
+ </table>
+ </form>
+</div>
+
+</body>
+</html>
+
diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml
index b2b0f01..a2cf993 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -6638,6 +6638,16 @@
path="/channels/manage/repos/RepoEdit.do" redirect = "true"/>
</action>
+ <action path="/channels/manage/repos/RepoDelete"
+ scope="request"
+ type="com.redhat.rhn.frontend.action.channel.manage.repo.RepoDeleteAction"
+ className="com.redhat.rhn.frontend.struts.RhnActionMapping">
+ <forward name="default"
+ path="/WEB-INF/pages/channel/manage/repo/deleteconfirm.jsp"/>
+ <forward name="success"
+ path="/channels/manage/repos/RepoList.do" redirect = "true"/>
+ </action>
+
<!-- end repo -->
<action path="/common/DownloadFile"
13 years, 11 months
Branch 'flex-guest' - backend/server java/code
by Partha Aji
backend/server/handlers/xmlrpc/registration.py | 6 ++-
backend/server/rhnChannel.py | 9 +++-
backend/server/rhnServer/server_class.py | 9 +++-
java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/internal/ChannelProcedureHandler.java | 19 +++++++++-
4 files changed, 34 insertions(+), 9 deletions(-)
New commits:
commit d4f157d690ba195211c5123dd71487bfab508ddd
Author: Partha Aji <paji(a)redhat.com>
Date: Thu May 27 13:43:48 2010 -0400
Initial set of changes to get subscribe channel call to work from python backend
diff --git a/backend/server/handlers/xmlrpc/registration.py b/backend/server/handlers/xmlrpc/registration.py
index 90e5b6f..a6afe24 100644
--- a/backend/server/handlers/xmlrpc/registration.py
+++ b/backend/server/handlers/xmlrpc/registration.py
@@ -347,6 +347,8 @@ class Registration(rhnHandler):
# let the stacked activation keys do their magic
tokens_obj.is_rereg_token = 0
rhnFlags.set("re_registration_token", 0)
+
+ #import epdb; epdb.serve(port=9999)
# now if we have a token, load the extra registration
# information from the token
@@ -369,7 +371,7 @@ class Registration(rhnHandler):
# without a base channel.
try:
# don't commit
- newserv.save(0, channel)
+ newserv.save(0, channel, pre_commit = 1)
except (rhnChannel.SubscriptionCountExceeded,
rhnChannel.NoBaseChannelError), channel_error:
raise rhnFault(70)
@@ -408,7 +410,7 @@ class Registration(rhnHandler):
# |
# +--rhnNoSystemEntitlementsException
try:
- newserv.save(1, channel)
+ newserv.save(1, channel, pre_commit = 1)
except (rhnChannel.SubscriptionCountExceeded,
rhnChannel.NoBaseChannelError), channel_error:
raise rhnFault(70)
diff --git a/backend/server/rhnChannel.py b/backend/server/rhnChannel.py
index dec0ca3..b95d5f5 100644
--- a/backend/server/rhnChannel.py
+++ b/backend/server/rhnChannel.py
@@ -13,7 +13,7 @@
# in this software or its documentation.
#
#
-
+import xmlrpclib
import time
import string
import rpm
@@ -31,6 +31,8 @@ from rhnDependency import MakeEvrError
# local module
import rhnUser, rhnSQL, rhnLib
+XMLRPC = xmlrpclib.Server("http://localhost:8080/rhn/rpc/internal")
+
class NoBaseChannelError(Exception):
pass
@@ -1732,10 +1734,11 @@ def get_obsoletes_blacklist(channel):
# small wrapper around a PL/SQL function
def _subscribe_sql(server_id, channel_id, commit = 1):
log_debug(3, server_id, channel_id, commit)
- subscribe_channel = rhnSQL.Procedure("rhn_channel.subscribe_server")
+
+
try:
# don't run the EC yet
- subscribe_channel(server_id, channel_id, 0)
+ XMLRPC.channel.subscribe_no_user(int(server_id), int(channel_id))
except rhnSQL.SQLSchemaError, e:
if e.errno == 20235: # channel_family_no_subscriptions
raise SubscriptionCountExceeded(channel_id=channel_id)
diff --git a/backend/server/rhnServer/server_class.py b/backend/server/rhnServer/server_class.py
index b68be4d..b983600 100644
--- a/backend/server/rhnServer/server_class.py
+++ b/backend/server/rhnServer/server_class.py
@@ -492,7 +492,7 @@ class Server(ServerWrapper):
rhnSQL.commit()
# Save this record in the database
- def __save(self, channel):
+ def __save(self, channel, pre_commit = 0):
if self.server.real:
server_id = self.server["id"]
self.server.save()
@@ -534,6 +534,9 @@ class Server(ServerWrapper):
# to allow us to not have to pass in none_ok=1 in any case
#
# This can now throw exceptions which will be caught at a higher level
+ if pre_commit:
+ rhnSQL.commit()
+
if channel is not None:
channel_info = dict(rhnChannel.channel_info(channel))
log_debug(4, "eus channel id %s" % str(channel_info))
@@ -567,13 +570,13 @@ class Server(ServerWrapper):
# This is a wrapper for the above class that allows us to rollback
# any changes in case we don't succeed completely
- def save(self, commit = 1, channel = None):
+ def save(self, commit = 1, channel = None, pre_commit = 0):
log_debug(3)
# attempt to preserve pending changes before we were called,
# so we set up our own transaction checkpoint
rhnSQL.transaction("save_server")
try:
- self.__save(channel)
+ self.__save(channel, pre_commit = pre_commit)
except: # roll back to what we have before and raise again
rhnSQL.rollback("save_server")
# shoot the exception up the chain
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/internal/ChannelProcedureHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/internal/ChannelProcedureHandler.java
index 1a25382..9ecbec2 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/internal/ChannelProcedureHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/internal/ChannelProcedureHandler.java
@@ -15,7 +15,9 @@
package com.redhat.rhn.frontend.xmlrpc.channel.internal;
import com.redhat.rhn.domain.channel.Channel;
+import com.redhat.rhn.domain.channel.ChannelFactory;
import com.redhat.rhn.domain.server.Server;
+import com.redhat.rhn.domain.server.ServerFactory;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.domain.user.UserFactory;
import com.redhat.rhn.frontend.xmlrpc.BaseHandler;
@@ -36,7 +38,7 @@ public class ChannelProcedureHandler extends BaseHandler {
* @param userId the id of the user
* @return 1 on success exception otherwise
*/
- public int subscribeChannelToSystem(Integer serverId,
+ public int subscribe(Integer serverId,
Integer channelId, Integer userId) {
User user = UserFactory.lookupById(userId.longValue());
Channel channel = ChannelManager.lookupByIdAndUser(channelId.longValue(), user);
@@ -52,4 +54,19 @@ public class ChannelProcedureHandler extends BaseHandler {
return 1;
}
+
+ /**
+ * Runs the subscribe channel procedure
+ * @param serverId the id of the server
+ * @param channelId the id of the channel
+ * @return 1 on success exception otherwise
+ */
+ public int subscribeNoUser(Integer serverId,
+ Integer channelId) {
+
+ Channel channel = ChannelFactory.lookupById(channelId.longValue());
+ Server server = ServerFactory.lookupById(serverId.longValue());
+ SystemManager.subscribeServerToChannel(null, server, channel);
+ return 1;
+ }
}
13 years, 11 months
Changes to 'refs/tags/spacewalk-backend-1.1.16-1'
by Michael Mraka
Tag 'spacewalk-backend-1.1.16-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-05-27 14:49 +0000
Tagging package [spacewalk-backend] version [1.1.16-1] in directory [backend/].
Changes since smartpm-0.2-3:
Colin Coe (1):
Correct 'checkstyle' errors
Jan Pazdziora (8):
593194 - fix creating the $(PREFIX)/usr/share/setuptool/setuptool.d when building the package.
585188 - the firstboot modules for RHEL 5 shall retire in firstboot-legacy-rhel5.
585188 - only install legacy firstboot on RHEL 5 (and earlier), the new firstboot for other systems.
585188 - refactor the RHN Register firstboot code to match firstboot 1.110 on Fedora 12 and RHEL 6.
MD5
Revert "MD5"
Remove except which cannot be reached.
585188 - we need to implement fatalError for loginPageApply and createProfilePageApply.
Justin Sherrill (4):
checkstyle fixes
525588 - changing SSM child channel subscription page to not use hibernate when doing subscribng
595473 525588 - fixing issue where child channel subscription changes would not use the stored procedure and would instead update rhnServerChannel table directly, bypassing all entitelment logic
595473 525588 - fixing small query issue and moving the ssm operation creation to before the
Michael Mraka (5):
595688 - cancel busy cursor after ValidationError
block old spacewalk / satellite from syncing sha256 channels via ISS
BaseCache._hash_object_id() moved to rhnLib.hash_object_id()
removed local hash_object_id() and reused rhnLib.hash_object_id()
Automatic commit of package [spacewalk-backend] release [1.1.16-1].
Milan Zazrivec (2):
580493 - use correct product logos in rhn_register (gui)
We don't need hwdata target anymore
Miroslav Suchý (3):
whitespace cleanup
595669 - fix regexp and do not fail if regexp do not match
595837 - write nice error in case of "connection reset by peer" and xmlrpc protocol error
---
backend/common/rhnLib.py | 10
backend/satellite_tools/disk_dumper/dumper.py | 35 -
backend/satellite_tools/syncCache.py | 15
backend/spacewalk-backend.spec | 6
client/rhel/rhn-client-tools/data/Makefile | 19
client/rhel/rhn-client-tools/data/gui.glade | 16
client/rhel/rhn-client-tools/rhn-client-tools.spec | 26
client/rhel/rhn-client-tools/setuptool.d/Makefile | 10
client/rhel/rhn-client-tools/src/Makefile | 2
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/Makefile | 41 +
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_choose_server_gui.py | 72 ++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_create_profile_gui.py | 79 ++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_finish_gui.py | 77 ++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_login_gui.py | 116 ++++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_provide_certificate_gui.py | 71 ++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_register_firstboot_gui_window.py | 108 +++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_review_gui.py | 66 ++
client/rhel/rhn-client-tools/src/firstboot-legacy-rhel5/rhn_start_gui.py | 105 +++
client/rhel/rhn-client-tools/src/firstboot/Makefile | 16
client/rhel/rhn-client-tools/src/firstboot/rhn_choose_server_gui.py | 80 +-
client/rhel/rhn-client-tools/src/firstboot/rhn_create_profile_gui.py | 103 ++-
client/rhel/rhn-client-tools/src/firstboot/rhn_finish_gui.py | 79 +-
client/rhel/rhn-client-tools/src/firstboot/rhn_login_gui.py | 175 ++----
client/rhel/rhn-client-tools/src/firstboot/rhn_provide_certificate_gui.py | 72 +-
client/rhel/rhn-client-tools/src/firstboot/rhn_register.py | 32 +
client/rhel/rhn-client-tools/src/firstboot/rhn_register_firstboot_gui_window.py | 108 ---
client/rhel/rhn-client-tools/src/firstboot/rhn_review_gui.py | 67 +-
client/rhel/rhn-client-tools/src/firstboot/rhn_start_gui.py | 65 +-
client/rhel/rhn-client-tools/src/up2date_client/Makefile | 2
client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py | 12
client/rhel/rhn-client-tools/src/up2date_client/rhncli.py | 6
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 1
client/rhel/rhnlib/rhn/transports.py | 4
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml | 37 +
java/code/src/com/redhat/rhn/common/db/datasource/xml/file-list.xml | 1
java/code/src/com/redhat/rhn/common/db/datasource/xml/ssm_queries.xml | 61 --
java/code/src/com/redhat/rhn/domain/errata/CveFactory.java | 12
java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChannelActionDAO.java | 98 ++-
java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelConfirmAction.java | 78 ++
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ssm/SchedulePackageUpgradeAction.java | 17
java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsAction.java | 27
java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsEvent.java | 31 -
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 3
java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java | 75 ++
java/code/src/com/redhat/rhn/manager/ssm/SsmManager.java | 282 ++--------
java/code/webapp/WEB-INF/pages/channel/ssm/childsubconfirm.jsp | 12
rel-eng/packages/spacewalk-backend | 2
47 files changed, 1563 insertions(+), 869 deletions(-)
---
13 years, 11 months
backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/spacewalk-backend.spec | 6 +++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 88b2213a0f4674cef195dd31f4d420aba07c9dec
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu May 27 16:49:41 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.1.16-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 5633e56..2be729f 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 1.1.15
+Version: 1.1.16
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -632,6 +632,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Thu May 27 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.16-1
+- block old spacewalk from syncing sha256 channels via ISS
+- improved performance of linking packages during satellite-sync
+
* Wed May 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.15-1
- 589299 - excluded checksum_list from headers
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index bb15411..18feab7 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.1.15-1 backend/
+1.1.16-1 backend/
13 years, 11 months
2 commits - backend/common backend/satellite_tools
by Michael Mraka
backend/common/rhnLib.py | 10 ++++++++++
backend/satellite_tools/disk_dumper/dumper.py | 24 +++++-------------------
backend/satellite_tools/syncCache.py | 15 +++------------
3 files changed, 18 insertions(+), 31 deletions(-)
New commits:
commit 3911fde5bbbc39aaec436caaca649767a69fa786
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu May 27 16:47:17 2010 +0200
removed local hash_object_id() and reused rhnLib.hash_object_id()
diff --git a/backend/satellite_tools/disk_dumper/dumper.py b/backend/satellite_tools/disk_dumper/dumper.py
index 40d6dc0..61c915f 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -1328,7 +1328,7 @@ class ShortPackagesDumper(CachedDumper, exportLib.ShortPackagesDumper):
def _get_key(self, params):
package_id = params['package_id']
- hash_val = hash_object_id(package_id, 100)
+ hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-short-packages/%s/rhn-package-short-%s.xml" % (
hash_val, package_id)
@@ -1382,7 +1382,7 @@ class PackagesDumper(CachedDumper, exportLib.PackagesDumper):
def _get_key(self, params):
package_id = params['package_id']
- hash_val = hash_object_id(package_id, 100)
+ hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-packages/%s/rhn-package-%s.xml" % (hash_val, package_id)
def _dump_subelement(self, data):
@@ -1420,7 +1420,7 @@ class SourcePackagesDumper(CachedDumper, exportLib.SourcePackagesDumper):
def _get_key(self, params):
package_id = params['package_id']
- hash_val = hash_object_id(package_id, 100)
+ hash_val = rhnLib.hash_object_id(package_id, 2)
return "xml-packages/%s/rhn-source-package-%s.xml" % (hash_val, package_id)
def _dump_subelement(self, data):
@@ -1454,7 +1454,7 @@ class ErrataDumper(CachedDumper, exportLib.ErrataDumper):
def _get_key(self, params):
errata_id = params['errata_id']
- hash_val = hash_object_id(errata_id, 10)
+ hash_val = rhnLib.hash_object_id(errata_id, 1)
return "xml-errata/%s/rhn-erratum-%s.xml" % (hash_val, errata_id)
def _dump_subelement(self, data):
@@ -1488,7 +1488,7 @@ class ErrataDumperEx(CachedDumper, exportLib.ErrataSynopsisDumper):
def _get_key(self, params):
errata_id = params['errata_id']
- hash_val = hash_object_id(errata_id, 10)
+ hash_val = rhnLib.hash_object_id(errata_id, 1)
return "xml-errata/%s/rhn-erratum-%s.xml" % (hash_val, errata_id)
def _dump_subelement(self, data):
@@ -1529,20 +1529,6 @@ class KickstartableTreesDumper(CachedDumper, exportLib.KickstartableTreesDumper)
log_debug(6, data)
return exportLib.KickstartableTreesDumper.dump_subelement(self, data)
-def hash_object_id(obj_id, factor):
- """ This looks complicated; it returns the (integer part of)
- obj_id, modulo factor
- The string is left padded with as many 0 chars as necessary to
- match factor
- XXX This is copied from satellite_tools.diskImportLib.hashPackageID -
- should figure out a way to share it -- misa
- """
- # Make sure obj_id is a string
- obj_id = str(obj_id)
- format = int(math.ceil(math.log10(factor)))
- format = "%%0%sd" % format
- return format % (int(string.split(obj_id, '-')[-1]) % factor, )
-
class ClosedConnectionError(Exception):
pass
commit 4c3b684480245f9c6ec6001158c3cbde38243dd8
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu May 27 16:43:30 2010 +0200
BaseCache._hash_object_id() moved to rhnLib.hash_object_id()
diff --git a/backend/common/rhnLib.py b/backend/common/rhnLib.py
index 12c2704..0905f9b 100644
--- a/backend/common/rhnLib.py
+++ b/backend/common/rhnLib.py
@@ -172,3 +172,13 @@ def fix_url(url, scheme="http", path="/"):
_fragment))
return url
+def hash_object_id(self, object_id, factor):
+ """Given an object id (assumed to be <label>-<number>), returns the
+ last few digits for the number. For instance, (812345, 3) should
+ return 345"""
+ # Grab the digits after -
+ num_id = string.split(object_id, '-')[-1]
+ # get last 'factor' numbers
+ num_id = num_id[-factor:]
+ return num_id.rjust(factor,'0')
+
diff --git a/backend/satellite_tools/syncCache.py b/backend/satellite_tools/syncCache.py
index c8662fb..c510a74 100644
--- a/backend/satellite_tools/syncCache.py
+++ b/backend/satellite_tools/syncCache.py
@@ -23,6 +23,7 @@ import string
# rhn imports:
from common import CFG, rhnCache
+from common.rhnLib import hash_object_id
# NOTE: this is a python 2.2-ism
__all__ = []
@@ -54,16 +55,6 @@ class BaseCache:
def _get_key(self, object_id):
raise NotImplementedError()
- def _hash_object_id(self, object_id, factor):
- """Given an object id (assumed to be <label>-<number>), returns the
- last few digits for the number. For instance, (812345, 3) should
- return 345"""
- # Grab the digits after -
- num_id = string.split(object_id, '-')[-1]
- # get last 'factor' numbers
- num_id = num_id[-factor:]
- return num_id.rjust(factor,'0')
-
class ChannelCache(BaseCache):
def _get_key(self, object_id):
return os.path.join("satsync", "channels", str(object_id))
@@ -71,7 +62,7 @@ class ChannelCache(BaseCache):
class BasePackageCache(BaseCache):
_subdir = "__unknown__"
def _get_key(self, object_id):
- hash_val = self._hash_object_id(object_id, 2)
+ hash_val = hash_object_id(object_id, 2)
return os.path.join("satsync", self._subdir, hash_val, str(object_id))
class ShortPackageCache(BasePackageCache):
@@ -87,7 +78,7 @@ class SourcePackageCache(BasePackageCache):
class ErratumCache(BaseCache):
_subdir = "errata"
def _get_key(self, object_id):
- hash_val = self._hash_object_id(object_id, 1)
+ hash_val = hash_object_id(object_id, 1)
return os.path.join("satsync", self._subdir, hash_val, str(object_id))
class KickstartableTreesCache(BaseCache):
13 years, 11 months
backend/satellite_tools
by Michael Mraka
backend/satellite_tools/disk_dumper/dumper.py | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
New commits:
commit 0875be36d1fe6b81f7f86e19e99c073bdefb951a
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu May 27 15:52:26 2010 +0200
block old spacewalk / satellite from syncing sha256 channels via ISS
diff --git a/backend/satellite_tools/disk_dumper/dumper.py b/backend/satellite_tools/disk_dumper/dumper.py
index 1a2d30d..40d6dc0 100644
--- a/backend/satellite_tools/disk_dumper/dumper.py
+++ b/backend/satellite_tools/disk_dumper/dumper.py
@@ -23,7 +23,7 @@ from types import ListType
from cStringIO import StringIO
from common import log_debug, log_error, rhnFault, UserDictCase, rhnCache, \
- CFG, rhnLib
+ CFG, rhnLib, rhnFlags
from server import rhnSQL, rhnDatabaseCache
from satellite_tools import constants
from satellite_tools.exporter import exportLib, xmlWriter
@@ -99,12 +99,15 @@ class XML_Dumper:
def get_channels_statement(self):
query = """
select c.id channel_id, c.label,
+ ct.label as checksum_type,
TO_CHAR(c.last_modified, 'YYYYMMDDHH24MISS') last_modified
from rhnChannel c, rhnChannelFamilyMembers cfm,
+ rhnChecksumType ct,
(%s
) scf
where scf.channel_family_id = cfm.channel_family_id
and cfm.channel_id = c.id
+ and c.checksum_type_id = ct.id(+)
""" % self._channel_family_query
return DatabaseStatement().set_statement(rhnSQL.prepare(query))
@@ -469,6 +472,8 @@ class XML_Dumper:
all_channels_hash[row['label']] = row
# Intersect the list of channels they've sent to us
+ iss_slave_sha256_capable = (float(rhnFlags.get('X-RHN-Satellite-XML-Dump-Version')) >= constants.SHA256_SUPPORTED_VERSION)
+
if not channel_labels:
channels = all_channels_hash
else:
@@ -477,6 +482,10 @@ class XML_Dumper:
if not all_channels_hash.has_key(label):
raise rhnFault(3001, "Could not retrieve channel %s" %
label)
+ if not (iss_slave_sha256_capable
+ or all_channels_hash[label]['checksum_type'] in [None, 'sha1']):
+ raise rhnFault(3001, "Channel %s has incompatible checksum (%)" %
+ (label, all_channels_hash[label]['checksum_type']))
channels[label] = all_channels_hash[label]
return channels
13 years, 11 months
Branch 'yum-repo-sync' - java/code
by Shannon Hughes
java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java | 31 +++++-----
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 3
java/code/webapp/WEB-INF/pages/channel/manage/repo/repodetails.jsp | 2
java/code/webapp/WEB-INF/struts-config.xml | 4 -
4 files changed, 23 insertions(+), 17 deletions(-)
New commits:
commit 1159006a7460640cca48e3ba4c84722097f7f94a
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Wed May 26 16:38:59 2010 -0400
bug fixes for EditRepo, strut path fixes
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
index 1c10245..5a580a2 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/repo/RepoDetailsAction.java
@@ -33,6 +33,7 @@ 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.manager.channel.repo.BaseRepoCommand;
import com.redhat.rhn.manager.channel.repo.CreateRepoCommand;
import com.redhat.rhn.manager.channel.repo.EditRepoCommand;
@@ -47,7 +48,7 @@ public class RepoDetailsAction extends RhnAction {
public static final String REPO = "repo";
public static final String URL = "url";
public static final String LABEL = "label";
- public static final String OLD_LABEL = "oldLabel";
+ public static final String SOURCEID = "sourceid";
private static final String VALIDATION_XSD =
"/com/redhat/rhn/frontend/action/channel/" +
@@ -87,7 +88,7 @@ public class RepoDetailsAction extends RhnAction {
request.removeAttribute(CREATE_MODE);
setupRepo(request, form, repo);
return getStrutsDelegate().forwardParam(mapping.findForward("success"),
- LABEL, repo.getLabel());
+ "id", repo.getId().toString());
}
catch (ValidatorException ve) {
getStrutsDelegate().saveMessages(request, ve.getResult());
@@ -97,9 +98,7 @@ public class RepoDetailsAction extends RhnAction {
}
else if(!isCreateMode(request)) {
setup(request, form);
- }
-
- // setup(request, form);
+ }
return mapping.findForward(RhnHelper.DEFAULT_FORWARD);
}
@@ -118,16 +117,16 @@ public class RepoDetailsAction extends RhnAction {
private void setup(HttpServletRequest request, DynaActionForm form) {
RequestContext context = new RequestContext(request);
EditRepoCommand cmd = new EditRepoCommand(context.getLoggedInUser(),
- context.getParamAsLong("id"));
+ context.getParamAsLong("id"));
setupRepo(request, form, cmd.getNewRepo());
}
private void setupRepo(HttpServletRequest request, DynaActionForm form,
ContentSource repo) {
- form.set(LABEL, repo.getLabel());
- form.set(OLD_LABEL, repo.getLabel());
+ form.set(LABEL, repo.getLabel());
form.set(URL, repo.getSourceUrl());
+ form.set(SOURCEID, repo.getId());
bindRepo(request, repo);
}
@@ -140,15 +139,19 @@ public class RepoDetailsAction extends RhnAction {
request.setAttribute(REPO, repo);
}
- private ContentSource submit(HttpServletRequest request, DynaActionForm form) {
- RequestContext context = new RequestContext(request);
-
- String label = isCreateMode(request) ?
- form.getString(LABEL) : form.getString(OLD_LABEL);
+ private ContentSource submit(HttpServletRequest request, DynaActionForm form) {
+ RequestContext context = new RequestContext(request);
String url = form.getString(URL);
+ String label = form.getString(LABEL);
Org org = context.getLoggedInUser().getOrg();
+ BaseRepoCommand repoCmd = null;
+ if(isCreateMode(request)) {
+ repoCmd = new CreateRepoCommand(org);
+ }
+ else {
+ repoCmd = new EditRepoCommand(context.getLoggedInUser(), context.getParamAsLong(SOURCEID));
+ }
- CreateRepoCommand repoCmd = new CreateRepoCommand(org);
repoCmd.setLabel(label);
repoCmd.setUrl(url);
repoCmd.store();
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 ef9e26f..e4d3056 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
@@ -9271,6 +9271,9 @@ Please note that some manual configuration of these scripts may still be require
<trans-unit id="repos.jsp.create.success">
<source>Repository created successfully</source>
</trans-unit>
+ <trans-unit id="repos.jsp.update.success">
+ <source>Repository updated successfully</source>
+ </trans-unit>
<trans-unit id="repos.jsp.details.header2">
<source>Repository Details</source>
</trans-unit>
diff --git a/java/code/webapp/WEB-INF/pages/channel/manage/repo/repodetails.jsp b/java/code/webapp/WEB-INF/pages/channel/manage/repo/repodetails.jsp
index 2ea3d21..fa74ff9 100644
--- a/java/code/webapp/WEB-INF/pages/channel/manage/repo/repodetails.jsp
+++ b/java/code/webapp/WEB-INF/pages/channel/manage/repo/repodetails.jsp
@@ -43,7 +43,7 @@
<html:text property="label"/>
<c:if test = "${empty requestScope.create_mode}">
- <html:hidden property="oldLabel"/>
+ <html:hidden property="sourceid"/>
</c:if>
</td>
</tr>
diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml
index 2d7bb87..b2b0f01 100644
--- a/java/code/webapp/WEB-INF/struts-config.xml
+++ b/java/code/webapp/WEB-INF/struts-config.xml
@@ -821,7 +821,7 @@
<form-bean name="contentSourceForm"
type="com.redhat.rhn.frontend.struts.ScrubbingDynaActionForm">
<form-property name="url" type="java.lang.String"/>
- <form-property name="oldLabel" type="java.lang.String" />
+ <form-property name="sourceid" type="java.lang.Long" />
<form-property name="label" type="java.lang.String"/>
</form-bean>
@@ -6635,7 +6635,7 @@
<forward name="default"
path="/WEB-INF/pages/channel/manage/repo/repodetails.jsp"/>
<forward name="success"
- path="/channels/manage/repo/RepoEdit.do" redirect = "true"/>
+ path="/channels/manage/repos/RepoEdit.do" redirect = "true"/>
</action>
<!-- end repo -->
13 years, 11 months
java/code
by Justin Sherrill
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml | 1
java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelConfirmAction.java | 11 +++-
java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsAction.java | 21 --------
java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsEvent.java | 26 ++++++----
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 3 +
5 files changed, 33 insertions(+), 29 deletions(-)
New commits:
commit 09b0052b46bf78853cdf7fd8900b43a76a588fcb
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed May 26 15:14:02 2010 -0400
595473 525588 - fixing small query issue and moving the ssm operation creation to before the
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
index 9f85343..00cf97e 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
@@ -1196,6 +1196,7 @@ GROUP BY C.id, C.name
where
rset.label = :set_label and
rset.user_id = :uid and
+ rset.element = S.id and
C.parent_channel = SC.channel_id and
SCAC.server_arch_id = S.server_arch_id and
SCAC.channel_arch_id = C.channel_arch_id and
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelConfirmAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelConfirmAction.java
index edbdcfa..9056fd0 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelConfirmAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/ssm/ChildChannelConfirmAction.java
@@ -28,6 +28,7 @@ import com.redhat.rhn.frontend.taglibs.list.helper.Listable;
import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.manager.ssm.SsmManager;
+import com.redhat.rhn.manager.ssm.SsmOperationManager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -97,9 +98,17 @@ public class ChildChannelConfirmAction extends RhnAction implements Listable {
ActionForward result;
if (isSubmitted(daForm)) {
+ long operationId = SsmOperationManager.createOperation(user,
+ "Channel Subscription Updates", null);
+
+ SsmOperationManager.associateServersWithOperation(operationId, user.getId(),
+ RhnSetDecl.SSM_CHANNEL_SUBSCRIBE.getLabel());
+ SsmOperationManager.associateServersWithOperation(operationId, user.getId(),
+ RhnSetDecl.SSM_CHANNEL_UNSUBSCRIBE.getLabel());
+
// Fire the request off asynchronously
SsmChangeChannelSubscriptionsEvent event =
- new SsmChangeChannelSubscriptionsEvent(user, subs.values());
+ new SsmChangeChannelSubscriptionsEvent(user, subs.values(), operationId);
MessageQueue.publish(event);
result = mapping.findForward("success");
diff --git a/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsAction.java b/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsAction.java
index 979a05b..cd3341b 100644
--- a/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsAction.java
@@ -17,7 +17,6 @@ package com.redhat.rhn.frontend.events;
import com.redhat.rhn.common.messaging.EventMessage;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.action.channel.ssm.ChannelActionDAO;
-import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import com.redhat.rhn.manager.ssm.SsmManager;
import com.redhat.rhn.manager.ssm.SsmOperationManager;
@@ -38,24 +37,6 @@ public class SsmChangeChannelSubscriptionsAction extends AbstractDatabaseAction
User user = event.getUser();
Collection<ChannelActionDAO> changes = event.getChanges();
- // Parse and store the changes into RhnSets
- SsmManager.populateSsmChannelServerSets(user, changes);
-
- // Log the change operation
-
- /* Since the servers are in two separate sets, make explicit associations from
- those sets to the operation.
- */
- long operationId = SsmOperationManager.createOperation(user,
- "Channel Subscription Updates", null);
-
- SsmOperationManager.associateServersWithOperation(operationId, user.getId(),
- RhnSetDecl.SSM_CHANNEL_SUBSCRIBE.getLabel());
- SsmOperationManager.associateServersWithOperation(operationId, user.getId(),
- RhnSetDecl.SSM_CHANNEL_UNSUBSCRIBE.getLabel());
-
- // Do the changes
-
/* Anything after the operation is created should be in a try..finally to
attempt to prevent a hanging, perpetually in progress operation. This is
an added safety once a taskomatic task is created to automatically time out
@@ -66,7 +47,7 @@ public class SsmChangeChannelSubscriptionsAction extends AbstractDatabaseAction
}
finally {
// Complete the action
- SsmOperationManager.completeOperation(user, operationId);
+ SsmOperationManager.completeOperation(user, event.getOpId());
}
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsEvent.java b/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsEvent.java
index 34e64c9..3076dd5 100644
--- a/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsEvent.java
+++ b/java/code/src/com/redhat/rhn/frontend/events/SsmChangeChannelSubscriptionsEvent.java
@@ -21,26 +21,28 @@ import com.redhat.rhn.frontend.action.channel.ssm.ChannelActionDAO;
import java.util.Collection;
/**
- * Event fired to carry the information necessary to perform subscription changes
- * for servers in the SSM.
+ * Event fired to carry the information necessary to perform subscription
+ * changes for servers in the SSM.
*
- * @see com.redhat.rhn.frontend.events.SsmChangeChannelSubscriptionsAction
+ * @see com.redhat.rhn.frontend.events.SsmChangeChannelSubscriptionsAction
* @version $Revision$
*/
public class SsmChangeChannelSubscriptionsEvent implements EventMessage {
private User user;
private Collection<ChannelActionDAO> changes;
+ private Long opId;
/**
* Creates a new SSM channel change event to fire across the message bus.
*
- * @param userIn user making the changes; cannot be <code>null</code>
+ * @param userIn user making the changes; cannot be <code>null</code>
* @param changesIn changes to make; cannot be <code>null</code>
+ * @param operationId the operation id
*/
public SsmChangeChannelSubscriptionsEvent(User userIn,
- Collection<ChannelActionDAO> changesIn) {
-
+ Collection<ChannelActionDAO> changesIn, Long operationId) {
+
if (userIn == null) {
throw new IllegalArgumentException("user cannot be null");
}
@@ -48,9 +50,10 @@ public class SsmChangeChannelSubscriptionsEvent implements EventMessage {
if (changesIn == null) {
throw new IllegalArgumentException("changes cannot be null");
}
-
+
this.user = userIn;
this.changes = changesIn;
+ this.opId = operationId;
}
/**
@@ -67,6 +70,13 @@ public class SsmChangeChannelSubscriptionsEvent implements EventMessage {
return changes;
}
+ /**
+ * @return the op id
+ */
+ public Long getOpId() {
+ return opId;
+ }
+
/** {@inheritDoc} */
public String toText() {
return toString();
@@ -75,6 +85,6 @@ public class SsmChangeChannelSubscriptionsEvent implements EventMessage {
/** {@inheritDoc} */
public String toString() {
return "SsmChannelSubscriptionsEvent[User: " + user.getLogin() +
- ", Change Count: " + changes.size() + "]";
+ ", Change Count: " + changes.size() + "]";
}
}
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 9b1bea6..3ca1797 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
@@ -8492,6 +8492,9 @@ Follow this url to see the full list of inactive systems:
<trans-unit id="error.config.revnum.invalid">
<source>Please specify a valid revision number.</source>
</trans-unit>
+ <trans-unit id="ssm.subscription.operation.label">
+ <source>Channel Subscription Updates</source>
+ </trans-unit>
<trans-unit id="kickstart.cobbler.distro.syncfail">
<source>
The following is a list of errors gathered while Spacewalk attempts to
13 years, 11 months