On 03/07/2012 10:04 AM, Tomas Lestach wrote:
I will find time for that in the next days and I can then come up with a new
patch for that file after I verified the behavior.
Great!
Thank you Johannes,
So, AFAICS the rhnServerNeededCache table is there for caching which errata need
to be applied to a system together with the respective package ids. So I don't
really see how it makes sense to insert rows in there with errata id == null.
I compared the resulting cache entries with what we get when running the stored
procedure 'rhn_server.update_needed_cache' (with respective parameters of
course).
The output was equal, but missing the 'null' rows.
Even if i think these 'null' entries don't hurt anybody I would propose to apply
the attached patch to PublishErrataAction.java (also the code was quite a mess).
Please tell me if this breaks anything and throw away my patch in this case ;-)
Thanks,
Johannes
P.S.: Further, if this is all true, I would actually question the whole method
'insertCacheForChannelPackagesAsync()' in ErrataCacheManager.java, since it does
exactly this:
...
uece.setErrataId(null);
...
But it's called in 3-4 other places as well, so you (or somebody else who knows)
should better have a look and verify this first, see the second patch.
--
SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg)
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
From 22cab15a789c1d8cc50f2efb8244fbec1c9a2236 Mon Sep 17 00:00:00 2001
From: Johannes Renner jren...@suse.de
Date: Thu, 8 Mar 2012 15:26:33 +0100
Subject: [PATCH] Remove obsolete cache insertion
---
.../action/channel/manage/PublishErrataAction.java | 17 ++---
1 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/PublishErrataAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/PublishErrataAction.java
index 7a24554..8d98e3d 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/PublishErrataAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/PublishErrataAction.java
@@ -22,7 +22,6 @@ import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.struts.RhnListAction;
import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.errata.ErrataManager;
-import com.redhat.rhn.manager.errata.cache.ErrataCacheManager;
import com.redhat.rhn.manager.rhnset.RhnSetDecl;
import org.apache.log4j.Logger;
@@ -79,9 +78,7 @@ public class PublishErrataAction extends RhnListAction {
ErrataManager.publishErrataToChannelAsync(currentChan, errataIds, user);
-//ErrataManager.publishErrataToChannel(currentChan, errataIds, user);
-
-
+// Add missing packages to the channel
ListLong pidList = new ArrayListLong();
pidList.addAll(packageIds);
@@ -93,28 +90,18 @@ public class PublishErrataAction extends RhnListAction {
}
}
-
-//update the errata info
-List chanList = new ArrayList();
-chanList.add(currentChan.getId());
-ErrataCacheManager.insertCacheForChannelPackagesAsync(chanList, pidList);
ChannelManager.refreshWithNewestPackages(currentChan, web.errata_push);
request.setAttribute(cid, cid);
+// Add success message
ActionMessages msg = new ActionMessages();
String[] params = {errataIds.size() + , packageIds.size() + ,
currentChan.getName()};
msg.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage(frontend.actions.channels.manager.add.success,
params));
-
getStrutsDelegate().saveMessages(requestContext.getRequest(), msg);
return mapping.findForward(default);
}
-
-
-
-
-
}
--
1.7.7
From dba13014a02468031faeab8700d0959f006946c3 Mon Sep 17 00:00:00 2001
From: Johannes Renner jren...@suse.de
Date: Thu, 8 Mar 2012 15:41:16 +0100
Subject: [PATCH] Remove obsolete cache insertion completely
---
.../manage/ChannelPackagesAddConfirmAction.java|1 -
.../action/errata/RemovePackagesAction.java|7 --
.../channel/software/ChannelSoftwareHandler.java |8 ---
.../manager/errata/cache/ErrataCacheManager.java | 21
4 files changed, 0 insertions(+), 37 deletions(-)
diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/ChannelPackagesAddConfirmAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/ChannelPackagesAddConfirmAction.java
index f98206a..77f69e7 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/ChannelPackagesAddConfirmAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/ChannelPackagesAddConfirmAction.java
@@ -125,7 +125,6 @@ public class ChannelPackagesAddConfirmAction extends RhnAction {
ListLong packList = new ArrayListLong();
chanList.add(chan.getId());