Re: [Spacewalk-devel] [PATCH] Fix query to determine available config channels in SSM

2011-12-06 Thread Johannes Renner
On 12/05/2011 06:53 PM, Michael Mraka wrote:
 Hi Johannes,
 
 although Tomas commited your patch neither original version nor yours
 are correct.
 
 a) Select from rhnSet was not restricted to user so it might interfere
 with other users SSM servers.
 
 b) Two servers in SSM and three channels:
  server1 subscribed to config1 and config2
  server2 is subscribed only to config1
  (no server subscribed to config3)
 query returns only config3 while it should have return config2, config3. 
 
 So I went ahead and rewrote queries completely, please check whether
 they work for you. (Commits a0ac26914ef0c80202dc0d707966ec34f523053e and
 d50e60bc201b11c7b23c7f7eb06f6a58ee593fb0)

Yes, that's right, thanks for the investigation. I tested your new queries
and they seem to do the right thing now, finally.

Thank you,
Johannes

-- 
SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg)
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

[Spacewalk-devel] [PATCH] Fix query to determine available config channels in SSM

2011-11-29 Thread Johannes Renner
Hello,

It looks like that the following query is not actually doing what it should do:

config_queries.xml: ssm_channels_for_subscribe_choose

How to see that: Put two systems in the SSM where only one of those is 
subscribed
to a certain config channel. This config channel should appear in the SSM as an
option to subscribe to, because not ALL of the systems in SSM are already 
subscribed.
What happens is, that as soon as one of the systems in SSM is subscribed to a 
certain
channel, this channel does not appear as an available config channel in SSM 
anymore.

I found that the attached patch fixes the issue: While replacing = with is 
is
obviously correct, I also found, that as soon as SCC.server_id is null (in the 
last
subquery) the SCC.config_channel_id is also null. Therefore the proposed fix.
Further, since the next query in that file is just the negation of this one, it 
would
probably also need a fix.

Thanks,
Johannes

-- 
SUSE LINUX Products GmbH, HRB 16746 (AG Nürnberg)
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer
From 8493f940c7b6fb27e4f25f211865890fcf71f0a3 Mon Sep 17 00:00:00 2001
From: Johannes Renner jren...@suse.de
Date: Tue, 29 Nov 2011 16:17:34 +0100
Subject: [PATCH] Fix query to determine config channels in SSM

---
 .../common/db/datasource/xml/config_queries.xml|6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/config_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/config_queries.xml
index 1484317..d11bd22 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/config_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/config_queries.xml
@@ -2096,8 +2096,8 @@ SELECT  CC.id, CC.name
  FROM rhnSet RS LEFT OUTER JOIN rhnServerConfigChannel SCC
  ON RS.element = SCC.server_id
 WHERE RS.label = 'system_list'
-AND SCC.config_channel_id = XXX.config_channel_id
-AND SCC.server_id = null) )
+AND SCC.config_channel_id is null
+AND SCC.server_id is null) )
 ORDER BY UPPER(CC.name)
   /query
   elaborator name=ssm_channel_elab /
@@ -2126,7 +2126,7 @@ SELECT  CC.id, CC.name
 FROM rhnSet RS LEFT OUTER JOIN rhnServerConfigChannel SCC
 ON RS.element = SCC.server_id
WHERE RS.label = 'system_list'
-   AND SCC.config_channel_id = XXX.config_channel_id
+   AND SCC.config_channel_id is null
AND SCC.server_id is null) )
 ORDER BY UPPER(CC.name)
   /query
-- 
1.7.3.4

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel