backend/rhn-conf/rhn_server.conf |
2
backend/satellite_tools/exporter/exportLib.py |
15
backend/satellite_tools/satsync.py |
508 +---
backend/satellite_tools/sync_handlers.py |
3
backend/satellite_tools/xmlSource.py |
48
backend/server/importlib/importLib.py |
56
backend/spacewalk-backend.spec |
5
client/rhel/rhn-client-tools/rhn-client-tools.spec |
5
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py |
2
client/rhel/yum-rhn-plugin/actions/packages.py |
4
client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec |
6
client/tools/osad/Makefile.defs |
6
client/tools/osad/Makefile.osad |
4
client/tools/osad/logrotate/osa-dispatcher |
14
client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable |
6
client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.fc |
1
client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te |
1
client/tools/osad/osad.spec |
18
client/tools/osad/prog.init |
5
client/tools/osad/sysconfig/Makefile |
9
client/tools/osad/sysconfig/osa-dispatcher |
4
client/tools/osad/tns-admin-osa-dispatcher/Makefile |
10
client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora |
3
client/tools/osad/tns-admin-osa-dispatcher/tnsnames.ora |
1
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml |
7
java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml |
46
java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml |
6
java/code/src/com/redhat/rhn/frontend/dto/BaseDto.java |
3
java/code/src/com/redhat/rhn/frontend/dto/NetworkDto.java |
25
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml |
14
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml |
49
java/code/src/com/redhat/rhn/frontend/struts/BaseSetHelper.java |
14
java/code/src/com/redhat/rhn/frontend/taglibs/RhnListTagFunctions.java |
13
java/code/src/com/redhat/rhn/frontend/taglibs/list/ColumnTag.java |
16
java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java |
92
java/code/src/com/redhat/rhn/frontend/taglibs/list/ExpandableColumnTag.java |
1
java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java |
56
java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java |
74
java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTagHelper.java |
27
java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTagUtil.java |
43
java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java |
194 +
java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java |
22
java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ListDecorator.java |
2
java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/SelectableDecorator.java |
14
java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListRhnSetHelper.java |
4
java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListSessionSetHelper.java |
5
java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListSetHelper.java |
18
java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld |
29
java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/NetworkDtoSerializer.java |
7
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java |
1
java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java |
19
java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java |
44
java/code/webapp/WEB-INF/pages/common/fragments/activationkeys/groups.jspf |
1
java/code/webapp/WEB-INF/pages/common/fragments/configuration/channel/summary.jspf |
4
java/code/webapp/WEB-INF/pages/common/fragments/systems/groups.jspf |
1
java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp |
20
java/spacewalk-java.spec |
26
projects/ssl-cert-check/rhn-ssl-cert-check |
37
projects/ssl-cert-check/spacewalk-ssl-cert-check.spec |
10
projects/ssl-cert-check/ssl-cert-check |
379 ---
rel-eng/packages/osad |
2
rel-eng/packages/rhn-client-tools |
2
rel-eng/packages/spacewalk-backend |
2
rel-eng/packages/spacewalk-java |
2
rel-eng/packages/spacewalk-ssl-cert-check |
2
rel-eng/packages/yum-rhn-plugin |
2
satellite/setup-symlinks.sh |
4
schema/spacewalk/common/tables/rhnChannelContentSource.sql |
53
schema/spacewalk/common/tables/rhnContentSource.sql |
50
spacewalk/config/etc/httpd/conf.d/zz-spacewalk-www.conf |
2
web/conf/proxy/httpd.conf |
1201 ----------
web/conf/proxy/local.conf |
6
web/conf/proxy/proxy.conf |
8
web/conf/rhn-profile.conf |
1
web/conf/rhn-r.conf |
1
web/conf/rhn-sat.conf |
2
web/conf/rhn-test02.conf |
4
web/conf/rhn_web.conf |
2
web/conf/rhnapp.conf |
26
web/html/javascript/check_all.js |
59
80 files changed, 1129 insertions(+), 2361 deletions(-)
New commits:
commit c83f226bb597e86771bf8d32fa53babaab445b35
Author: Shannon Hughes <shughes(a)redhat.com>
Date: Wed May 5 14:20:07 2010 -0400
renaming to contentsource since we are moving channel out to a new mapping table named
rhnChannelContentSource
diff --git a/schema/spacewalk/common/tables/rhnChannelContentSource.sql
b/schema/spacewalk/common/tables/rhnChannelContentSource.sql
deleted file mode 100644
index 09a585e..0000000
--- a/schema/spacewalk/common/tables/rhnChannelContentSource.sql
+++ /dev/null
@@ -1,53 +0,0 @@
---
--- Copyright (c) 2008 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.
---
---
---
---
-
-create table
-rhnChannelContentSource
-(
- id number NOT NULL
- constraint rhn_ccs_id_pk primary key,
- channel_id number NOT NULL
- constraint rhn_ccs_c_fk
- references rhnChannel(id) on delete cascade,
- type_id number NOT NULL
- constraint rhn_ccs_type_fk
- references rhnContentSourceType(id),
- source_url varchar2(512) NOT NULL,
- label varchar2(64) NOT NULL,
- last_synced date,
- created date default(sysdate) NOT NULL,
- modified date default(sysdate) NOT NULL
-)
- enable row movement
- ;
-
-
-create sequence rhn_chan_content_src_id_seq start with 500;
-
-
-create unique index rhn_ccs_uq
- on rhnChannelContentSource(channel_id, type_id, source_url)
- tablespace [[64k_tbs]]
- ;
-
-/
-
---
--- Revision 1.0 2009/06/26 21:54 jlsherrill
--- Initial file.
---
diff --git a/schema/spacewalk/common/tables/rhnContentSource.sql
b/schema/spacewalk/common/tables/rhnContentSource.sql
new file mode 100644
index 0000000..d9e0308
--- /dev/null
+++ b/schema/spacewalk/common/tables/rhnContentSource.sql
@@ -0,0 +1,50 @@
+--
+-- Copyright (c) 2008 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.
+--
+--
+--
+--
+
+create table
+rhnContentSource
+(
+ id number NOT NULL
+ constraint rhn_ccs_id_pk primary key,
+ type_id number NOT NULL
+ constraint rhn_ccs_type_fk
+ references rhnContentSourceType(id),
+ source_url varchar2(512) NOT NULL,
+ label varchar2(64) NOT NULL,
+ last_synced date,
+ created date default(sysdate) NOT NULL,
+ modified date default(sysdate) NOT NULL
+)
+ enable row movement
+ ;
+
+
+create sequence rhn_chan_content_src_id_seq start with 500;
+
+
+create unique index rhn_ccs_uq
+ on rhnContentSource(channel_id, type_id, source_url)
+ tablespace [[64k_tbs]]
+ ;
+
+/
+
+--
+-- Revision 1.0 2009/06/26 21:54 jlsherrill
+-- Initial file.
+--
commit 7bd8078b7dc3483f97245f8049ef8f7f688bce83
Author: Joshua Roys <joshua.roys(a)gtri.gatech.edu>
Date: Wed May 5 11:39:29 2010 -0400
588901 - fix to_package_id
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
index f85a521..fae7400 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
@@ -801,7 +801,7 @@ SELECT PN.name,
FROM (
SELECT SOP.package_name_id name_id,
MAX(PE.evr) evr,
- MAX(PE.id) evr_id,
+ PE.id evr_id,
SP.package_arch_id,
PA.label as arch_label
FROM rhnServerOutdatedPackages SOP
@@ -810,7 +810,7 @@ SELECT PN.name,
LEFT JOIN rhnPackageArch PA ON PA.id = SP.package_arch_id
WHERE SOP.server_id = :sid
AND SOP.package_name_id = SP.name_id
- GROUP BY SOP.package_name_id, SP.package_arch_id, PA.label
+ GROUP BY SOP.package_name_id, SP.package_arch_id, PA.label, PE.id
) full_list
INNER JOIN rhnServerPackage SP ON ( full_list.name_id = SP.name_id AND
full_list.package_arch_id = SP.package_arch_id )
INNER JOIN rhnPackageName PN ON ( PN.id = full_list.name_id )
commit 4d7f97ad59e1dc077d3227668896c1a30482fa03
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Wed May 5 17:26:55 2010 +0200
Automatic commit of package [spacewalk-java] release [1.1.10-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 7d570f9..16ed398 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -19,7 +19,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.1.9
+Version: 1.1.10
Release: 1%{?dist}
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -319,6 +319,30 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Wed May 05 2010 Tomas Lestach <tlestach(a)redhat.com> 1.1.10-1
+- 585901 - recursive comps search (tlestach(a)redhat.com)
+- More work on select all magic (paji(a)redhat.com)
+- 588901 - Fix listLatestUpgradablePackages API results
+ (joshua.roys(a)gtri.gatech.edu)
+- Fixed an accidental compile error that occured due to a previous commit
+ (paji(a)redhat.com)
+- Added some magic to show the system names and url instead of ids in the dups
+ page (paji(a)redhat.com)
+- added an nbsp to space the text better (paji(a)redhat.com)
+- Added a new tag attribute to filter by ip address (paji(a)redhat.com)
+- More list tag enhancements (paji(a)redhat.com)
+- Updated the list tag to deal with parent vs child filtering (paji(a)redhat.com)
+- More changes to properly handle selection javascript magic (paji(a)redhat.com)
+- Needed to add more JS magic to get selections to work (paji(a)redhat.com)
+- Quick fix to deal with a null pointer that would ve occued on a logdebg
+ (paji(a)redhat.com)
+- Added code to get checkbox grouping to work (paji(a)redhat.com)
+- Got the tree filters working (paji(a)redhat.com)
+- Fixed a checkstyle error (paji(a)redhat.com)
+- fixing RowRenderer, to do coloring more like the mockups
+ (jsherril(a)redhat.com)
+- Made the post reactivation key logic more fail safe.. (paji(a)redhat.com)
+
* Thu Apr 29 2010 Partha Aji <paji(a)redhat.com> 1.1.9-1
- Added new cobbler snippets to enable sytem reactivation on bare metal reprovisioning
(paji(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 1667882..a9bf514 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.1.9-1 java/
+1.1.10-1 java/
commit 5b0da627a2788330dfd60ef04b072b4dea416d05
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Wed May 5 17:08:54 2010 +0200
585901 - recursive comps search
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 fb73c8f..ca4de55 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
@@ -1184,6 +1184,13 @@ GROUP BY C.id, C.name
</query>
</mode>
+<mode name="cloned_original_id">
+ <query params="cid">
+ SELECT original_id AS id
+ FROM rhnChannelCloned
+ WHERE id = :cid
+ </query>
+</mode>
</datasource_modes>
diff --git a/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
b/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
index a16baee..3544c67 100644
--- a/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
+++ b/java/code/src/com/redhat/rhn/manager/channel/ChannelManager.java
@@ -2697,6 +2697,25 @@ public class ChannelManager extends BaseManager {
}
/**
+ * Returns an id of the original channel
+ * @param channel The cloned channel
+ * @return A original channel id
+ */
+ public static Long lookupOriginalId(Channel channel) {
+ Map params = new HashMap();
+ params.put("cid", channel.getId());
+
+ SelectMode mode = ModeFactory.getMode(
+ "Channel_queries", "cloned_original_id");
+ List<Map> list = (List) mode.execute(params);
+ if (!list.isEmpty()) {
+ Map map = list.get(0);
+ return (Long) map.get("id");
+ }
+ return null;
+ }
+
+ /**
* List errata that is within a channel that needs to be resynced
* This is determined by the packages in the channel
*
diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java
b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java
index 5b59397..f125e73 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java
@@ -18,8 +18,9 @@ import com.redhat.rhn.common.conf.Config;
import com.redhat.rhn.common.conf.ConfigDefaults;
import com.redhat.rhn.common.util.StringUtil;
import com.redhat.rhn.domain.channel.Channel;
-import com.redhat.rhn.domain.channel.ClonedChannel;
+import com.redhat.rhn.domain.channel.ChannelFactory;
import com.redhat.rhn.frontend.dto.PackageDto;
+import com.redhat.rhn.manager.channel.ChannelManager;
import com.redhat.rhn.manager.rhnpackage.PackageManager;
import com.redhat.rhn.manager.task.TaskManager;
@@ -249,7 +250,27 @@ public class RepositoryWriter {
" seconds");
}
-
+ private String getCompsRelativeFilename(Channel channel) {
+ String relativeFilename = null;
+
+ if (channel.getComps() == null) {
+ relativeFilename = getCompsFilePath(channel);
+ }
+ else {
+ relativeFilename = channel.getComps().getRelativeFilename();
+ }
+
+ // if we didn't find anything, let's check channel's original
+ if (relativeFilename == null && channel.isCloned()) {
+ // use a hack not to use ClonedChannel and it's getOriginal() method
+ Long originalChannelId = ChannelManager.lookupOriginalId(channel);
+ Channel originalChannel = ChannelFactory.lookupById(originalChannelId);
+ return getCompsRelativeFilename(originalChannel);
+ }
+
+ return relativeFilename;
+ }
+
/**
*
* @param channel channel indo
@@ -257,18 +278,8 @@ public class RepositoryWriter {
* @return repomd index for given channel
*/
private RepomdIndexData loadCompsFile(Channel channel, String checksumAlgo) {
- String relativeFilename;
String compsMount = Config.get().getString(ConfigDefaults.MOUNT_POINT);
-
- if (channel.getComps() == null) {
- relativeFilename = getCompsFilePath(channel);
- if (relativeFilename == null) {
- return null;
- }
- }
- else {
- relativeFilename = channel.getComps().getRelativeFilename();
- }
+ String relativeFilename = getCompsRelativeFilename(channel);
File compsFile = new File(compsMount + File.separator + relativeFilename);
FileInputStream stream;
@@ -345,13 +356,6 @@ public class RepositoryWriter {
if (compsMapping.containsKey(channel.getLabel())) {
compsPath = compsMapping.get(channel.getLabel());
}
- else if (channel.isCloned()) {
- // If its a cloned channel see if we can get the comps
- // from the original channel.
- ClonedChannel clonedCh = (ClonedChannel) channel;
- Channel origChannel = clonedCh.getOriginal();
- compsPath = compsMapping.get(origChannel.getLabel());
- }
return compsPath;
}
commit d2af319922df0bb1da2a3fd18154d5bf9c3313bc
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed May 5 09:44:47 2010 -0400
Automatic commit of package [rhn-client-tools] release [1.1.6-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec
b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 8402b63..2337490 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -4,7 +4,7 @@ Group: System Environment/Base
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
URL:
https://fedorahosted.org/spacewalk
Name: rhn-client-tools
-Version: 1.1.5
+Version: 1.1.6
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index 860d9dd..9233bb1 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-1.1.5-1 client/rhel/rhn-client-tools/
+1.1.6-1 client/rhel/rhn-client-tools/
commit 73241044984ccb6ad6855560308022d2512ba266
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed May 5 09:44:39 2010 -0400
removing spec update
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec
b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 24084cb..8402b63 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -246,10 +246,6 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/applications/rhn_register.desktop
%changelog
-* Wed May 05 2010 Justin Sherrill <jsherril(a)redhat.com> 1.1.5-1
-- 589120 - fixing error "no attribute cfg" when trying to install a package
- (jsherril(a)redhat.com)
-
* Wed May 05 2010 Jan Pazdziora 1.1.3-1
- 589100 - address issue when clients were not able to register to the server.
commit 50ada58fc07d4d0679c420d6e234e1ecdc2dc0a4
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed May 5 09:44:10 2010 -0400
Automatic commit of package [rhn-client-tools] release [1.1.5-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec
b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 538e357..24084cb 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -4,7 +4,7 @@ Group: System Environment/Base
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
URL:
https://fedorahosted.org/spacewalk
Name: rhn-client-tools
-Version: 1.1.4
+Version: 1.1.5
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -246,7 +246,7 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/applications/rhn_register.desktop
%changelog
-* Wed May 05 2010 Justin Sherrill <jsherril(a)redhat.com> 1.1.4-1
+* Wed May 05 2010 Justin Sherrill <jsherril(a)redhat.com> 1.1.5-1
- 589120 - fixing error "no attribute cfg" when trying to install a package
(jsherril(a)redhat.com)
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index 2c76f77..860d9dd 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-1.1.4-1 client/rhel/rhn-client-tools/
+1.1.5-1 client/rhel/rhn-client-tools/
commit 844c74b5aaacbd5a4b3c55135ed0217c9e03d2b3
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed May 5 09:44:02 2010 -0400
Automatic commit of package [yum-rhn-plugin] release [1.1.2-1].
diff --git a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
index 8255150..7afb4e6 100644
--- a/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
+++ b/client/rhel/yum-rhn-plugin/yum-rhn-plugin.spec
@@ -1,6 +1,6 @@
Summary: RHN support for yum
Name: yum-rhn-plugin
-Version: 1.1.1
+Version: 1.1.2
Release: 1%{?dist}
License: GPLv2
Group: System Environment/Base
@@ -53,6 +53,10 @@ rm -rf $RPM_BUILD_ROOT
%doc LICENSE
%changelog
+* Wed May 05 2010 Justin Sherrill <jsherril(a)redhat.com> 1.1.2-1
+- 589120 - fixing issue with traceback from rhn_chec "no attribute cfg"
+ (jsherril(a)redhat.com)
+
* Mon Apr 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.1-1
- bumping spec files to 1.1 packages
diff --git a/rel-eng/packages/yum-rhn-plugin b/rel-eng/packages/yum-rhn-plugin
index d4b04b8..191c38b 100644
--- a/rel-eng/packages/yum-rhn-plugin
+++ b/rel-eng/packages/yum-rhn-plugin
@@ -1 +1 @@
-1.1.1-1 client/rhel/yum-rhn-plugin/
+1.1.2-1 client/rhel/yum-rhn-plugin/
commit da27aded48e9710465a55a72d845d23779005a8d
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed May 5 09:42:45 2010 -0400
589120 - fixing issue with traceback from rhn_chec "no attribute cfg"
diff --git a/client/rhel/yum-rhn-plugin/actions/packages.py
b/client/rhel/yum-rhn-plugin/actions/packages.py
index 39138c9..ccf23fa 100644
--- a/client/rhel/yum-rhn-plugin/actions/packages.py
+++ b/client/rhel/yum-rhn-plugin/actions/packages.py
@@ -58,8 +58,8 @@ class YumAction(yum.YumBase):
def __init__(self):
yum.YumBase.__init__(self)
-
- self.doConfigSetup(debuglevel=rhncli.cfg["debug"])
+ cfg = config.initUp2dateConfig()
+ self.doConfigSetup(debuglevel=cfg["debug"])
self.doTsSetup()
self.doRpmDBSetup()
commit 5d83cbd9dacceba3f45463bba0be1e3bf8400d75
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed May 5 09:37:05 2010 -0400
Revert "589120 - fixing error "no attribute cfg" when trying to install
a package"
This reverts commit a437034484fb40034f59c209bb95f0c912776519.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py
b/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py
index 7c35b59..0423274 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py
@@ -42,9 +42,6 @@ from up2date_client import up2dateErrors
from up2date_client import up2dateLog
from up2date_client import up2dateUtils
-
-cfg = config.initUp2dateConfig()
-
_optionsTable = [
Option("-v", "--verbose", action="count", default=0,
help=_("Show additional output")),
commit 4aa2e2961c96da5003e2a780733ddb00f88acea4
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed May 5 08:56:58 2010 -0400
Automatic commit of package [rhn-client-tools] release [1.1.4-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec
b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 18d9400..538e357 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -4,7 +4,7 @@ Group: System Environment/Base
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
URL:
https://fedorahosted.org/spacewalk
Name: rhn-client-tools
-Version: 1.1.3
+Version: 1.1.4
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -246,6 +246,10 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/applications/rhn_register.desktop
%changelog
+* Wed May 05 2010 Justin Sherrill <jsherril(a)redhat.com> 1.1.4-1
+- 589120 - fixing error "no attribute cfg" when trying to install a package
+ (jsherril(a)redhat.com)
+
* Wed May 05 2010 Jan Pazdziora 1.1.3-1
- 589100 - address issue when clients were not able to register to the server.
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index 15cfe21..2c76f77 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-1.1.3-1 client/rhel/rhn-client-tools/
+1.1.4-1 client/rhel/rhn-client-tools/
commit a437034484fb40034f59c209bb95f0c912776519
Author: Justin Sherrill <jsherril(a)redhat.com>
Date: Wed May 5 08:52:14 2010 -0400
589120 - fixing error "no attribute cfg" when trying to install a package
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py
b/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py
index 0423274..7c35b59 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py
@@ -42,6 +42,9 @@ from up2date_client import up2dateErrors
from up2date_client import up2dateLog
from up2date_client import up2dateUtils
+
+cfg = config.initUp2dateConfig()
+
_optionsTable = [
Option("-v", "--verbose", action="count", default=0,
help=_("Show additional output")),
commit 0083cbff357046a3d162f7d167ed997fe96ef0b1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed May 5 14:19:35 2010 +0200
Automatic commit of package [rhn-client-tools] release [1.1.3-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec
b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 12676a5..18d9400 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -4,7 +4,7 @@ Group: System Environment/Base
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
URL:
https://fedorahosted.org/spacewalk
Name: rhn-client-tools
-Version: 1.1.2
+Version: 1.1.3
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -246,6 +246,9 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/applications/rhn_register.desktop
%changelog
+* Wed May 05 2010 Jan Pazdziora 1.1.3-1
+- 589100 - address issue when clients were not able to register to the server.
+
* Thu Apr 29 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.1.2-1
- 585386 - do not fail if file do not exist
- bump up version
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index b3883e8..15cfe21 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-1.1.2-1 client/rhel/rhn-client-tools/
+1.1.3-1 client/rhel/rhn-client-tools/
commit db3f1bd553304d4589d54d9d6ce6e45ef9d3915a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Wed May 5 14:16:30 2010 +0200
589100 - Revert "Check the capability in cfg."
This reverts commit 015c750daa164e80cca51bd683270fa1f91352ad.
The change caused a mismatch between the capabilities reported by
the client and the data type sent.
We revert while knowing that this will cause an additional
registration.welcome_message XMLRPC call before each
registration.add_packages.
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index edac93b..eb9df6d 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -472,7 +472,7 @@ def sendHardware(systemId, hardwareList):
def sendPackages(systemId, packageList):
s = rhnserver.RhnServer()
- if not cfg['supportsExtendedPackageProfile'] == 2:
+ if not s.capabilities.hasCapability('xmlrpc.packages.extended_profile', 2):
# for older satellites and hosted - convert to old format
packageList = convertPackagesFromHashToList(packageList)
s.registration.add_packages(systemId, packageList)
commit ea44ac2923e456529838dcd3a30abde3b3436005
Author: Partha Aji <paji(a)redhat.com>
Date: Tue May 4 20:36:56 2010 -0400
More work on select all magic
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/BaseDto.java
b/java/code/src/com/redhat/rhn/frontend/dto/BaseDto.java
index 5dbc591..9da1d13 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/BaseDto.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/BaseDto.java
@@ -14,6 +14,7 @@
*/
package com.redhat.rhn.frontend.dto;
+import com.redhat.rhn.domain.Identifiable;
import com.redhat.rhn.domain.rhnset.RhnSet;
import com.redhat.rhn.frontend.struts.Selectable;
@@ -25,7 +26,7 @@ import org.apache.commons.lang.builder.ToStringBuilder;
* select all.
* @version $Rev: 60953 $
*/
-public abstract class BaseDto implements Selectable {
+public abstract class BaseDto implements Selectable, Identifiable {
private boolean selected;
protected static final Integer ONE = new Integer(1);
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/NetworkDto.java
b/java/code/src/com/redhat/rhn/frontend/dto/NetworkDto.java
index ab84260..069ca05 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/NetworkDto.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/NetworkDto.java
@@ -25,14 +25,11 @@ import java.util.Date;
* @version $Rev$
*/
public class NetworkDto implements Identifiable {
-
private String name;
private Long systemId;
private String key;
private Date lastCheckin;
-
-
/**
* @return Returns the lastCheckin.
*/
@@ -99,14 +96,4 @@ public class NetworkDto implements Identifiable {
name = nameIn;
}
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String toString() {
- return String.format("Key: %s; System Id: %s; Last Check In: %s",
- getKey(), getId(), getLastCheckin());
- }
-
}
diff --git a/java/code/src/com/redhat/rhn/frontend/struts/BaseSetHelper.java
b/java/code/src/com/redhat/rhn/frontend/struts/BaseSetHelper.java
index e95b803..a265d9c 100644
--- a/java/code/src/com/redhat/rhn/frontend/struts/BaseSetHelper.java
+++ b/java/code/src/com/redhat/rhn/frontend/struts/BaseSetHelper.java
@@ -100,16 +100,18 @@ public class BaseSetHelper {
if (klass != null) {
Context threadContext = Context.getCurrentContext();
klass.prepare(threadContext.getLocale());
- filterList = ListFilterHelper.filter(dataSet, klass,
- request.getParameter(
- ListTagUtil.makeFilterByLabel(uniqueName)),
- ListTagHelper.getFilterValue(request, uniqueName),
- ListTagHelper.canSearchByParent(request,
uniqueName),
- ListTagHelper.canSearchByChild(request,
uniqueName));
}
+ filterList = ListFilterHelper.filterChildren(dataSet, klass,
+ request.getParameter(
+ ListTagUtil.makeFilterByLabel(uniqueName)),
+ ListTagHelper.getFilterValue(request, uniqueName),
+ ListTagHelper.canSearchByParent(request, uniqueName),
+ ListTagHelper.canSearchByChild(request, uniqueName));
}
else {
- filterList = dataSet;
+ filterList = ListFilterHelper.filterChildren(dataSet, null, null, null,
+ ListTagHelper.canSearchByParent(request, uniqueName),
+ ListTagHelper.canSearchByChild(request, uniqueName));
}
selectAll(set, listName, filterList);
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
index 90ce809..c1723b2 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
@@ -20,7 +20,6 @@ import com.redhat.rhn.common.util.DynamicComparator;
import com.redhat.rhn.common.util.MethodUtil;
import com.redhat.rhn.common.util.StringUtil;
import com.redhat.rhn.frontend.html.HtmlTag;
-import com.redhat.rhn.frontend.struts.Expandable;
import com.redhat.rhn.frontend.struts.RequestContext;
import org.apache.commons.lang.StringUtils;
@@ -114,23 +113,8 @@ public class DataSetManipulator {
}
private List expand(List data) {
- List expanded = new LinkedList();
- for (Object obj : data) {
- expanded.add(obj);
- if (obj instanceof Expandable) {
- Expandable ex = (Expandable) obj;
- List children = ex.expand();
- if (searchChild && filter != null) {
- expanded.addAll(ListFilterHelper.filter(children,
- filter, filterBy, filterValue, searchParent, searchChild));
- }
- else {
- expanded.addAll(children);
- }
-
- }
- }
- return expanded;
+ return ListFilterHelper.filterChildren(data,
+ filter, filterBy, filterValue, searchParent, searchChild);
}
/**
* Get the total (non-filtered, non-paginated) dataset size
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java
index 6efb977..2bac41c 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java
@@ -19,6 +19,7 @@ import com.redhat.rhn.frontend.struts.Expandable;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
+import java.util.LinkedList;
import java.util.List;
/**
@@ -45,6 +46,39 @@ public class ListFilterHelper {
* in the list when filtering.
* @return the filtered list
*/
+ public static List filterChildren(List dataSet, ListFilter filter, String filterBy,
+ String filterValue, boolean searchParent, boolean searchChild) {
+ List expanded = new LinkedList();
+ for (Object obj : dataSet) {
+ expanded.add(obj);
+ if (obj instanceof Expandable) {
+ Expandable ex = (Expandable) obj;
+ List children = ex.expand();
+ if (searchChild && filter != null) {
+ expanded.addAll(filter(children,
+ filter, filterBy, filterValue, searchParent, searchChild));
+ }
+ else {
+ expanded.addAll(children);
+ }
+
+ }
+ }
+ return expanded;
+ }
+
+ /**
+ * Filter a list using the specified filter
+ * @param dataSet the dataset to filter
+ * @param filter the filter to use
+ * @param filterBy which value to filter by in the bean
+ * @param filterValue the value to filter on
+ * @param searchParent true if we want to search the parent value
+ * in the list when filtering.
+ * @param searchChild true if we want to search the child value
+ * in the list when filtering.
+ * @return the filtered list
+ */
public static List filter(List dataSet, ListFilter filter, String filterBy,
String filterValue, boolean searchParent, boolean searchChild) {
String tmp = null;
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
index 4cca188..9fc7121 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
@@ -237,6 +237,14 @@ public class ListTag extends BodyTagSupport {
public void setName(String nameIn) {
name = nameIn;
}
+
+ /**
+ * The name of the list
+ * @return the list name
+ */
+ public String getName() {
+ return name;
+ }
/**
* Build the list's unique name Algorithm for the unique name is: Take the
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java
index ac05db5..4bd4e7a 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java
@@ -17,9 +17,13 @@ package com.redhat.rhn.frontend.taglibs.list;
import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.frontend.struts.Expandable;
import com.redhat.rhn.frontend.taglibs.RhnListTagFunctions;
+import com.redhat.rhn.frontend.taglibs.list.helper.ListSessionSetHelper;
import org.apache.commons.lang.StringUtils;
+import java.util.Map;
+
+import javax.servlet.ServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.BodyTagSupport;
@@ -34,8 +38,12 @@ public class SelectableColumnTag extends TagSupport {
private static final long serialVersionUID = 2749189931275777440L;
private static final String CHECKBOX_CLICKED_SCRIPT =
- "process_checkbox_clicked(this,'%s', this.form.%s, %s,
%s, '%s', %s)";
- private static final String CHECK_ALL_SCRIPT = "process_check_all('%s',
%s, %s, %s)";
+ "%s(%s,'%s', document.getElementById('%s'), %s,
%s, '%s', %s);";
+ private static final String CLICKED_COMPLETE = "process_checkbox_clicked";
+ private static final String CLICKED_CLIENT_SIDE =
+
"process_checkbox_clicked_client_side";
+
+ private static final String CHECK_ALL_SCRIPT = "process_check_all('%s',
%s, %s, %s);";
private String valueExpr;
private String selectExpr;
private String disabledExpr;
@@ -45,6 +53,7 @@ public class SelectableColumnTag extends TagSupport {
private String headerKey;
private String listName;
private String rhnSet;
+
/**
* Sets the column width
* @param widthIn column width
@@ -187,8 +196,13 @@ public class SelectableColumnTag extends TagSupport {
private void renderOnClickForSelectAll() throws JspException {
ListTagUtil.write(pageContext, "<input type=\"checkbox\"
");
ListTagUtil.write(pageContext, " name=\"");
- ListTagUtil.write(pageContext, makeSelectAllCheckboxName());
+ ListTagUtil.write(pageContext, makeSelectAllCheckboxName(listName));
ListTagUtil.write(pageContext, "\" ");
+
+ ListTagUtil.write(pageContext, " id=\"");
+ ListTagUtil.write(pageContext, makeSelectAllCheckboxId(listName));
+ ListTagUtil.write(pageContext, "\" ");
+
ListTagUtil.write(pageContext, "onclick=\"");
String script = String.format(CHECK_ALL_SCRIPT,
StringUtils.defaultString(rhnSet),
@@ -205,9 +219,11 @@ public class SelectableColumnTag extends TagSupport {
private void render(String value) throws JspException {
writeStartingTd();
String id = ListTagHelper.getObjectId(getCurrent());
+ String checkboxId = makeCheckboxId(listName, id);
renderHiddenItem(id, value);
ListTagUtil.write(pageContext, "<input type=\"checkbox\"
");
- if (isSelected()) {
+ boolean selected = isSelected();
+ if (selected) {
ListTagUtil.incrementPersistentCounter(pageContext, listName +
"_selected");
ListTagUtil.write(pageContext, "checked ");
}
@@ -215,7 +231,8 @@ public class SelectableColumnTag extends TagSupport {
ListTagUtil.write(pageContext, "disabled ");
}
ListTagUtil.write(pageContext, "id=\"");
- ListTagUtil.write(pageContext, makeCheckboxId(id));
+
+ ListTagUtil.write(pageContext, checkboxId);
ListTagUtil.write(pageContext, "\" name=\"" + ListTagUtil.
makeSelectedItemsName(listName) +
"\" ");
ListTagUtil.write(pageContext, "value=\"");
@@ -224,13 +241,37 @@ public class SelectableColumnTag extends TagSupport {
renderOnClick();
ListTagUtil.write(pageContext, "/>");
+ if (selected && !StringUtils.isBlank(rhnSet)) {
+ String scriptId = "document.getElementById('" + checkboxId +
"')";
+ addPostScript(getOnClickScript(CLICKED_CLIENT_SIDE, scriptId),
+ listName, pageContext.getRequest());
+ }
}
- private String makeSelectAllCheckboxName() {
+ /**
+ * Given list name returns the name of the select all box
+ * @param listName the name of the list
+ * @return the name of the select all check box
+ */
+ public static String makeSelectAllCheckboxName(String listName) {
return "list_" + listName + "_sel_all";
}
- private String makeCheckboxId(String id) {
+ /**
+ * Given list name returns the name of the select all box
+ * @param listName the name of the list
+ * @return the name of the select all check box
+ */
+ public static String makeSelectAllCheckboxId(String listName) {
+ return "list_" + listName + "_sel_all_id";
+ }
+ /**
+ * Given list name returns the name of a check box
+ * @param listName the name of the id
+ * @param id the object id of the check box value object
+ * @return the checkbox id
+ */
+ public static String makeCheckboxId(String listName, String id) {
return "list_" + listName + "_" + id;
}
/**
@@ -240,34 +281,46 @@ public class SelectableColumnTag extends TagSupport {
*/
private void renderOnClick() throws JspException {
if (!StringUtils.isBlank(rhnSet)) {
- Object current = getCurrent();
- Object parent = getParentObject();
- String childIds = "[]";
- String memberIds = "[]";
- String parentId = "";
- ListTag parentTag = (ListTag)
- BodyTagSupport.findAncestorWithClass(this, ListTag.class);
-
- if (RhnListTagFunctions.isExpandable(current)) {
- childIds = getChildIds(current);
- }
- else {
- parentId = getParentId(current, parent);
- memberIds = getMemberIds(current, parent);
- }
-
ListTagUtil.write(pageContext, " onclick=\"");
- ListTagUtil.write(pageContext, String.format(CHECKBOX_CLICKED_SCRIPT,
- rhnSet, makeSelectAllCheckboxName(),
- childIds, memberIds, parentId,
- parentTag.isParentAnElement()));
+ ListTagUtil.write(pageContext, getOnClickScript(CLICKED_COMPLETE,
"this"));
ListTagUtil.write(pageContext, "\" ");
}
}
+ /**
+ * renders
+ * //onclick="checkbox_clicked(this, '$rhnSet')"
+ *
+ */
+ private String getOnClickScript(String funcName, String boxName) {
+ Object current = getCurrent();
+ Object parent = getParentObject();
+ String childIds = "[]";
+ String memberIds = "[]";
+ String parentId = "";
+ ListTag parentTag = (ListTag)
+ BodyTagSupport.findAncestorWithClass(this, ListTag.class);
+
+ if (RhnListTagFunctions.isExpandable(current)) {
+ childIds = getChildIds(current);
+ }
+ else {
+ parentId = getParentId(current, parent);
+ memberIds = getMemberIds(current, parent);
+ }
+
+ return String.format(CHECKBOX_CLICKED_SCRIPT, funcName, boxName,
+ rhnSet, makeSelectAllCheckboxId(listName),
+ childIds, memberIds, parentId,
+ parentTag.isParentAnElement());
+
+ }
+
+
+
private String getParentId(Object current, Object parent) {
if (parent != null && parent != current) {
- return makeCheckboxId(ListTagHelper.getObjectId(parent));
+ return makeCheckboxId(listName, ListTagHelper.getObjectId(parent));
}
return "";
}
@@ -280,7 +333,7 @@ public class SelectableColumnTag extends TagSupport {
buf.append(",");
}
buf.append("'");
- buf.append(makeCheckboxId(ListTagHelper.getObjectId(child)));
+ buf.append(makeCheckboxId(listName, ListTagHelper.getObjectId(child)));
buf.append("'");
}
@@ -314,10 +367,17 @@ public class SelectableColumnTag extends TagSupport {
}
private boolean isSelected() throws JspException {
- if (selectExpr != null && selectExpr.equalsIgnoreCase("true"))
{
- return true;
- }
- return false;
+ if (!StringUtils.isBlank(selectExpr)) {
+ return selectExpr.equalsIgnoreCase("true");
+ }
+
+ ListTag parent = (ListTag)BodyTagSupport.
+ findAncestorWithClass(this, ListTag.class);
+
+ String selectionsKey =
ListSessionSetHelper.makeSelectionsName(parent.getName());
+ Map selections = (Map)pageContext.getRequest().getAttribute(selectionsKey);
+
+ return selections != null && selections.containsKey(valueExpr);
}
private boolean isDisabled() throws JspException {
@@ -374,7 +434,8 @@ public class SelectableColumnTag extends TagSupport {
buf.append(",");
}
buf.append("'");
- buf.append(makeCheckboxId(ListTagHelper.getObjectId(current)));
+ buf.append(makeCheckboxId(listName,
+ ListTagHelper.getObjectId(current)));
buf.append("'");
}
}
@@ -383,5 +444,37 @@ public class SelectableColumnTag extends TagSupport {
return buf.toString();
}
return "[]";
+ }
+
+ private static String makePostScriptKey(String listName) {
+ return "list_" + listName + "_post_script";
+ }
+
+ private static void addPostScript(String script, String listName,
+ ServletRequest request) {
+ String key = makePostScriptKey(listName);
+ StringBuilder test = (StringBuilder)request.getAttribute(key);
+ if (test == null) {
+ test = new StringBuilder();
+ request.setAttribute(key, test);
+ }
+ test.append(script);
+ }
+
+ /**
+ * Returns any bound post java script
+ * to be used by the selectable decorator
+ * @param listName the name of the list
+ * @param request the request param
+ * @return the post script
+ */
+ public static String getPostScript(String listName,
+ ServletRequest request) {
+ String key = makePostScriptKey(listName);
+ StringBuilder test = (StringBuilder)request.getAttribute(key);
+ if (test != null) {
+ return test.toString();
+ }
+ return "";
}
}
diff --git
a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ListDecorator.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ListDecorator.java
index e194b57..683d2fe 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ListDecorator.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ListDecorator.java
@@ -48,7 +48,7 @@ public interface ListDecorator {
* @throws JspException something bad happened
*/
void afterTopPagination() throws JspException;
-
+
/**
* Notifies the decorator that bottom pagination controls have been rendered
* @throws JspException something bad happened
diff --git
a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/SelectableDecorator.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/SelectableDecorator.java
index d2d1c95..58b8d65 100644
---
a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/SelectableDecorator.java
+++
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/SelectableDecorator.java
@@ -18,6 +18,9 @@ import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.frontend.html.HtmlTag;
import com.redhat.rhn.frontend.taglibs.ListDisplayTag;
import com.redhat.rhn.frontend.taglibs.list.ListTagUtil;
+import com.redhat.rhn.frontend.taglibs.list.SelectableColumnTag;
+
+import org.apache.commons.lang.StringUtils;
import javax.servlet.jsp.JspException;
@@ -28,6 +31,9 @@ import javax.servlet.jsp.JspException;
*/
public class SelectableDecorator extends BaseListDecorator {
private static final String NULL_SELECTION = "0";
+ private static final String JAVASCRIPT_TAG =
+ "<script
type=\"text/javascript\">%s</script>";
+
/**
* {@inheritDoc}
*/
@@ -59,11 +65,16 @@ public class SelectableDecorator extends BaseListDecorator {
*/
public void afterList() throws JspException {
renderSelectButtons();
+ String script = SelectableColumnTag.
+ getPostScript(listName, pageContext.getRequest());
+ if (!StringUtils.isBlank(script)) {
+ ListTagUtil.write(pageContext, String.format(JAVASCRIPT_TAG, script));
+ }
}
private void renderSelectedCaption(boolean isHeader) throws JspException {
if (!currentList.isEmpty()) {
- String selectedName = "list_" + listName +
"_selected_amt";
+ String selectedName = ListTagUtil.makeSelectedAmountName(listName);
String selected = (String)
pageContext.getRequest().getAttribute(selectedName);
if (selected == null) {
selected = NULL_SELECTION;
@@ -115,5 +126,4 @@ public class SelectableDecorator extends BaseListDecorator {
ListTagUtil.write(pageContext, buf.toString());
}
}
-
}
diff --git
a/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListRhnSetHelper.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListRhnSetHelper.java
index b2e5a1c..a2b795f 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListRhnSetHelper.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListRhnSetHelper.java
@@ -150,9 +150,9 @@ public class ListRhnSetHelper extends ListSetHelper {
/** {@inheritDoc} */
protected Map getSelections() {
- Map<Long, Long> selections = new HashMap<Long, Long>();
+ Map<String, String> selections = new HashMap<String, String>();
for (Long id : set.getElementValues()) {
- selections.put(id, id);
+ selections.put(id.toString(), id.toString());
}
return selections;
}
diff --git
a/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListSessionSetHelper.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListSessionSetHelper.java
index d8a49ea..b9895d7 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListSessionSetHelper.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListSessionSetHelper.java
@@ -141,10 +141,9 @@ public class ListSessionSetHelper extends ListSetHelper {
/** {@inheritDoc} */
protected Map getSelections() {
- Map<Long, Long> selections = new HashMap<Long, Long>();
+ Map<String, String> selections = new HashMap<String, String>();
for (Object id : set) {
- Long item = Long.valueOf(id.toString());
- selections.put(item, item);
+ selections.put(id.toString(), id.toString());
}
return selections;
}
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListSetHelper.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListSetHelper.java
index 6290e92..4ad7e5e 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListSetHelper.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/helper/ListSetHelper.java
@@ -196,15 +196,23 @@ abstract class ListSetHelper extends ListHelper {
if (dataSet.get(0) instanceof Selectable) {
syncSelections(dataSet);
}
- else {
- request.setAttribute(
- getListName() + "Selections",
- getSelections());
- }
+ request.setAttribute(
+ makeSelectionsName(getListName()),
+ getSelections());
}
}
/**
+ * Returns the name of the selections key.
+ * @param listName the name of the list
+ * i.e. the value specifidied in <rl:list name=>
+ * @return
+ */
+ public static String makeSelectionsName(String listName) {
+ return listName + "Selections";
+ }
+
+ /**
* @return the initSet
*/
protected Set getPreSelected() {
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
index e1c6dd4..e3b91cd 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
@@ -258,7 +258,7 @@
</attribute>
<attribute>
<name>selected</name>
- <required>true</required>
+ <required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/activationkeys/groups.jspf
b/java/code/webapp/WEB-INF/pages/common/fragments/activationkeys/groups.jspf
index 2ceaa86..8705ac8 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/activationkeys/groups.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/activationkeys/groups.jspf
@@ -33,7 +33,6 @@
<rl:decorator name="PageSizeDecorator"/>
<rl:decorator name="SelectableDecorator"/>
<rl:selectablecolumn value="${current.id}"
- selected="${not empty requestScope.listSelections[current.id]}"
styleclass="first-column"/>
<!--Name Column -->
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/systems/groups.jspf
b/java/code/webapp/WEB-INF/pages/common/fragments/systems/groups.jspf
index 80a0d1c..0f4fdbb 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/systems/groups.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/systems/groups.jspf
@@ -46,7 +46,6 @@
<rhn:require acl="user_role(org_admin) or
user_role(system_group_admin)">
<rl:decorator name="SelectableDecorator"/>
<rl:selectablecolumn value="${current.id}"
- selected="${not empty requestScope.listSelections[current.id]}"
styleclass="first-column"/>
</rhn:require>
<!--Name Column -->
diff --git a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
index 63c48dc..ab5275a 100644
--- a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
@@ -32,12 +32,10 @@
<c:choose>
<c:when test = "${rl:expandable(current)}">
<rl:selectablecolumn value="${current.key}"
- selected="false"
styleclass="first-column"/>
</c:when>
<c:otherwise>
<rl:selectablecolumn value="${current.id}"
- selected="false"
styleclass="first-column"/>
</c:otherwise>
diff --git a/web/html/javascript/check_all.js b/web/html/javascript/check_all.js
index b422c0a..de93333 100644
--- a/web/html/javascript/check_all.js
+++ b/web/html/javascript/check_all.js
@@ -104,6 +104,11 @@ function checkbox_clicked(thebox, set_label) {
**/
function process_checkbox_clicked(thebox, set_label, checkall, children, members,
parent_id, parentIsElement) {
+ var a = process_checkbox_clicked_client_side(thebox, set_label, checkall, children,
members, parent_id, parentIsElement);
+ update_server_set("ids", set_label, thebox.checked, a);
+}
+
+function process_checkbox_clicked_client_side(thebox, set_label, checkall, children,
members, parent_id, parentIsElement) {
var a = new Array();
if (parent_id == '') {
if(parentIsElement) {
@@ -135,10 +140,11 @@ function process_checkbox_clicked(thebox, set_label, checkall,
children, members
}
var cboxes = eval("document.forms['" + form_name + "']."
+ thebox.name);
process_single_checkbox(cboxes, checkall);
-
- update_server_set("ids", set_label, thebox.checked, a);
+ return a;
}
+
+
function process_single_checkbox(cboxes, checkall) {
var i;
var count_checked_or_disabled = 0;
commit 3f6829d6aa6f06cee89e235f2519fb128a7ab8e7
Author: Joshua Roys <joshua.roys(a)gtri.gatech.edu>
Date: Tue May 4 19:23:32 2010 +0000
588901 - Fix listLatestUpgradablePackages API results
The underlying SQL query did not take arch into account.
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
index 9eb006a..f85a521 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Package_queries.xml
@@ -789,44 +789,34 @@ ORDER BY UPPER(PN.name)
<mode name="system_upgradable_package_list_no_errata_info">
<query params="sid">
-SELECT distinct
- pn.name,
+SELECT PN.name,
NVL(PE.epoch, ' ') as FROM_EPOCH,
NVL(PE.version, ' ') as FROM_VERSION,
NVL(PE.release, ' ') as FROM_RELEASE,
NVL(full_list.evr.epoch, ' ') as TO_EPOCH,
NVL(full_list.evr.version, ' ') as TO_VERSION,
NVL(full_list.evr.release, ' ') as TO_RELEASE,
+ full_list.arch_label as ARCH,
P.id as TO_PACKAGE_ID
FROM (
SELECT SOP.package_name_id name_id,
- MAX(pe.evr) evr,
- SOP.server_id server_id,
- SOP.errata_id errata_id,
- SOP.errata_advisory errata_advisory,
- pe.id as evr_id
- FROM rhnPackageEVR PE, rhnServerOutdatedPackages SOP
+ MAX(PE.evr) evr,
+ MAX(PE.id) evr_id,
+ SP.package_arch_id,
+ PA.label as arch_label
+ FROM rhnServerOutdatedPackages SOP
+ INNER JOIN rhnServerPackage SP ON SP.server_id = SOP.server_id
+ INNER JOIN rhnPackageEVR PE ON SOP.package_evr_id = PE.id
+ LEFT JOIN rhnPackageArch PA ON PA.id = SP.package_arch_id
WHERE SOP.server_id = :sid
- AND SOP.package_evr_id = PE.id
- GROUP BY SOP.package_name_id, SOP.server_id, SOP.errata_id,
- SOP.errata_advisory, pe.id
- ) full_list,
- rhnPackageEVR PE,
- rhnPackageName PN,
- rhnChannelNewestPackage CNP,
- rhnServerChannel SC,
- rhnServerPackage SP,
- rhnPackage P
- WHERE SC.server_id = :sid
- AND SP.server_id = :sid
- AND SP.name_id = PN.id
- AND SP.evr_id = PE.id
- AND SC.channel_id = CNP.channel_id
- AND CNP.name_id = full_list.name_id
- AND CNP.evr_id = full_list.evr_id
- AND full_list.name_id = PN.id
- AND P.evr_id = full_list.evr_id
- AND P.name_id = PN.id
+ AND SOP.package_name_id = SP.name_id
+ GROUP BY SOP.package_name_id, SP.package_arch_id, PA.label
+ ) full_list
+ INNER JOIN rhnServerPackage SP ON ( full_list.name_id = SP.name_id AND
full_list.package_arch_id = SP.package_arch_id )
+ INNER JOIN rhnPackageName PN ON ( PN.id = full_list.name_id )
+ INNER JOIN rhnPackageEVR PE ON ( SP.evr_id = PE.id )
+ INNER JOIN rhnPackage P on ( P.name_id = full_list.name_id AND P.evr_id =
full_list.evr_id AND P.package_arch_id = full_list.package_arch_id )
+ WHERE SP.server_id = :sid
</query>
</mode>
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 4cdd50f..460e15b 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
@@ -1002,6 +1002,7 @@ public class SystemHandler extends BaseHandler {
* @xmlrpc.returntype
* #struct("package")
* #prop("string", "name")
+ * #prop("string", "arch")
* #prop("string", "from_version")
* #prop("string", "from_release")
* #prop("string", "from_epoch")
commit c515ae7341e79cb3c6228b3350ecaecc9e5c4d40
Author: Partha Aji <paji(a)redhat.com>
Date: Tue May 4 13:39:05 2010 -0400
Fixed an accidental compile error that occured due to a previous commit
diff --git a/java/code/src/com/redhat/rhn/frontend/struts/BaseSetHelper.java
b/java/code/src/com/redhat/rhn/frontend/struts/BaseSetHelper.java
index 57306df..e95b803 100644
--- a/java/code/src/com/redhat/rhn/frontend/struts/BaseSetHelper.java
+++ b/java/code/src/com/redhat/rhn/frontend/struts/BaseSetHelper.java
@@ -103,7 +103,9 @@ public class BaseSetHelper {
filterList = ListFilterHelper.filter(dataSet, klass,
request.getParameter(
ListTagUtil.makeFilterByLabel(uniqueName)),
- ListTagHelper.getFilterValue(request, uniqueName));
+ ListTagHelper.getFilterValue(request, uniqueName),
+ ListTagHelper.canSearchByParent(request,
uniqueName),
+ ListTagHelper.canSearchByChild(request,
uniqueName));
}
}
else {
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
index 670d50c..4cca188 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
@@ -461,7 +461,8 @@ public class ListTag extends BodyTagSupport {
setupFilterUI();
if (filter != null && !isEmpty()) {
ListTagUtil.renderFilterUI(pageContext, filter,
- getUniqueName(), width, columnCount);
+ getUniqueName(), width, columnCount,
+ searchParent, searchChild);
}
if (isSortable()) {
String sortByLabel = ListTagUtil.makeSortByLabel(getUniqueName());
@@ -642,6 +643,9 @@ public class ListTag extends BodyTagSupport {
excludeParams.add(ListTagUtil.makeFilterByLabel(getUniqueName()));
excludeParams.add(ListTagUtil.makeFilterValueByLabel(getUniqueName()));
excludeParams.add(ListTagUtil.makeOldFilterValueByLabel(getUniqueName()));
+
excludeParams.add(ListTagUtil.makeFilterSearchChildLabel(getUniqueName()));
+ excludeParams.add(ListTagUtil.
+ makeFilterSearchParentLabel(getUniqueName()));
ListTagUtil.write(pageContext,
ListTagUtil.makeParamsLink(pageContext.getRequest(), name,
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTagHelper.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTagHelper.java
index 3dccde0..f020a55 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTagHelper.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTagHelper.java
@@ -225,8 +225,33 @@ public class ListTagHelper {
else {
return newValue;
}
-
}
+
+ /**
+ * returns true if the list that is being filtered upon
+ * is allowed to search on the parent object
+ * (always true for normal list)
+ * @param request the request to look in
+ * @param uniqueName the unique (hashed) name for the list
+ * @return true if the parent is allowed to search
+ */
+ public static boolean canSearchByParent(ServletRequest request, String uniqueName) {
+ return ListTagUtil.toBoolean(request.getParameter(
+ ListTagUtil.makeFilterSearchParentLabel(uniqueName)));
+ }
+
+ /**
+ * returns true if the list that is being filtered upon is allowed to
+ * search on the child object (always false for normal list)
+ * @param request the request to look in
+ * @param uniqueName the unique (hashed) name for the list
+ * @return true if the search is allowed to search
+ */
+ public static boolean canSearchByChild(ServletRequest request, String uniqueName) {
+ return ListTagUtil.toBoolean(request.getParameter(
+ ListTagUtil.makeFilterSearchChildLabel(uniqueName)));
+ }
+
/**
* Returns the object id given an object
* deals with selectable/identifiable objects
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTagUtil.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTagUtil.java
index ebb06ef..83456c9 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTagUtil.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTagUtil.java
@@ -46,6 +46,8 @@ import javax.servlet.jsp.tagext.Tag;
* @version $Rev $
*/
public class ListTagUtil {
+ private static final String HIDDEN_TEXT = "<input type=\"hidden\"
" +
+ "name=\"%s\"
value=\"%s\"/>";
private static final String IE_MAGIC_SNIPPET = "<!--[if IE]><input
type=\"text\" " +
"style=\"display: none;\" disabled=\"disabled\"
size=\"1\" /><![endif]-->";
@@ -293,6 +295,25 @@ public class ListTagUtil {
}
/**
+ * provides the filter label on the boolean search parent
+ * @param listName the list name
+ * @return the url key for filter value label
+ */
+ public static String makeFilterSearchParentLabel(String listName) {
+ return "list_" + listName + "_search_parent";
+ }
+
+ /**
+ * provides the filter label on the boolean search child
+ * @param listName the list name
+ * @return the url key for filter value label
+ */
+ public static String makeFilterSearchChildLabel(String listName) {
+ return "list_" + listName + "_search_child";
+ }
+
+
+ /**
* provides the filter label (what to sort by) url key
* @param listName the list name
* @return the url key for filter value label
@@ -573,10 +594,13 @@ public class ListTagUtil {
* @param uniqueName name of the list
* @param width width of the list
* @param columnCount list's column count
+ * @param searchParent true if list tag allows searching of parent
+ * @param searchChild true if the list tag allows searching of child
* @throws JspException if something bad happens writing to the page
*/
public static void renderFilterUI(PageContext pageContext, ListFilter filter,
- String uniqueName, String width, int columnCount) throws JspException {
+ String uniqueName, String width, int columnCount,
+ boolean searchParent, boolean searchChild) throws JspException {
LocalizationService ls = LocalizationService.getInstance();
HttpServletRequest request = (HttpServletRequest) pageContext
.getRequest();
@@ -586,15 +610,16 @@ public class ListTagUtil {
String filterName = makeFilterNameByLabel(uniqueName);
String filterValue = ListTagHelper.getFilterValue(pageContext.getRequest(),
uniqueName);
-
+
+
//We set this so we know next time around what the old filter value was
- ListTagUtil.write(pageContext, "<input type=\"hidden\"
name=\"");
- ListTagUtil.write(pageContext, makeOldFilterValueByLabel(uniqueName));
- ListTagUtil.write(pageContext, "\" value=\"");
- ListTagUtil.write(pageContext, filterValue);
- ListTagUtil.write(pageContext, "\" />");
-
-
+ ListTagUtil.write(pageContext, String.format(HIDDEN_TEXT,
+ makeOldFilterValueByLabel(uniqueName), filterValue));
+ ListTagUtil.write(pageContext, String.format(HIDDEN_TEXT,
+ makeFilterSearchParentLabel(uniqueName), searchParent));
+ ListTagUtil.write(pageContext, String.format(HIDDEN_TEXT,
+ makeFilterSearchChildLabel(uniqueName), searchChild));
+
ListTagUtil.write(pageContext, "<td");
ListTagUtil.write(pageContext, " align=\"left\">");
List fields = filter.getFieldNames();
commit 0ab574b01ea7adfd2ad54e9d7e4e57d1ce0c79b9
Author: Partha Aji <paji(a)redhat.com>
Date: Tue May 4 13:14:00 2010 -0400
Added some magic to show the system names and url instead of ids in the dups page
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
index 17d4725..143f3c0 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml
@@ -1587,7 +1587,7 @@ DELETE FROM rhnSatelliteChannelFamily WHERE server_id = :sid
<mode name="duplicate_system_ids_ip"
class="com.redhat.rhn.frontend.dto.NetworkDto">
<query params="uid">
- SELECT distinct S.id as id, NI.ip_addr as key, si.checkin as last_checkin
+ SELECT distinct S.id as id, S.name as name, NI.ip_addr as key, si.checkin as
last_checkin
from rhnServer S inner join
rhnUserServerPerms USP on S.id = USP.server_id inner join
rhnServerNetInterface NI on NI.server_id = S.id inner join
@@ -1606,7 +1606,7 @@ DELETE FROM rhnSatelliteChannelFamily WHERE server_id = :sid
<mode name="duplicate_system_ids_mac"
class="com.redhat.rhn.frontend.dto.NetworkDto">
<query params="uid">
- SELECT distinct S.id as id, NI.hw_addr as key, si.checkin as last_checkin
+ SELECT distinct S.id as id, S.name as name, NI.hw_addr as key, si.checkin as
last_checkin
from rhnServer S inner join
rhnUserServerPerms USP on S.id = USP.server_id inner join
rhnServerNetInterface NI on NI.server_id = S.id inner join
@@ -1624,7 +1624,7 @@ DELETE FROM rhnSatelliteChannelFamily WHERE server_id = :sid
<mode name="duplicate_system_ids_hostname"
class="com.redhat.rhn.frontend.dto.NetworkDto">
<query params="uid">
- SELECT distinct S.id as id, NI.hostname as key, si.checkin as last_checkin
+ SELECT distinct S.id as id, S.name as name, NI.hostname as key, si.checkin as
last_checkin
from rhnServer S inner join
rhnUserServerPerms USP on S.id = USP.server_id inner join
rhnServerNetwork NI on NI.server_id = S.id inner join
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/NetworkDto.java
b/java/code/src/com/redhat/rhn/frontend/dto/NetworkDto.java
index 511d32a..ab84260 100644
--- a/java/code/src/com/redhat/rhn/frontend/dto/NetworkDto.java
+++ b/java/code/src/com/redhat/rhn/frontend/dto/NetworkDto.java
@@ -25,8 +25,8 @@ import java.util.Date;
* @version $Rev$
*/
public class NetworkDto implements Identifiable {
-
-
+
+ private String name;
private Long systemId;
private String key;
private Date lastCheckin;
@@ -83,7 +83,23 @@ public class NetworkDto implements Identifiable {
public void setId(Long systemIdIn) {
this.systemId = systemIdIn;
}
-
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+
+
+ /**
+ * @param nameIn The name to set.
+ */
+ public void setName(String nameIn) {
+ name = nameIn;
+ }
+
+
/**
* {@inheritDoc}
*/
diff --git
a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/NetworkDtoSerializer.java
b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/NetworkDtoSerializer.java
index 48c90ab..52cede5 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/NetworkDtoSerializer.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/serializer/NetworkDtoSerializer.java
@@ -17,6 +17,8 @@ package com.redhat.rhn.frontend.xmlrpc.serializer;
import com.redhat.rhn.frontend.dto.NetworkDto;
import com.redhat.rhn.frontend.xmlrpc.serializer.util.SerializerHelper;
+import org.apache.commons.lang.StringUtils;
+
import java.io.IOException;
import java.io.Writer;
@@ -52,6 +54,11 @@ public class NetworkDtoSerializer implements XmlRpcCustomSerializer {
NetworkDto net = (NetworkDto)value;
SerializerHelper helper = new SerializerHelper(builtInSerializer);
helper.add("systemId", net.getId());
+ String name = net.getName();
+ if (StringUtils.isBlank(name)) {
+ name = "unknown";
+ }
+ helper.add("systemName", name);
helper.add("last_checkin", net.getLastCheckin());
helper.writeTo(output);
}
diff --git a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
index 859f748..63c48dc 100644
--- a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
@@ -48,7 +48,17 @@
<rl:column headerkey="systemlist.jsp.system" filterattr="key"
filtermessage="row.ip">
<rl:expandable rendericon="true">${current.key}
<em>(<bean:message key="manysystems.message"
arg0="${rl:countChildren(current)}"/>)</em> </rl:expandable>
- <rl:non-expandable
rendericon="true">${current.id}</rl:non-expandable>
+ <rl:non-expandable rendericon="true">
+ <c:out value="<a
href=\"/rhn/systems/details/Overview.do?sid=${current.id}\">"
escapeXml="false" />
+ <c:choose>
+ <c:when test="${empty current.name}">
+ <bean:message key="sdc.details.overview.unknown"/>
+ </c:when>
+ <c:otherwise>
+ <c:out value="${current.name}</a>" escapeXml="false"
/>
+ </c:otherwise>
+ </c:choose>
+ </rl:non-expandable>
</rl:column>
<rl:column headerkey="systemlist.jsp.last_checked_in"
styleclass="last-column">
commit 79e419decf5f3c3ec094e18b795b429d8d277a72
Author: Partha Aji <paji(a)redhat.com>
Date: Tue May 4 12:59:14 2010 -0400
added an nbsp to space the text better
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ExpandableColumnTag.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ExpandableColumnTag.java
index 37f3d8f..eb748e1 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ExpandableColumnTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ExpandableColumnTag.java
@@ -83,6 +83,7 @@ public class ExpandableColumnTag extends BodyTagSupport {
String imageId = rowId + "-image";
ListTagUtil.write(pageContext, String.format(IMAGE_SCRIPT,
rowId, listName, imageId));
+ ListTagUtil.write(pageContext, " ");
}
/** {@inheritDoc}
commit b51ab25439411627469925bcf85ac59cb1e328af
Author: Partha Aji <paji(a)redhat.com>
Date: Tue May 4 12:52:56 2010 -0400
Added a new tag attribute to filter by ip address
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 ce2bcdd..3861db7 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
@@ -48,20 +48,26 @@
<!-- Generic row labels. The intent is that these can be reused across multiple
pages.-->
<group>
+ <context-group name="ctx">
+ <context
context-type="sourcefile">/rhn/profiles/Details</context>
+ </context-group>
<trans-unit id="row.name">
<source>Name</source>
- <context-group name="ctx">
- <context
context-type="sourcefile">/rhn/profiles/Details</context>
- </context-group>
</trans-unit>
-
<trans-unit id="row.description">
<source>Description</source>
- <context-group name="ctx">
- <context
context-type="sourcefile">/rhn/profiles/Details</context>
- </context-group>
</trans-unit>
+ <trans-unit id="row.ip">
+ <source>IP Address</source>
+ </trans-unit>
+ <trans-unit id="row.hostname">
+ <source>Hostname</source>
+ </trans-unit>
+
+ <trans-unit id="row.macaddress">
+ <source>Network Address</source>
+ </trans-unit>
</group>
<!-- Generic buttons. The intent is that these can be reused across multiple
pages.-->
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ColumnTag.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ColumnTag.java
index 6c783cb..0e9bf7a 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ColumnTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ColumnTag.java
@@ -48,6 +48,15 @@ public class ColumnTag extends BodyTagSupport {
protected boolean sortable;
private String defaultSortDir;
private String filterAttr;
+ private String filterMessage;
+
+ /**
+ * @param filterMessageIn The filterMessage to set.
+ */
+ public void setFiltermessage(String filterMessageIn) {
+ filterMessage = filterMessageIn;
+ }
+
/**
* Sets sortable attribute
* True values: true, t, yes, y, 1
@@ -186,6 +195,7 @@ public class ColumnTag extends BodyTagSupport {
headerClass = null;
filterAttr = null;
sortable = false;
+ filterMessage = null;
}
protected void renderHeader() throws JspException {
@@ -439,7 +449,11 @@ public class ColumnTag extends BodyTagSupport {
private void setupColumnFilter() throws JspException {
ListTag parent = (ListTag)
BodyTagSupport.findAncestorWithClass(this, ListTag.class);
- ColumnFilter f = new ColumnFilter(headerKey, filterAttr);
+ String key = headerKey;
+ if (!StringUtils.isBlank(filterMessage)) {
+ key = filterMessage;
+ }
+ ColumnFilter f = new ColumnFilter(key, filterAttr);
parent.setColumnFilter(f);
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
index d4b31a2..e1c6dd4 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
@@ -221,6 +221,11 @@
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
+ <attribute>
+ <name>filtermessage</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
</tag>
<tag>
<name>selectablecolumn</name>
diff --git a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
index c32011d..859f748 100644
--- a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
@@ -45,7 +45,7 @@
<!-- Name Column -->
- <rl:column headerkey="systemlist.jsp.system"
filterattr="key">
+ <rl:column headerkey="systemlist.jsp.system" filterattr="key"
filtermessage="row.ip">
<rl:expandable rendericon="true">${current.key}
<em>(<bean:message key="manysystems.message"
arg0="${rl:countChildren(current)}"/>)</em> </rl:expandable>
<rl:non-expandable
rendericon="true">${current.id}</rl:non-expandable>
commit 852c28959db6f71eeb9a7d649e943f292f15a29d
Author: Partha Aji <paji(a)redhat.com>
Date: Tue May 4 12:16:35 2010 -0400
More list tag enhancements
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 68eeefe..9a35c57 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
@@ -1645,6 +1645,20 @@
http://www.oasis-open.org/committees/xliff/documents/xliff-core-1.1.xsd&q...
</context>
</context-group>
</trans-unit>
+
+ <trans-unit id="show.all">
+<source>Show All</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">on any listview page with a
set. 1 - 5 of 120</context>
+ </context-group>
+ </trans-unit>
+ <trans-unit id="hide.all">
+<source>Hide All</source>
+ <context-group name="ctx">
+ <context context-type="sourcefile">on any listview page with a
set. 1 - 5 of 120</context>
+ </context-group>
+ </trans-unit>
+
<trans-unit id="bad-class">
<source>Class does not implement AclHandler: {0}</source>
<context-group name="ctx">
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 2817450..ce2bcdd 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
@@ -76,6 +76,21 @@
</group>
+ <trans-unit id="manysystems.message">
+<source>{0} systems</source>
+ <context-group name="ctx">
+ <context
context-type="sourcefile">/rhn/configuration/ChannelOverview.do</context>
+ <context context-type="paramnotes">"6
systems"</context>
+ </context-group>
+ </trans-unit>
+ <trans-unit id="onesystem.message">
+<source>1 system</source>
+ <context-group name="ctx">
+ <context
context-type="sourcefile">/rhn/configuration/ChannelOverview.do</context>
+ <context context-type="paramnotes">"1
system"</context>
+ </context-group>
+ </trans-unit>
+
<trans-unit id="nosystems.message">
<source>No systems.</source>
<context-group name="ctx">
@@ -12853,20 +12868,6 @@ the <strong>Red Hat Enterprise Linux System
Administration Guide.</stro
<context context-type="paramnotes">"38
total"</context>
</context-group>
</trans-unit>
- <trans-unit id="channelOverview.jsp.systems">
-<source>{0} systems</source>
- <context-group name="ctx">
- <context
context-type="sourcefile">/rhn/configuration/ChannelOverview.do</context>
- <context context-type="paramnotes">"6
systems"</context>
- </context-group>
- </trans-unit>
- <trans-unit id="channelOverview.jsp.system">
-<source>{0} system</source>
- <context-group name="ctx">
- <context
context-type="sourcefile">/rhn/configuration/ChannelOverview.do</context>
- <context context-type="paramnotes">"1
system"</context>
- </context-group>
- </trans-unit>
<trans-unit id="channelOverview.jsp.systems-subscribed">
<source>subscribed</source>
<context-group name="ctx">
diff --git
a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java
index fa413b9..838f82f 100644
---
a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java
+++
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java
@@ -14,6 +14,7 @@
*/
package com.redhat.rhn.frontend.taglibs.list.decorators;
+import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.frontend.taglibs.list.ListTag;
import com.redhat.rhn.frontend.taglibs.list.ListTagUtil;
@@ -28,9 +29,9 @@ public class ExpansionDecorator extends BaseListDecorator {
private static final String SHOW_ALL_SCRIPT =
"<a href=\"javascript:showAllRows(rowHash%s);\"" +
- " style=\"cursor: pointer;\">Show
All</a> | " +
+ " style=\"cursor:
pointer;\">%s</a> | " +
"<a href=\"javascript:hideAllRows(rowHash%s);\" " +
- "style=\"cursor: pointer;\">Hide All</a>";
+ "style=\"cursor: pointer;\">%s</a>";
private static final String NEW_VAR_SCRIPT = "<script
type=\"text/javascript\">var " +
"rowHash%s = new
Array();</script>";
@@ -52,8 +53,11 @@ public class ExpansionDecorator extends BaseListDecorator {
*/
@Override
public void beforeTopPagination() throws JspException {
- ListTagUtil.write(pageContext, String.format(SHOW_ALL_SCRIPT,
- listName, listName));
+ LocalizationService ls = LocalizationService.getInstance();
+ ListTagUtil.write(pageContext, "<td
class=\"list-sizeselector\">");
+ ListTagUtil.write(pageContext, String.format(SHOW_ALL_SCRIPT, listName,
+ ls.getMessage("show.all"), listName,
ls.getMessage("hide.all")));
+ ListTagUtil.write(pageContext, "</td>");
}
/**
diff --git
a/java/code/webapp/WEB-INF/pages/common/fragments/configuration/channel/summary.jspf
b/java/code/webapp/WEB-INF/pages/common/fragments/configuration/channel/summary.jspf
index 06dbe47..a9f5a01 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/configuration/channel/summary.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/configuration/channel/summary.jspf
@@ -25,12 +25,12 @@
<c:choose>
<c:when test="${summary.numSystems == 1}">
<td><a
href="/rhn/configuration/channel/ChannelSystems.do?ccid=${channel.id}"><bean:message
- key="channelOverview.jsp.system" arg0="${summary.numSystems}"
/></a>
+ key="onesystem.message"/></a>
<bean:message key="channelOverview.jsp.systems-subscribed"
/></td>
</c:when>
<c:when test="${summary.numSystems > 1}">
<td><a
href="/rhn/configuration/channel/ChannelSystems.do?ccid=${channel.id}"><bean:message
- key="channelOverview.jsp.systems" arg0="${summary.numSystems}"
/></a>
+ key="manysystems.message" arg0="${summary.numSystems}"
/></a>
<bean:message key="channelOverview.jsp.systems-subscribed"
/></td>
</c:when>
<c:otherwise>
diff --git a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
index 7ac9b2f..c32011d 100644
--- a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
@@ -23,7 +23,6 @@
<rl:list
emptykey="nosystems.message"
parentiselement = "false"
- searchparent="true"
searchchild="false"
@@ -47,7 +46,7 @@
<!-- Name Column -->
<rl:column headerkey="systemlist.jsp.system"
filterattr="key">
- <rl:expandable rendericon="true">${current.key}
<em>(${rl:countChildren(current)} systems)</em> </rl:expandable>
+ <rl:expandable rendericon="true">${current.key}
<em>(<bean:message key="manysystems.message"
arg0="${rl:countChildren(current)}"/>)</em> </rl:expandable>
<rl:non-expandable
rendericon="true">${current.id}</rl:non-expandable>
</rl:column>
commit 6bd92a9f24f368b717d43c946a9cbc94cd1220e8
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue May 4 14:50:11 2010 +0200
removed dead _provisioningCapableYN()
moreover - condition like "WHERE WC.login_uc = 'NEUROID'" really
scares me...
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index f046fb7..17eea89 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -2036,37 +2036,6 @@ class StreamProducer:
return
raise Exception("No action for this stream producer")
-def _provisioningCapableYN():
- """ 1 or 0, should be sync kickstart and other provisioning data?
- NOTE: not currently used.
- """
-
- try:
- h = rhnSQL.prepare("""\
- SELECT 1
- FROM web_contact WC,
- rhnOrgEntitlements OE,
- rhnOrgEntitlementType OET
- WHERE WC.login_uc = 'NEUROID'
- AND WC.org_id = OE.org_id
- AND OET.id = OE.entitlement_id
- AND OET.label = 'rhn_provisioning'
- """)
- h.execute()
- if h.fetchone_dict():
- return 1
- else:
- return 0
- except (SQLError, SQLSchemaError, SQLConnectError), e:
- # An SQL error is fatal... crash and burn
- tbOut = cStringIO.StringIO()
- Traceback(mail=0, ostream=tbOut, with_locals=1)
- log(-1, 'SQL ERROR during xml processing: %s' % e, stream=sys.stderr)
- log(-1, 'TRACEBACK: %s' % tbOut.getvalue(), stream=sys.stderr)
- sys.exit(15)
- return 1
-
-
def _verifyPkgRepMountPoint():
""" Checks the base package repository directory tree for
existance and permissions.
commit f76e275374007e35fb5a03883994f09e3f2fbf33
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 16:19:36 2010 +0200
Automatic commit of package [spacewalk-ssl-cert-check] release [2.0-1].
diff --git a/projects/ssl-cert-check/spacewalk-ssl-cert-check.spec
b/projects/ssl-cert-check/spacewalk-ssl-cert-check.spec
index be1fffe..7aaa0aa 100644
--- a/projects/ssl-cert-check/spacewalk-ssl-cert-check.spec
+++ b/projects/ssl-cert-check/spacewalk-ssl-cert-check.spec
@@ -40,6 +40,9 @@ rm -rf $RPM_BUILD_ROOT
%doc LICENSE
%changelog
+* Tue May 04 2010 Jan Pazdziora 2.0-1
+- 461270 - replace our own ssl-cert-check with stock certwatch.
+
* Thu Sep 24 2009 Miroslav Suchý <msuchy(a)redhat.com> 1.9-1
- 524053 - Force to "upgrade" to older version of rhn-ssl-cert-check
diff --git a/rel-eng/packages/spacewalk-ssl-cert-check
b/rel-eng/packages/spacewalk-ssl-cert-check
index aec6b0b..09a3f5a 100644
--- a/rel-eng/packages/spacewalk-ssl-cert-check
+++ b/rel-eng/packages/spacewalk-ssl-cert-check
@@ -1 +1 @@
-1.9-1 projects/ssl-cert-check/
+2.0-1 projects/ssl-cert-check/
commit 78291f1becc421fb431ad200b776b58821fe93dc
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 16:15:43 2010 +0200
461270 - replace our own ssl-cert-check with stock certwatch.
We take crypto-utils' /etc/cron.daily/certwatch and change it
to override any CERTWATCH_OPTS and NOCERTWATCH, use traceback_mail
value from Spacewalk configuration as the recipient's email
address, and to suggest the use of rhn-ssl-tool besides genkey.
diff --git a/projects/ssl-cert-check/rhn-ssl-cert-check
b/projects/ssl-cert-check/rhn-ssl-cert-check
index ce59b9f..d39cb00 100644
--- a/projects/ssl-cert-check/rhn-ssl-cert-check
+++ b/projects/ssl-cert-check/rhn-ssl-cert-check
@@ -31,23 +31,6 @@ unset ADMIN EXPIRATION CHECK
EXPIRATION=${EXPIRATION:-60}
-RHN_CONF_FILE=/etc/rhn/rhn.conf
-SSL_HTTPD_CONF_FILE=/etc/httpd/conf.d/ssl.conf
-SSL_CERT_CHECK=/usr/share/ssl/ssl-cert-check
-REMOTE_HOSTS=/etc/sysconfig/rhn/ssl-hosts.conf
-
-# If the admin email address is not set and RHN_CONF_FILE could not be found,
-# there's no point in moving forward
-[ -z "$ADMIN" -a ! -f $RHN_CONF_FILE ] && exit 0
-
-
-# Return path to the SSL certificate
-get_ssl_cert_file() {
- awk '/^SSLCertificateFile/ {print $2}' $SSL_HTTPD_CONF_FILE
-}
-
-# main
-
if [ -z "$ADMIN" ]; then
ADMIN=$(spacewalk-cfg-get traceback_mail)
# Replace commas with spaces
@@ -68,21 +51,7 @@ if [ -z "$ADMIN" ]; then
exit 0
fi
-# Parse remote hosts file
-if [ -f "$REMOTE_HOSTS" ]; then
- # Get rid of comments
- grep -v "^[[:blank:]]*#" $REMOTE_HOSTS |
- while IFS=: read server port; do
- if [ -n "$server" ]; then
- if [ -z "$port" ]; then
- port=443
- fi
- $SSL_CERT_CHECK -x $EXPIRATION -a -e "$ADMIN" -q -s $server -p
$port
- fi
- done
-fi
+sed -e "s!| */usr/sbin/sendmail!| sed
\"s/'genkey'/'rhn-ssl-tool' or 'genkey'/; /Generated by/a\\\\
and $0\" &!" \
+ -e "/\. *\/etc\/sysconfig\/httpd/aexport CERTWATCH_OPTS='--address $ADMIN
--period $EXPIRATION' ; unset NOCERTWATCH" /etc/cron.daily/certwatch \
+ | bash -
-SSL_CERT_FILE=$(get_ssl_cert_file)
-if [ -f "$SSL_CERT_FILE" ]; then
- $SSL_CERT_CHECK -x $EXPIRATION -c $SSL_CERT_FILE -a -e "$ADMIN" -q
-fi
diff --git a/projects/ssl-cert-check/spacewalk-ssl-cert-check.spec
b/projects/ssl-cert-check/spacewalk-ssl-cert-check.spec
index d2f2213..be1fffe 100644
--- a/projects/ssl-cert-check/spacewalk-ssl-cert-check.spec
+++ b/projects/ssl-cert-check/spacewalk-ssl-cert-check.spec
@@ -5,11 +5,11 @@ License: GPLv2
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
Epoch: 1
-Version: 1.9
+Version: 2.0
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
-Requires: openssl
+Requires: /etc/cron.daily/certwatch
Obsoletes: rhn-ssl-cert-check < %{epoch}:%{version}
Provides: rhn-ssl-cert-check = %{epoch}:%{version}
@@ -27,10 +27,8 @@ administrator.
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT/%{_datadir}/ssl
install -d $RPM_BUILD_ROOT/etc/cron.daily
-install -m755 ssl-cert-check $RPM_BUILD_ROOT/%{_datadir}/ssl/ssl-cert-check
install -m755 rhn-ssl-cert-check
$RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily/rhn-ssl-cert-check
%clean
@@ -39,7 +37,6 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%attr(0755,root,root) %{_sysconfdir}/cron.daily/rhn-ssl-cert-check
-%attr(0755,root,root) %{_datadir}/ssl/ssl-cert-check
%doc LICENSE
%changelog
diff --git a/projects/ssl-cert-check/ssl-cert-check
b/projects/ssl-cert-check/ssl-cert-check
deleted file mode 100644
index c00e9f1..0000000
--- a/projects/ssl-cert-check/ssl-cert-check
+++ /dev/null
@@ -1,379 +0,0 @@
-#!/bin/bash
-#
-# Program: SSL Certificate Check <ssl-cert-check>
-#
-# Author: Matty <matty(a)daemons.net>
-#
-# Current Version: 1.4
-#
-# Revision History:
-#
-# Version 1.4
-# Added "-c" flag to report expiration status of a PEM encoded certificate
-# -- functionality added by Hampus Lundqvist
-#
-# Version 1.3
-# Updated the prints messages to display the reason a connection
-# failed (connection refused, connection timeout, bad cert, etc)
-#
-# Updated the GNU date checking routines. I really wish UNIX/BSD/Linux
-# based systems utilized a common set of options/interfaces. *sigh*
-#
-# Version 1.2
-# Added checks for each binary required
-# Added checks for connection timeouts
-#
-# Versions 1.1
-# Added checks for GNU date
-# Added a "-h" option
-# Cleaned up the documentation
-#
-# Version 1.0
-# Initial Release
-#
-# Last Updated: 01-04-2005
-#
-# Purpose:
-# ssl-cert-check checks to see if a digital certificate in X.509 format
-# has expired. ssl-cert-check can be run in interactive and batch mode,
-# and provides facilities to alarm if a certificate is about to expire.
-#
-# License:
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2, or (at your option) any
-# later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# Requirements:
-# Requires openssl and GNU date
-#
-# Installation:
-# Copy the shell script to a suitable location
-#
-# Usage (script should be run as a non-privileged user):
-# Usage: ./ssl-cert-check {[ -c certificate file ]} || {[ -b ] && [ -f cert_file
]} || {[ -s common_name ] && [ -p port]}}
-# [ -e email ] [ -x expir_days ] [ -q ] [ -a ] [ -h ]
-# -a : Send a warning message through email
-# -b : Print the expiration date for all certificates in cert_file
(batch mode)
-# -c : Print the expiration date for a PEM formatted certificate
-# -e email address : Email address to send expiration notices
-# -f cert file : File with a list of common names and ports (eg.,
blatch.com 443)
-# -h : Print this screen
-# -p port : Port to connect to (interactive mode)
-# -s commmon name : Server to connect to (interactive mode)
-# -q : Don't print anything on the console
-# -x days : Certificate expiration interval (eg. if cert_date < days)
-#
-#
-# Examples:
-# Print the certificate expiration status of the X.509 certificate stored in file
cacert.pem
-# $ ssl-cert-check -c /etc/ca/cacert.pem
-#
-# Print the certificate expiration dates for a list of domains specified in the file
ssldomains:
-# $ ssl-cert-check -b -f ssldomains
-#
-# Print the certificate expiration date for
mail.daemons.net:
-# $ ssl-cert-check -s
mail.daemons.net -p 995
-#
-# Run ssl-cert-check in quiet mode, check for all certificates that will
-# expire in 75-days or less. Email the expiring certs to matty(a)daemons.net:
-# $ ssl-cert-check -a -b -f ssldomains -q -x 75 -e matty(a)daemons.net
-
-PATH=/bin:/usr/bin:/usr/local/bin:/usr/local/ssl/bin ; export PATH
-
-# Who to page when an expired certificate is detected (cmdline: -e)
-ADMIN="sysadmin(a)mydomain.com"
-
-# Number of days to give as a buffer (cmdline: -x)
-WARNDAYS=30
-
-# If QUIET is set to TRUE, don't print anything on the console (cmdline: -q)
-QUIET="FALSE"
-
-# Don't send emails by default (cmdline: -a)
-ALARM="FALSE"
-
-# Location of system binaries
-DATE="/bin/date"
-MAIL="/bin/mail"
-OPENSSL="/usr/bin/openssl"
-
-# Place to stash temporary files
-CERT_TMP="$HOME/cert.$$"
-ERROR_TMP="$HOME/error.$$"
-
-# Set the default umask to be somewhat restrictive
-umask 077
-
-
-###########################################################
-### Converts a date in string format passed as $1 into
-### the number of seconds since 01/01/70 00:00:00 UTC.
-### Replace this with another date normalization routine if
-### you do not have GNU date available.
-###########################################################
-utcseconds() {
- utcsec=`${DATE} -d "$1" +%s`
- echo "$utcsec"
-}
-
-
-###########################################################
-### Calculate the number of seconds between two dates
-###########################################################
-date_diff() {
- diff=`expr $2 - $1`
- echo "${diff}"
-}
-
-
-###########################################################
-### Calculate days given seconds
-###########################################################
-date_days() {
- DAYS=`expr ${1} \/ 86400`
- echo "${DAYS}"
-}
-
-
-#####################################################################
-### Method used to print a line with a certificates expiration status
-#####################################################################
-prints() {
- if [ "${QUIET}" != "TRUE" ]
- then
- MIN_DATE=`echo $4 | awk '{ print $1, $2, $4 }'`
- printf "%-30s %-25s %-20s %-5s\n" "$1:$2" "$3"
"$MIN_DATE" "$5"
- fi
-}
-
-
-########################
-### Print out a heading
-########################
-print_heading() {
- if [ "${QUIET}" != "TRUE" ]
- then
- printf "\n%-30s %-25s %-20s %-5s\n" "Host" "Status"
"Expires" "Days Left"
- fi
-}
-
-
-##########################################
-# Provide a listing of how the tool works
-##########################################
-useage() {
- echo "Usage: $0 {[ -c certificate file ]} || {[ -b ] && [ -f cert_file ]}
|| {[ -s common_name ] && [ -p port]}}"
- echo " [ -e email ] [ -x expir_days ] [ -q ] [ -a ] [ -h ]"
- echo " -a : Send a warning message through email "
- echo " -b : Print the expiration date for all certificates in
cert_file (batch mode)"
- echo " -c : Print the expiration date for a PEM formatted
certificate"
- echo " -e email address : Email address to send expiration notices"
- echo " -f cert file : File with a list of common names and ports (eg.,
blatch.com 443)"
- echo " -h : Print this screen"
- echo " -p port : Port to connect to (interactive mode)"
- echo " -s commmon name : Server to connect to (interactive mode)"
- echo " -q : Don't print anything on the console"
- echo " -x days : Certificate expiration interval (eg. if cert_date <
days)"
-}
-
-
-##################################################################
-### Connect to a server ($1) and port ($2) to see if a certificate
-### has expired
-##################################################################
-check_server_status() {
-
- echo "" | ${OPENSSL} s_client -connect ${1}:${2} 2> ${ERROR_TMP} 1>
${CERT_TMP}
-
- if grep -i "Connection refused" ${ERROR_TMP} > /dev/null
- then
- prints ${1} ${2} "Connection refused" "?"
"?"
-
- elif grep -i "gethostbyname failure" ${ERROR_TMP} > /dev/null
- then
- prints ${1} ${2} "Cannot resolve domain" "?"
"?"
-
- elif grep -i "Operation timed out" ${ERROR_TMP} > /dev/null
- then
- prints ${1} ${2} "Operation timed out" "?"
"?"
-
- elif grep -i "ssl handshake failure" ${ERROR_TMP} > /dev/null
- then
- prints ${1} ${2} "SSL handshake failed" "?"
"?"
-
- elif grep -i "connect: Connection timed out" ${ERROR_TMP} > /dev/null
- then
- prints ${1} ${2} "Connection timed out" "?" "?"
-
- else
- check_expiration ${CERT_TMP} $1 $2
- fi
-}
-
-#####################################################
-### Check the expiration status of a certificate file
-### Accepts three parameters:
-### $1 -> certificate file to process
-### $2 -> Server name
-### $3 -> Port number of certificate
-#####################################################
-check_expiration() {
-
- CERTDATE=`${OPENSSL} x509 -in ${1} -enddate -noout | sed
's/notAfter\=//'`
-
- # Convert the date to seconds, and get the diff between NOW and the expiration date
- CERTUTC=`utcseconds "${CERTDATE}"`
- CERTDIFF=`date_diff ${NOWUTC} ${CERTUTC}`
-
- if [ ${CERTDIFF} -lt 0 ]
- then
- if [ "${ALARM}" == "TRUE" ]
- then
- echo "The SSL certificate for ${2} has expired!" \
- | ${MAIL} -s "Certificate for ${2} has expired!"
${ADMIN}
- fi
-
- DAYS=`date_days $CERTDIFF`
- prints ${2} ${3} "Expired" "$CERTDATE"
"$DAYS"
-
- elif [ ${CERTDIFF} -lt ${WARNSECS} ]
- then
- if [ "${ALARM}" == "TRUE" ]
- then
- echo "The SSL certificate for ${2} will expire on
${CERTDATE}" \
- | ${MAIL} -s "$0: Certificate for ${2} will expire in
${WARNDAYS}-days or less" ${ADMIN}
- fi
-
- DAYS=`date_days $CERTDIFF`
- prints ${2} ${3} "Expiring" "${CERTDATE}"
"${DAYS}"
-
- else
- DAYS=`date_days $CERTDIFF`
- prints ${2} ${3} "Valid" "${CERTDATE}"
"${DAYS}"
-
- fi
-}
-
-
-#################################
-### Being the main program logic
-#################################
-while getopts abe:f:c:hp:s:qx: option
-do
- case "${option}"
- in
- a) ALARM="TRUE";;
- b) REPORT_ALL="TRUE";;
- c) CERTFILE=${OPTARG};;
- e) ADMIN=${OPTARG};;
- f) SERVERFILE=$OPTARG;;
- h) useage
- exit 1;;
- p) PORT=$OPTARG;;
- s) HOST=$OPTARG;;
- q) QUIET="TRUE";;
- x) WARNDAYS=$OPTARG;;
- \?) useage
- exit 1;;
- esac
-done
-
-
-if [ ! -f ${OPENSSL} ]
-then
- echo "ERROR: $OPENSSL does not exist. Please modify the \$OPENSSL variable."
- exit 1
-fi
-
-if [ ! -f ${DATE} ]
-then
- echo "ERROR: $DATE does not exist. Please modify the \$DATE variable."
- exit 1
-fi
-
-if [ ! -f ${MAIL} ]
-then
- echo "ERROR: $MAIL does not exist. Please modify the \$MAIL variable."
- exit 1
-fi
-
-if ${DATE} -R -d "Wed Jan 1 00:00:00 EDT 2000" "+%s" 2>&1 |
grep -i "illegal option" > /dev/null
-then
- echo "ERROR: \$DATE does not point to GNU date"
- exit 1
-fi
-
-if ${DATE} -R -d "Wed Jan 1 00:00:00 EDT 2000" "+%s" 2>&1 |
grep -i "unknown option" > /dev/null
-then
- echo "ERROR: \$DATE does not point to GNU date"
- exit 1
-fi
-
-### Baseline the dates so we have something to compare with
-NOWDATE=`${DATE}`
-NOWUTC=`utcseconds "${NOWDATE}"`
-
-
-### Get the number of seconds to compare the UTC time with
-WARNSECS=`expr ${WARNDAYS} \* 86400`
-
-
-### Touch the files to avoid issues
-touch ${CERT_TMP} ${ERROR_TMP}
-
-
-### IF a HOST and PORT were passed on the cmdline, use that
-if [ "${HOST}" != "" ] && [ "${PORT}" !=
"" ]
-then
- print_heading
- check_server_status "${HOST}" "${PORT}"
-
-
-#####################################################################
-### If a file and a "-a" are passed on the command line, check all
-### of the certificates in the file to see if they are about to expire
-#####################################################################
-elif [ "${REPORT_ALL}" == "TRUE" ] && [ -f
"${SERVERFILE}" ]
-then
- print_heading
- while read HOST PORT
- do
- check_server_status "${HOST}" "${PORT}"
-
- done < ${SERVERFILE}
-
-
-###################################################################
-### Check to see if the certificate in CERTFILE is about to expire
-###################################################################
-elif [ "${CERTFILE}" != "" ]
-then
- print_heading
- if [ -f "${CERTFILE}" ]
- then
- check_expiration ${CERTFILE} "FILE" "${CERTFILE}"
- else
- echo "ERROR: The file named ${CERTFILE} doesn't exist"
- fi
-
-###################################################
-### There was an error, so print how the tool works
-###################################################
-else
- useage
-fi
-
-###############################
-### Remove the temporary files
-###############################
-rm -f ${CERT_TMP} ${ERROR_TMP}
commit d10776034c521b33ec5b0399a0d27fb9d3655495
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue May 4 13:34:55 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.1.12-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 525ee1d..a205a60 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.11
+Version: 1.1.12
Release: 1%{?dist}
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -632,6 +632,9 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Tue May 04 2010 Michael Mraka <michael.mraka(a)redhat.com> 1.1.12-1
+- modified satellite-sync to new xml dumps
+
* Mon May 03 2010 Jan Pazdziora 1.1.11-1
- 585233 - the has-comps attribute will no longer be used by hosted.
- add dependency information for DEB packages (lukas.durfina(a)gmail.com)
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 1022d56..535a9bb 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.1.11-1 backend/
+1.1.12-1 backend/
commit 9ad7fbe8fd05accec78d8de5e65fb192e1ba4f6f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue May 4 13:25:11 2010 +0200
short packages doesn't have enough information about checksums, let's use
packages instead
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 7107e66..f046fb7 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -88,7 +88,6 @@ class Runner:
'channels' : ['channel-families'],
'channel-families' : ['blacklists'],
'blacklists' : ['arches'],
- 'short' : [''],
'download-errata' : ['errata'],
'download-packages' : [''],
'download-source-packages' : [''],
@@ -103,7 +102,6 @@ class Runner:
'arches',
'channels',
'blacklists',
- 'short',
'download-packages',
'rpms',
'packages',
@@ -300,16 +298,6 @@ class Runner:
def _step_blacklists(self):
return self.syncer.processBlacklists()
- def _step_short(self):
- try:
- return self.syncer.processShortPackages()
- except xmlDiskSource.MissingXmlDiskSourceFileError, e:
- msg= "ERROR: The dump is missing package data, use --no-rpms to skip
this step or fix the content to include package data."
- log2disk(-1, msg)
- log2stderr(-1, msg, cleanYN=1)
- sys.exit(25)
-
-
def _step_download_packages(self):
return self.syncer.download_package_metadata()
@@ -852,37 +840,6 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
self._channel_packages[chn] = package_ids
self._avail_channel_packages[chn] = avail_package_ids
- def processShortPackages(self):
- log(1, ["", "Retrieving short package metadata (used for
indexing)"])
-
- # Compute the unique packages and populate self._channel_packages
- self._compute_unique_packages()
-
- h = sync_handlers.get_short_package_handler()
- stream_loader = StreamProducer(h)
- if self.mountpoint:
- s = xmlDiskSource.ShortPackageDiskSource(self.mountpoint)
- stream_loader.set_disk_loader(s)
- else:
- s = self.xmlWireServer.getChannelShortPackagesXmlStream
- stream_loader.set_wire_loader(s)
-
- # OK, now uq_channel_packages only has the unique packages
- for channel_label, package_ids in self._channel_packages.items():
- # Pretend we fetch all packages
- log(1, " Retrieving / parsing short package metadata: %s (%s)" %
- (channel_label, len(package_ids)))
-
- lm = self._channel_collection.get_channel_timestamp(channel_label)
- channel_last_modified = int(rhnLib.timestamp(lm))
-
- stream_loader.set_args(channel_label, channel_last_modified)
- stream_loader.process(package_ids)
-
- h.close()
-
- self._diff_packages()
-
_query_compare_packages = """
select p.id, c.checksum_type, c.checksum, p.path, p.package_size,
TO_CHAR(p.last_modified, 'YYYYMMDDHH24MISS') last_modified
@@ -896,7 +853,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
"""
# XXX the "is null" condition will have to change in multiorg satellites
def _diff_packages(self):
- package_collection = sync_handlers.ShortPackageCollection()
+ package_collection = sync_handlers.PackageCollection()
h = rhnSQL.prepare(self._query_compare_packages)
missing_channel_packages = {}
@@ -1067,7 +1024,6 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
missing_packages = {}
# First, determine what has to be downloaded
- short_package_collection = sync_handlers.ShortPackageCollection()
package_collection = sync_handlers.PackageCollection()
for channel, pids in self._missing_channel_packages.items():
missing_packages[channel] = mp = []
@@ -1078,7 +1034,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
for pid in pids:
# XXX Catch errors
- timestamp = short_package_collection.get_package_timestamp(pid)
+ timestamp = package_collection.get_package_timestamp(pid)
if not package_collection.has_package(pid, timestamp):
# not in the cache
mp.append(pid)
@@ -1086,9 +1042,9 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
return missing_packages
def download_package_metadata(self):
- log(1, ["", "Downloading package metadata"])
- # Get the missing but uncached packages
- missing_packages = self._missing_not_cached_packages()
+
+ # Compute the unique packages and populate self._channel_packages
+ self._compute_unique_packages()
h = sync_handlers.get_package_handler()
stream_loader = StreamProducer(h)
@@ -1099,7 +1055,12 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
s = self.xmlWireServer.getPackageXmlStream
stream_loader.set_wire_loader(s)
- for channel, pids in missing_packages.items():
+ log(1, ["", "Downloading package metadata"])
+ # Get the missing but uncached packages
+# missing_packages = self._missing_not_cached_packages()
+
+
+ for channel, pids in self._channel_packages.items():
package_count = len(pids)
log(1, messages.package_parsing % (channel,
@@ -1114,6 +1075,9 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
pb.redrawYN = 0
pb.printAll(1)
+ lm = self._channel_collection.get_channel_timestamp(channel)
+ channel_last_modified = int(rhnLib.timestamp(lm))
+
ss = SequenceServer(pids[:], nevermorethan=self._batch_size)
while not ss.doneYN():
chunk = ss.getChunk()
@@ -1126,6 +1090,8 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
h.close()
+ self._diff_packages()
+
# Double-check that we got all the packages
missing_packages = self._missing_not_cached_packages()
for channel, pids in missing_packages.items():
@@ -1760,12 +1726,11 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _link_channel_packages(self):
log(1, ["", messages.link_channel_packages])
- short_package_collection = sync_handlers.ShortPackageCollection()
package_collection = sync_handlers.PackageCollection()
uq_packages = {}
for chn, package_ids in self._channel_packages.items():
for pid in package_ids:
- timestamp = short_package_collection.get_package_timestamp(pid)
+ timestamp = package_collection.get_package_timestamp(pid)
package = package_collection.get_package(pid, timestamp)
assert package is not None
channel_obj = {'label' : chn}
@@ -1799,14 +1764,13 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
""" short-circuit the most common case"""
if not chunk:
return []
- short_package_collection = sync_handlers.ShortPackageCollection()
if sources:
package_collection = sync_handlers.SourcePackageCollection()
else:
package_collection = sync_handlers.PackageCollection()
batch = []
for pid in chunk:
- timestamp = short_package_collection.get_package_timestamp(pid)
+ timestamp = package_collection.get_package_timestamp(pid)
package = package_collection.get_package(pid, timestamp)
if package is None:
# not in the cache
@@ -1853,7 +1817,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _fix_erratum(self, erratum):
""" Replace the list of packages with references to short
packages"""
- sp_coll = sync_handlers.ShortPackageCollection()
+ sp_coll = sync_handlers.PackageCollection()
pids = unique(erratum['packages'])
# map all the pkgs objects to the erratum
packages = []
@@ -1909,7 +1873,6 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _fetch_packages(self, channel, missing_fs_packages, sources=0):
- short_package_collection = sync_handlers.ShortPackageCollection()
if sources:
# acronym = "SRPM"
package_collection = sync_handlers.SourcePackageCollection()
@@ -1924,7 +1887,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
cfg = config.initUp2dateConfig()
for package_id, path in missing_fs_packages:
pkg_current = pkg_current + 1
- timestamp = short_package_collection.get_package_timestamp(package_id)
+ timestamp = package_collection.get_package_timestamp(package_id)
package = package_collection.get_package(package_id, timestamp)
checksum_type = package['checksum_type']
@@ -2419,7 +2382,6 @@ def processCommandline():
if actionDict['no-packages']:
actionDict['packages'] = 0
- actionDict['short'] = 0
actionDict['download-packages'] = 0
actionDict['rpms'] = 0
diff --git a/backend/satellite_tools/sync_handlers.py
b/backend/satellite_tools/sync_handlers.py
index 7e79c3c..59c74f8 100644
--- a/backend/satellite_tools/sync_handlers.py
+++ b/backend/satellite_tools/sync_handlers.py
@@ -288,9 +288,6 @@ class PackageCollection(ShortPackageCollection):
def _init_cache(self):
self._cache = syncCache.PackageCache()
- def get_package_timestamp(self, package_id):
- raise NotImplementedError
-
class PackageContainer(xmlSource.PackageContainer):
def endItemCallback(self):
commit 7d79306c59cea1f2040ceb3da6f71bddac34f838
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon May 3 23:35:04 2010 +0200
fixed global name 'l_timestamp' is not defined
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 00165d7..7107e66 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1942,7 +1942,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
package['path'] = path
package_collection.add_package(package)
- errcode = self._verify_file(path, l_timestamp, package_size,
+ errcode = self._verify_file(path, rhnLib.timestamp(timestamp), package_size,
checksum_type, checksum)
if errcode == 0:
# file is already there
commit 014ac47b005e0101077ffddbe554468888b252ee
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon May 3 23:33:42 2010 +0200
created get_nevra_dict() so it can be reused
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index e3d6451..00165d7 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -61,7 +61,7 @@ from server.importlib.errataCache import schedule_errata_cache_update
from server.importlib.importLib import InvalidChannelFamilyError
from server.importlib.importLib import MissingParentChannelError
-from server.importlib.importLib import get_nevra
+from server.importlib.importLib import get_nevra, get_nevra_dict
import satCerts
import req_channels
@@ -897,7 +897,6 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
# XXX the "is null" condition will have to change in multiorg satellites
def _diff_packages(self):
package_collection = sync_handlers.ShortPackageCollection()
- nvrea_keys = ['name', 'epoch', 'version',
'release', 'arch']
h = rhnSQL.prepare(self._query_compare_packages)
missing_channel_packages = {}
@@ -923,17 +922,13 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
l_timestamp = rhnLib.timestamp(p_timestamp)
package = package_collection.get_package(pid, p_timestamp)
assert package is not None
- nevra = {}
- for t in nvrea_keys:
- nevra[t] = package[t] or ""
if package['org_id'] is not None:
- nevra['org_id'] = OPTIONS.orgid or DEFAULT_ORG
package['org_id'] = OPTIONS.orgid or DEFAULT_ORG
- else:
- nevra['org_id'] = package['org_id']
+ nevra = get_nevra_dict(package)
+ nevra['org_id'] = package['org_id']
- apply(h.execute, (), nevra)
+ h.execute(**nevra)
row = None
for r in (h.fetchall_dict() or []):
# let's check which checksum we have in database
diff --git a/backend/server/importlib/importLib.py
b/backend/server/importlib/importLib.py
index 76fe3be..4d2601e 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -844,9 +844,17 @@ def copy_package(fd, basedir, relpath, checksum_type, checksum,
force=None):
# Returns a list of containing nevra for the given RPM header
+NEVRA_TAGS = ['name', 'epoch', 'version', 'release',
'arch']
def get_nevra(header):
# Get nevra
nevra = []
- for tag in ['name', 'epoch', 'version', 'release',
'arch']:
+ for tag in NEVRA_TAGS:
nevra.append(header[tag])
return nevra
+
+def get_nevra_dict(header):
+ # Get nevra
+ nevra = {}
+ for tag in NEVRA_TAGS:
+ nevra[tag] = header[tag]
+ return nevra
commit 4664d0dc8240f412c93fdbd6f9564c90df6ace5a
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon May 3 22:48:15 2010 +0200
reuse get_nevra()
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 5785c53..e3d6451 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -61,6 +61,7 @@ from server.importlib.errataCache import schedule_errata_cache_update
from server.importlib.importLib import InvalidChannelFamilyError
from server.importlib.importLib import MissingParentChannelError
+from server.importlib.importLib import get_nevra
import satCerts
import req_channels
@@ -1935,9 +1936,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
checksum = package['checksum']
package_size = package['package_size']
if not path:
- nevra = []
- for t in ['name', 'epoch', 'version',
'release', 'arch']:
- nevra.append(package[t])
+ nevra = get_nevra(package)
orgid = None
if package['org_id']:
orgid = OPTIONS.orgid or DEFAULT_ORG
commit e2738df2ca0b6e489fc7d8eacc5ec6468ff7a5ea
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon May 3 19:54:07 2010 +0200
removed unused method
moreover it looks completely wrong as it returns name twice
diff --git a/backend/server/importlib/importLib.py
b/backend/server/importlib/importLib.py
index 4fc23a2..76fe3be 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -318,10 +318,6 @@ class IncompletePackage(BaseInformation):
return "%s-%s-%s.%s.rpm" % (self.name, self.evr[1], self.evr[2],
self.arch)
- def get_nevrao(self):
- return (self.name, self['name'], self['epoch'],
self['version'],
- self['release'], self['arch'], self['org_id'])
-
class Package(IncompletePackage):
"""
A package is a hash of attributes
commit a00c35c49f93eaefeb84ead9114cf54578fa0c95
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon May 3 16:47:58 2010 +0200
simplified errata uniquify
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 0470f97..5785c53 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -401,7 +401,7 @@ class Syncer:
self._failed_fs_packages = {}
self._extinct_packages = {}
- self._uq_channel_errata = {}
+ self._channel_errata = {}
self._missing_channel_errata = {}
self._channel_source_packages = {}
@@ -1537,7 +1537,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
# First, determine what has to be downloaded
errata_collection = sync_handlers.ErrataCollection()
- for channel, errata in self._uq_channel_errata.items():
+ for channel, errata in self._channel_errata.items():
missing_errata[channel] = mp = []
if not errata:
@@ -1620,19 +1620,8 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
channel_errata[chn] = errata
# Uniquify the errata
- self._uq_channel_errata = uq_channel_errata = {}
- uq_errata = {}
for channel, errata in channel_errata.items():
- ch_erratum_ids = uq_channel_errata[channel] = []
- for eid, timestamp, advisory_name in errata:
- if uq_errata.has_key(eid):
- # Saw this erratum already
- continue
- ch_erratum_ids.append((eid, timestamp, advisory_name))
- uq_errata[eid] = None
- # Be nice enough to sort the list
- ch_erratum_ids.sort()
- del uq_errata
+ self._channel_errata[channel] = sorted(list(set(errata)))
def _diff_db_errata(self):
""" Compute errata that are missing from the satellite
@@ -1642,7 +1631,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
errata_collection = sync_handlers.ErrataCollection()
self._missing_channel_errata = missing_channel_errata = {}
db_channel_errata = self._get_db_channel_errata()
- for channel, errata in self._uq_channel_errata.items():
+ for channel, errata in self._channel_errata.items():
ch_erratum_ids = missing_channel_errata[channel] = []
for eid, timestamp, advisory_name in errata:
if timestamp is not None:
commit 163a0cd2b59940eef3566fe2c6301c85675a9783
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon May 3 16:33:54 2010 +0200
_verify_file() returns only errcode now
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index f3a808f..0470f97 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1498,7 +1498,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
dest_path = os.path.join(base_path, relative_path)
timestamp = rhnLib.timestamp(f['last_modified'])
file_size = f['file_size']
- (errcode, ret_path) = self._verify_file(dest_path,
+ errcode = self._verify_file(dest_path,
timestamp, file_size, f['checksum_type'],
f['checksum'])
if errcode != 0:
# Have to download it
commit f4c3fbb166e7d05a2ec8221f7179050af3088844
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon May 3 16:23:12 2010 +0200
simplified _compute_unique_kickstarts()
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 4d80a4a..f3a808f 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -407,7 +407,6 @@ class Syncer:
self._channel_source_packages = {}
self._channel_kickstarts = {}
- self._uq_channel_kickstarts = {}
def initialize(self):
"""Initialization that requires IO, etc."""
@@ -1318,22 +1317,13 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _compute_unique_kickstarts(self):
""" process package metadata for one channel at a
time"""
relevant = self._channel_req.get_requested_channels()
- self._channel_kickstarts = channel_kickstarts = {}
- self._uq_channel_kickstarts = uq_channel_kickstarts = {}
- uq_kickstarts = {}
+ self._channel_kickstarts = {}
for chn in relevant:
timestamp = self._get_channel_timestamp(chn)
channel_obj = self._channel_collection.get_channel(chn, timestamp)
- kickstart_trees = channel_obj['kickstartable_trees']
- cks = channel_kickstarts[chn] = kickstart_trees
- uq_cks = uq_channel_kickstarts[chn] = []
- for kt in kickstart_trees:
- if uq_kickstarts.has_key(kt):
- # Found this one already
- continue
- uq_kickstarts[kt] = None
- uq_cks.append(kt)
+ self._channel_kickstarts[chn] = \
+ sorted(set(channel_obj['kickstartable_trees'] or []))
_query_get_kickstarts = rhnSQL.Statement("""
select TO_CHAR(last_modified, 'YYYYMMDDHH24MISS') last_modified
@@ -1400,7 +1390,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
s = self.xmlWireServer.getKickstartsXmlStream
stream_loader.set_wire_loader(s)
- for channel, ktids in self._uq_channel_kickstarts.items():
+ for channel, ktids in self._channel_kickstarts.items():
kt_count = len(ktids)
log(1, messages.kickstart_parsing % (channel,
@@ -1494,7 +1484,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
missing_ks_files = {}
# download files for the ks trees
- for channel, ktids in self._uq_channel_kickstarts.items():
+ for channel, ktids in self._channel_kickstarts.items():
missing_ks_files[channel] = missing = []
for ktid in ktids:
# No timestamp for kickstartable trees
commit 966552317ffbc11232134d71fcc7c671b8db496d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon May 3 15:52:14 2010 +0200
rpms have to go before packages
we need to know rpm path in package import step
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index eb571cd..4d80a4a 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -104,8 +104,8 @@ class Runner:
'blacklists',
'short',
'download-packages',
- 'packages',
'rpms',
+ 'packages',
'srpms',
'download-source-packages',
'download-errata',
commit db7fbc3cee201b56671c303e32294644a2bf943c
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon May 3 15:57:07 2010 +0200
moved file verification to rpm download step
because checksum might be unknown in package diff step
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 1a2c228..eb571cd 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1034,33 +1034,21 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
package_size, checksum_type, checksum)
if errcode:
# file doesn't match
- fs_package = (package_id, db_path)
-
- # package is missing from the DB
- channel_package = package_id
-
- if not fs_package:
- nevra = []
- for t in ['name', 'epoch', 'version',
'release', 'arch']:
- nevra.append(package[t])
-
- if package['org_id'] is not None:
- orgid = OPTIONS.orgid or DEFAULT_ORG
- else:
- orgid = package['org_id']
-
- path = self._get_rel_package_path(nevra, orgid, source,
- checksum_type, checksum)
- errcode = self._verify_file(path,
- l_timestamp, package_size, checksum_type, checksum)
- if errcode:
- # file doesn't match
- fs_package = (package_id, path)
+ fs_package = package_id
+ path = db_path
+ else:
+ # upload package and reimport metadata
+ channel_package = package_id
+ fs_package = package_id
+ else:
+ # package is missing from the DB
+ channel_package = package_id
+ fs_package = package_id
if channel_package:
m_channel_packages.append(channel_package)
if fs_package:
- m_fs_packages.append(fs_package)
+ m_fs_packages.append((fs_package, path))
return
def download_rpms(self):
@@ -1849,8 +1837,6 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
# not in the cache
raise Exception("Package Not Found in Cache, Clear the Cache to \
Regenerate it.")
- # Now set the path
-# FIXME package['path'] = file_path
batch.append(package)
return batch
@@ -1948,12 +1934,13 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _fetch_packages(self, channel, missing_fs_packages, sources=0):
+ short_package_collection = sync_handlers.ShortPackageCollection()
if sources:
# acronym = "SRPM"
package_collection = sync_handlers.SourcePackageCollection()
else:
# acronym = "RPM"
- package_collection = sync_handlers.ShortPackageCollection()
+ package_collection = sync_handlers.PackageCollection()
self._failed_fs_packages.clear()
self._extinct_packages.clear()
@@ -1962,9 +1949,32 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
cfg = config.initUp2dateConfig()
for package_id, path in missing_fs_packages:
pkg_current = pkg_current + 1
- timestamp = package_collection.get_package_timestamp(package_id)
+ timestamp = short_package_collection.get_package_timestamp(package_id)
package = package_collection.get_package(package_id, timestamp)
+ checksum_type = package['checksum_type']
+ checksum = package['checksum']
+ package_size = package['package_size']
+ if not path:
+ nevra = []
+ for t in ['name', 'epoch', 'version',
'release', 'arch']:
+ nevra.append(package[t])
+ orgid = None
+ if package['org_id']:
+ orgid = OPTIONS.orgid or DEFAULT_ORG
+ path = self._get_rel_package_path(nevra, orgid, sources,
+ checksum_type, checksum)
+
+ # update package path
+ package['path'] = path
+ package_collection.add_package(package)
+
+ errcode = self._verify_file(path, l_timestamp, package_size,
+ checksum_type, checksum)
+ if errcode == 0:
+ # file is already there
+ continue
+
rpmManip = RpmManip(package, path)
nvrea = rpmManip.nvrea()
commit 0d427b6e63adca1d86af75af2522c57c5f85daa4
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Apr 30 15:44:45 2010 +0200
removed unused variable
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 13d26b8..1a2c228 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -2149,7 +2149,6 @@ def _validate_package_org(batch):
If custom and package org is not valid default to org 1
"""
orgid = OPTIONS.orgid or None
- orgs = map(lambda a: a['id'], satCerts.get_all_orgs())
for pkg in batch:
if not pkg['org_id'] or pkg['org_id'] == 'None':
# default to Null so do nothing
commit 048ecb8d454a2e1f947d01b012b7f7bbad1a5795
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Apr 30 14:18:54 2010 +0200
straightened logic in _process_package() and _verify_file()
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index e1d5bbb..13d26b8 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -972,105 +972,96 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
source=source, checksum_type=checksum_type, checksum=checksum)
def _verify_file(self, path, mtime, size, checksum_type, checksum):
- """Verifies if the file is on the filesystem and matches the mtime
and
- checksum
- Computing the checksum is costly, that's why we rely on mtime
- comparisons.
- Returns a tuple (error_code, ret_path) where:
- if the file has the specified mtime and checksum, error_code is 0
- and ret_path is None
- if the file has the checksum, the function sets mtime, error_code is
- 0 and ret_path is path
- if the file exists but has a different checksum, error_code is the
- file's current checksum and ret_path is path
- if the file does not exist at all, error_code is 1 and ret_path is
- null
- The idea is that error_code is 0 if the file exists or something else
- otherwise
+ """
+ Verifies if the file is on the filesystem and matches the mtime and checksum.
+ Computing the checksum is costly, that's why we rely on mtime comparisons.
+ Returns errcode:
+ 0 - file is ok, it has either the specified mtime and size
+ or checksum matches (then function sets mtime)
+ 1 - file does not exist at all
+ 2 - file has a different checksum
"""
if not path:
- return (1, None)
+ return 1
abs_path = os.path.join(CFG.MOUNT_POINT, path)
try:
stat_info = os.stat(abs_path)
except OSError:
# File is missing completely
- return (1, None)
+ return 1
l_mtime = stat_info[stat.ST_MTIME]
l_size = stat_info[stat.ST_SIZE]
if l_mtime == mtime and l_size == size:
# Same mtime, and size, assume identity
- return (0, None)
+ return 0
# Have to check checksum
l_checksum = getFileChecksum(checksum_type, filename=abs_path)
if l_checksum != checksum:
- # Different checksums
- return (l_checksum, path)
+ return 2
# Set the mtime
os.utime(abs_path, (mtime, mtime))
- return (0, path)
+ return 0
def _process_package(self, package_id, package, l_timestamp, row,
m_channel_packages, m_fs_packages, source=0):
- nevra = []
- for t in ['name', 'epoch', 'version', 'release',
'arch']:
- nevra.append(package[t])
- package_size = package['package_size']
-
- if package['org_id'] is not None:
- orgid = OPTIONS.orgid or DEFAULT_ORG
- else:
- orgid = package['org_id']
-
- if not row:
- # Package is missing completely from the DB
- m_channel_packages.append(package_id)
- #m_fs_packages.append((package_id, path))
- return
+ path = None
+ channel_package = None
+ fs_package = None
+ if row:
+ # package found in the DB
+ checksum_type = row['checksum_type']
+ if checksum_type in package['checksums']:
+ checksum = package['checksums'][row['checksum_type']]
+ package_size = package['package_size']
- # Package found in the DB
- checksum_type = row['checksum_type']
- if checksum_type in package['checksums']:
- checksum = package['checksums'][row['checksum_type']]
-
- db_timestamp = int(rhnLib.timestamp(row['last_modified']))
- db_checksum = row['checksum']
- db_package_size = row['package_size']
- db_path = row['path']
- final_path = db_path
-
- path = self._get_rel_package_path(nevra, orgid, source, checksum_type,
checksum)
- # Check the filesystem
- # This is one ugly piece of code
- (errcode, ret_path) = self._verify_file(db_path, l_timestamp,
- package_size, checksum_type, checksum)
- if errcode != 0:
- if errcode != 1 or path == db_path:
- # Package is modified; fix it
- m_fs_packages.append((package_id, path))
- else:
- # Package is missing, and the DB path is, for some
- # reason, not the same as the computed path.
- (errcode, ret_path) = self._verify_file(path,
- l_timestamp, package_size, checksum_type, checksum)
- if errcode != 1:
- # Use the computed path
- final_path = path
- if errcode != 0:
- # file is modified too; re-download
- m_fs_packages.append((package_id, final_path))
-
- if (l_timestamp <= db_timestamp and
- checksum == db_checksum and
- package_size == db_package_size and final_path == db_path):
- # Same package
- return
- # Have to re-import the package - this may be just because the
- # path has changed
- m_channel_packages.append(package_id)
+ db_timestamp = int(rhnLib.timestamp(row['last_modified']))
+ db_checksum = row['checksum']
+ db_package_size = row['package_size']
+ db_path = row['path']
+
+ if not (l_timestamp <= db_timestamp and
+ checksum == db_checksum and
+ package_size == db_package_size):
+ # package doesn't match
+ channel_package = package_id
+
+ if db_path:
+ # check the filesystem
+ errcode = self._verify_file(db_path, l_timestamp,
+ package_size, checksum_type, checksum)
+ if errcode:
+ # file doesn't match
+ fs_package = (package_id, db_path)
+
+ # package is missing from the DB
+ channel_package = package_id
+
+ if not fs_package:
+ nevra = []
+ for t in ['name', 'epoch', 'version',
'release', 'arch']:
+ nevra.append(package[t])
+
+ if package['org_id'] is not None:
+ orgid = OPTIONS.orgid or DEFAULT_ORG
+ else:
+ orgid = package['org_id']
+
+ path = self._get_rel_package_path(nevra, orgid, source,
+ checksum_type, checksum)
+ errcode = self._verify_file(path,
+ l_timestamp, package_size, checksum_type, checksum)
+ if errcode:
+ # file doesn't match
+ fs_package = (package_id, path)
+
+ if channel_package:
+ m_channel_packages.append(channel_package)
+ if fs_package:
+ m_fs_packages.append(fs_package)
+ return
def download_rpms(self):
log(1, ["", "Downloading rpm packages"])
commit 8bc0b88a8528d15ddebdadec0a273a39605390f1
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Apr 29 23:20:19 2010 +0200
made _compute_unique_packages() even more simple and straightforward
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index b0bf855..e1d5bbb 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -847,13 +847,10 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
timestamp = self._get_channel_timestamp(chn)
channel_obj = self._channel_collection.get_channel(chn, timestamp)
- package_ids = channel_obj['all-packages']
- avail_package_ids = channel_obj['packages']
- if package_ids is None:
- # Not an incremental
- package_ids = avail_package_ids
- self._channel_packages[chn] = set(package_ids or [])
- self._avail_channel_packages[chn] = set(avail_package_ids or [])
+ avail_package_ids = sorted(set(channel_obj['packages'] or []))
+ package_ids = sorted(set(channel_obj['all-packages'] or [])) or
avail_package_ids
+ self._channel_packages[chn] = package_ids
+ self._avail_channel_packages[chn] = avail_package_ids
def processShortPackages(self):
log(1, ["", "Retrieving short package metadata (used for
indexing)"])
commit 2b8ba63777b4b00e295259139fc8fa71acc66fd2
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Apr 29 23:14:30 2010 +0200
moved repeated code into function
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 09ba88d..b0bf855 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -830,17 +830,21 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
except Exception:
None
+ def _get_channel_timestamp(self, channel):
+ try:
+ timestamp = self._channel_collection.get_channel_timestamp(channel)
+ except KeyError:
+ # XXX Do something with this exception
+ raise
+ return timestamp
+
def _compute_unique_packages(self):
""" process package metadata for one channel at a time
"""
relevant = self._channel_req.get_requested_channels()
self._channel_packages = {}
self._avail_channel_packages = {}
for chn in relevant:
- try:
- timestamp = self._channel_collection.get_channel_timestamp(chn)
- except KeyError:
- # XXX Do something with this exception
- raise
+ timestamp = self._get_channel_timestamp(chn)
channel_obj = self._channel_collection.get_channel(chn, timestamp)
package_ids = channel_obj['all-packages']
@@ -1184,11 +1188,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
self._channel_source_packages = {}
self._avail_channel_source_packages = {}
for chn in relevant:
- try:
- timestamp = self._channel_collection.get_channel_timestamp(chn)
- except KeyError:
- # XXX Do something with this exception
- raise
+ timestamp = self._get_channel_timestamp(chn)
channel_obj = self._channel_collection.get_channel(chn, timestamp)
sps = set(channel_obj['source_packages'])
@@ -1346,11 +1346,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
self._uq_channel_kickstarts = uq_channel_kickstarts = {}
uq_kickstarts = {}
for chn in relevant:
- try:
- timestamp = self._channel_collection.get_channel_timestamp(chn)
- except KeyError:
- # XXX Do something with this exception
- raise
+ timestamp = self._get_channel_timestamp(chn)
channel_obj = self._channel_collection.get_channel(chn, timestamp)
kickstart_trees = channel_obj['kickstartable_trees']
@@ -1376,11 +1372,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
missing_kickstarts = {}
h = rhnSQL.Statement(self._query_get_kickstarts)
for chn in relevant:
- try:
- timestamp = self._channel_collection.get_channel_timestamp(chn)
- except KeyError:
- # XXX Do something with this exception
- raise
+ timestamp = self._get_channel_timestamp(chn)
channel_obj = self._channel_collection.get_channel(chn, timestamp)
kickstart_trees = channel_obj['kickstartable_trees']
@@ -1635,11 +1627,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
channel_errata = {}
for chn in relevant:
db_ce = db_channel_errata[chn]
- try:
- timestamp = self._channel_collection.get_channel_timestamp(chn)
- except KeyError:
- # XXX Do something with this exception
- raise
+ timestamp = self._get_channel_timestamp(chn)
channel_obj = self._channel_collection.get_channel(chn, timestamp)
errata_timestamps = channel_obj['errata_timestamps']
commit bd61764a494504c62609a35665d0860f11456140
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Apr 29 16:03:45 2010 +0200
simplified _compute_unique_source_packages()
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 218fff1..09ba88d 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -405,7 +405,6 @@ class Syncer:
self._missing_channel_errata = {}
self._channel_source_packages = {}
- self._uq_channel_source_packages = {}
self._channel_kickstarts = {}
self._uq_channel_kickstarts = {}
@@ -1182,10 +1181,8 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _compute_unique_source_packages(self):
""" process package metadata for one channel at a
time"""
relevant = self._channel_req.get_requested_channels()
- self._channel_source_packages = channel_sp = {}
- self._avail_channel_source_packages = avail_channel_source_packages = {}
- self._uq_channel_source_packages = uq_sp = {}
- uq = {}
+ self._channel_source_packages = {}
+ self._avail_channel_source_packages = {}
for chn in relevant:
try:
timestamp = self._channel_collection.get_channel_timestamp(chn)
@@ -1194,7 +1191,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
raise
channel_obj = self._channel_collection.get_channel(chn, timestamp)
- sps = channel_obj['source_packages']
+ sps = set(channel_obj['source_packages'])
if not sps:
# No source package info
continue
@@ -1207,29 +1204,15 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
ret_sps.append((sp['id'], sp['last_modified']))
del sps
ret_sps.sort()
- channel_sp[chn] = ret_sps
-
- avail_channel_source_packages[chn] = ret_sps
-
- # Uniquify source packages
- for channel_label, sps in channel_sp.items():
- ch_sp_ids = uq_sp[channel_label] = []
- for sp_id, timestamp in sps:
- if uq.has_key(sp_id):
- # Saw this source package already
- continue
- ch_sp_ids.append((sp_id, timestamp))
- uq[sp_id] = None
- # Be nice enough to sort the list
- ch_sp_ids.sort()
- del uq
+ self._channel_source_packages[chn] = ret_sps
+ self._avail_channel_source_packages[chn] = ret_sps
def _compute_not_cached_source_packages(self):
missing_sps = {}
# First, determine what has to be downloaded
sp_collection = sync_handlers.SourcePackageCollection()
- for channel, sps in self._uq_channel_source_packages.items():
+ for channel, sps in self._channel_source_packages.items():
missing_sps[channel] = mp = []
if not sps:
@@ -1263,7 +1246,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
missing_channel_source_packages = {}
missing_fs_source_packages = {}
- for channel_label, upids in self._uq_channel_source_packages.items():
+ for channel_label, upids in self._channel_source_packages.items():
log(1, "Diffing source package metadata (what's missing locally?):
%s" % channel_label)
m_channel_source_packages = missing_channel_source_packages[channel_label] =
[]
m_fs_source_packages = missing_fs_source_packages[channel_label] = []
commit 7e775347bf70ee73ba5e69d21e772dc90c4c8f36
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Apr 29 15:31:30 2010 +0200
modified rhn-package-file to import new checksum correctly
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index d6d6546..a82d9cb 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -483,6 +483,11 @@ class BaseChecksummedItem(BaseItem):
for csum in item['checksum_list']:
item['checksums'][csum['type']] = csum['value']
del(item['checksum_list'])
+ for ctype in CFG.CHECKSUM_PRIORITY_LIST:
+ if ctype in item['checksums']:
+ item['checksum_type'] = ctype
+ item['checksum'] = item['checksums'][ctype]
+ break
return item
addItem(BaseChecksummedItem)
@@ -551,14 +556,9 @@ class PackageItem(IncompletePackageItem):
item = IncompletePackageItem.populate(self, attributes, elements)
# find out "primary" checksum
have_filedigests = len([1 for i in item['requires'] if i['name']
== 'rpmlib(FileDigests)'])
- if have_filedigests:
- for ctype in CFG.CHECKSUM_PRIORITY_LIST:
- if ctype in item['checksums']:
- item['checksum_type'] = ctype
- break
- else:
+ if not have_filedigests:
item['checksum_type'] = 'md5'
- item['checksum'] =
item['checksums'][item['checksum_type']]
+ item['checksum'] = item['checksums']['md5']
return item
addItem(PackageItem)
@@ -632,16 +632,11 @@ addItem(ObsoletesItem)
class FileItem(BaseChecksummedItem):
item_name = 'rhn-package-file'
item_class = importLib.File
- tagMap = {
- 'md5' : 'md5sum',
- 'checksum-type': 'checksum_type',
- 'checksum' : 'checksum',
- }
def populate(self, attributes, elements):
+ if 'md5' in attributes:
+ attributes['checksum_type'] = 'md5'
+ attributes['checksum'] = attributes['md5']
item = BaseChecksummedItem.populate(self, attributes, elements)
- if not item['checksum_type']:
- item['checksum_type'] = item['checksums'].keys()[0]
- item['checksum'] =
item['checksums'][item['checksum_type']]
return item
addItem(FileItem)
@@ -769,7 +764,6 @@ class KickstartFileItem(BaseChecksummedItem):
'relative-path' : 'relative_path',
'file-size' : 'file_size',
'last-modified' : 'last_modified',
- 'checksum-type' : 'checksum_type',
}
addItem(KickstartFileItem)
diff --git a/backend/server/importlib/importLib.py
b/backend/server/importlib/importLib.py
index 29dfabc..4fc23a2 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -239,10 +239,8 @@ class File(Item):
'flags' : IntType,
'verifyflags' : IntType,
'lang' : StringType,
- # those attributes are mutualy exclusive
- 'md5sum' : StringType, # xml dumps < 3.5
- 'checksum' : StringType, # xml dumps >= 3.5
- 'checksum_type' : StringType, # xml dumps >= 3.5
+ 'checksum' : StringType,
+ 'checksum_type' : StringType,
}
def __init__(self):
Item.__init__(self, self.attributeTypes)
commit 6dac065ac479e58d450de49938008ff94db77422
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Apr 29 11:10:26 2010 +0200
made checksum priority list configurable
diff --git a/backend/rhn-conf/rhn_server.conf b/backend/rhn-conf/rhn_server.conf
index 8a5c3fa..c6808fa 100644
--- a/backend/rhn-conf/rhn_server.conf
+++ b/backend/rhn-conf/rhn_server.conf
@@ -131,3 +131,5 @@ repomd_path_prefix = rhn/repodata
# Default to not using taskomatic for repomd
use_taskomatic_repomd = 1
+# list of checksum types, most prefered first
+checksum_priority_list = sha512, sha384, sha256, sha1, md5
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index 020224e..d6d6546 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -22,7 +22,7 @@ import string
from xml.sax import make_parser, SAXParseException, ContentHandler, \
ErrorHandler
-from common import log_debug, Traceback, rhnFlags
+from common import log_debug, Traceback, rhnFlags, CFG
from server.importlib import importLib, backendLib
@@ -552,7 +552,7 @@ class PackageItem(IncompletePackageItem):
# find out "primary" checksum
have_filedigests = len([1 for i in item['requires'] if i['name']
== 'rpmlib(FileDigests)'])
if have_filedigests:
- for ctype in
['sha512','sha384','sha256','sha1','md5']:
+ for ctype in CFG.CHECKSUM_PRIORITY_LIST:
if ctype in item['checksums']:
item['checksum_type'] = ctype
break
commit 96d243d2e98381c5faab066c48f1540cf936c3a7
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Apr 28 17:13:43 2010 +0200
ShortPackageCollection doesn't have enough information about checksum
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 722b142..218fff1 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1839,11 +1839,12 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _link_channel_packages(self):
log(1, ["", messages.link_channel_packages])
short_package_collection = sync_handlers.ShortPackageCollection()
+ package_collection = sync_handlers.PackageCollection()
uq_packages = {}
for chn, package_ids in self._channel_packages.items():
for pid in package_ids:
timestamp = short_package_collection.get_package_timestamp(pid)
- package = short_package_collection.get_package(pid, timestamp)
+ package = package_collection.get_package(pid, timestamp)
assert package is not None
channel_obj = {'label' : chn}
if uq_packages.has_key(pid):
commit a47dbb4789ac898cba72e47401b6c0abf9867dc6
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Apr 28 16:33:03 2010 +0200
removed unused code and its comment
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index b3a8c64..722b142 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1839,8 +1839,6 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _link_channel_packages(self):
log(1, ["", messages.link_channel_packages])
short_package_collection = sync_handlers.ShortPackageCollection()
- # XXX: don't use this next line for anything. Why is it here?
- #relevant = self._channel_req.get_requested_channels()
uq_packages = {}
for chn, package_ids in self._channel_packages.items():
for pid in package_ids:
commit 587c345ae82b1fc0cd5cba946132577355d7db19
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Apr 27 16:45:58 2010 +0200
removed _ChecksumEntryDumper(): can be simply rewriten via EmptyDumper()
diff --git a/backend/satellite_tools/exporter/exportLib.py
b/backend/satellite_tools/exporter/exportLib.py
index 6c68926..4b290c6 100644
--- a/backend/satellite_tools/exporter/exportLib.py
+++ b/backend/satellite_tools/exporter/exportLib.py
@@ -838,19 +838,12 @@ class _ChecksumDumper(BaseDumper):
tag_name = 'checksums'
def dump_subelement(self, data):
- c = _ChecksumEntryDumper(self._writer, data)
+ c = EmptyDumper(self._writer, 'checksum', attributes={
+ 'type' : data['type'],
+ 'value': data['value'],
+ })
c.dump()
-class _ChecksumEntryDumper(BaseRowDumper):
- tag_name = 'checksum'
-
- def set_attributes(self):
- attrs = ['type', 'value']
- attrdict = {}
- for attr in attrs:
- attrdict[attr] = self._row[attr]
- return attrdict
-
##
class _ChangelogDumper(BaseDumper):
tag_name = 'rhn-package-changelog'
commit ae9705bfdb895160fb6d9ff0cb236b9f1a8b1b54
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Apr 26 15:12:34 2010 +0200
let the comment make sense
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 953b222..b3a8c64 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -2323,7 +2323,7 @@ def processCommandline():
global OPTIONS
OPTIONS, args = optionParser.parse_args()
- # we take no extra commandline arguments that are not linked to an option
+ # we take extra commandline arguments that are not linked to an option
if args:
msg = "ERROR: these arguments make no sense in this context (try --help):
%s" % repr(args)
log2stderr(-1, msg, 1,1)
commit cd53bea124d3749f8e6a2c8e31f57caf839b000d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Apr 26 15:00:21 2010 +0200
removed an extra condition
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 8004e4a..953b222 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -660,10 +660,12 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
dataServer.setChannel(c)
stream = dataServer.load()
h.process(stream)
+ doEOSYN=0
else:
dataServer = self.xmlWireServer.getChannelXmlStream
stream = dataServer([])
h.process(stream)
+ doEOSYN=1
h.close()
@@ -676,10 +678,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
#satellite-sync is running with the --mount-point (-m) option. If it
#did, it would incorrectly list channels as end-of-service if they had been
#synced already but aren't in the channel dump.
- if self.mountpoint:
- self._printChannelTree(doEOSYN=0)
- else:
- self._printChannelTree(doEOSYN=1)
+ self._printChannelTree(doEOSYN=doEOSYN)
if self.listChannelsYN:
# We're done here
commit f436d8bfe8d25aa13796a097de349de9ce88afd5
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Apr 26 14:53:08 2010 +0200
removed an extra condition and made code slightly readable
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 7785a51..8004e4a 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -422,16 +422,17 @@ class Syncer:
self.xmlWireServer = xmlWireSource.MetadataWireSource(self.systemid,
self.sslYN, self.xml_dump_version)
if CFG.ISS_PARENT:
- url = self.xmlWireServer.schemeAndUrl(CFG.ISS_PARENT)
+ sync_parent = CFG.ISS_PARENT
+ is_iss = 1
else:
- url = self.xmlWireServer.schemeAndUrl(CFG.RHN_PARENT)
+ sync_parent = CFG.RHN_PARENT
+ is_iss = 0
+
+ url = self.xmlWireServer.schemeAndUrl(sync_parent)
log(1, ['Red Hat Network Satellite - live synchronization',
' url: %s' % url,
' debug/output level: %s' % CFG.DEBUG])
- if CFG.ISS_PARENT:
- self.xmlWireServer.setServerHandler(isIss=1)
- else:
- self.xmlWireServer.setServerHandler()
+ self.xmlWireServer.setServerHandler(isIss=is_iss)
if not self.mountpoint:
# check and fetch systemid (NOTE: systemid kept in memory... may or may not
commit f0ae657e1cac57136d7fdaa12bcc459ae6eb2c1b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Apr 26 14:31:57 2010 +0200
package metadata have to go before rpms now
(we need whether package is md5 or sha256)
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 4ff9548..7785a51 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -103,13 +103,13 @@ class Runner:
'channels',
'blacklists',
'short',
+ 'download-packages',
+ 'packages',
'rpms',
'srpms',
- 'download-packages',
'download-source-packages',
'download-errata',
'download-kickstarts',
- 'packages',
'source-packages',
'errata',
'kickstarts',
commit e94ebbd78cf08b7dadadce51c3cc866ac4aa7a4c
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Apr 26 14:29:19 2010 +0200
check whether database contains one of the checksums we got from dump
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index fefbabe..4ff9548 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1033,39 +1033,41 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
# Package found in the DB
checksum_type = row['checksum_type']
- checksum = package['checksum']
- db_timestamp = int(rhnLib.timestamp(row['last_modified']))
- db_checksum = row['checksum']
- db_package_size = row['package_size']
- db_path = row['path']
- final_path = db_path
-
- path = self._get_rel_package_path(nevra, orgid, source, checksum_type, checksum)
- # Check the filesystem
- # This is one ugly piece of code
- (errcode, ret_path) = self._verify_file(db_path, l_timestamp,
- package_size, checksum_type, checksum)
- if errcode != 0:
- if errcode != 1 or path == db_path:
- # Package is modified; fix it
- m_fs_packages.append((package_id, path))
- else:
- # Package is missing, and the DB path is, for some
- # reason, not the same as the computed path.
- (errcode, ret_path) = self._verify_file(path,
- l_timestamp, package_size, checksum_type, checksum)
- if errcode != 1:
- # Use the computed path
- final_path = path
- if errcode != 0:
- # file is modified too; re-download
- m_fs_packages.append((package_id, final_path))
-
- if (l_timestamp <= db_timestamp and
- checksum == db_checksum and
- package_size == db_package_size and final_path == db_path):
- # Same package
- return
+ if checksum_type in package['checksums']:
+ checksum = package['checksums'][row['checksum_type']]
+
+ db_timestamp = int(rhnLib.timestamp(row['last_modified']))
+ db_checksum = row['checksum']
+ db_package_size = row['package_size']
+ db_path = row['path']
+ final_path = db_path
+
+ path = self._get_rel_package_path(nevra, orgid, source, checksum_type,
checksum)
+ # Check the filesystem
+ # This is one ugly piece of code
+ (errcode, ret_path) = self._verify_file(db_path, l_timestamp,
+ package_size, checksum_type, checksum)
+ if errcode != 0:
+ if errcode != 1 or path == db_path:
+ # Package is modified; fix it
+ m_fs_packages.append((package_id, path))
+ else:
+ # Package is missing, and the DB path is, for some
+ # reason, not the same as the computed path.
+ (errcode, ret_path) = self._verify_file(path,
+ l_timestamp, package_size, checksum_type, checksum)
+ if errcode != 1:
+ # Use the computed path
+ final_path = path
+ if errcode != 0:
+ # file is modified too; re-download
+ m_fs_packages.append((package_id, final_path))
+
+ if (l_timestamp <= db_timestamp and
+ checksum == db_checksum and
+ package_size == db_package_size and final_path == db_path):
+ # Same package
+ return
# Have to re-import the package - this may be just because the
# path has changed
m_channel_packages.append(package_id)
commit e59e8f13eb3d2d3d5a8baa3f4790a94fcaa8ebfd
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Apr 26 14:17:07 2010 +0200
path may be None if package has been synced with --no-rpms
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index c437cc5..fefbabe 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -988,6 +988,8 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
The idea is that error_code is 0 if the file exists or something else
otherwise
"""
+ if not path:
+ return (1, None)
abs_path = os.path.join(CFG.MOUNT_POINT, path)
try:
stat_info = os.stat(abs_path)
commit 4bb4793ca32abac24afa658181c9fd01dea0e9cc
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Apr 26 12:16:49 2010 +0200
choose primary checksum according to rpm capability
fix rpm-package-file's checksum
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index a96dab4..020224e 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -547,6 +547,19 @@ class PackageItem(IncompletePackageItem):
'rhn-package-changelog' : 'changelog',
}
tagMap.update(IncompletePackageItem.tagMap)
+ def populate(self, attributes, elements):
+ item = IncompletePackageItem.populate(self, attributes, elements)
+ # find out "primary" checksum
+ have_filedigests = len([1 for i in item['requires'] if i['name']
== 'rpmlib(FileDigests)'])
+ if have_filedigests:
+ for ctype in
['sha512','sha384','sha256','sha1','md5']:
+ if ctype in item['checksums']:
+ item['checksum_type'] = ctype
+ break
+ else:
+ item['checksum_type'] = 'md5'
+ item['checksum'] =
item['checksums'][item['checksum_type']]
+ return item
addItem(PackageItem)
class IncompleteSourcePackageItem(BaseItem):
@@ -621,7 +634,15 @@ class FileItem(BaseChecksummedItem):
item_class = importLib.File
tagMap = {
'md5' : 'md5sum',
+ 'checksum-type': 'checksum_type',
+ 'checksum' : 'checksum',
}
+ def populate(self, attributes, elements):
+ item = BaseChecksummedItem.populate(self, attributes, elements)
+ if not item['checksum_type']:
+ item['checksum_type'] = item['checksums'].keys()[0]
+ item['checksum'] =
item['checksums'][item['checksum_type']]
+ return item
addItem(FileItem)
class DistItem(BaseItem):
commit 39635cb117feda28e062fe09ccfe563fe5c9e555
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Apr 23 11:21:51 2010 +0200
path has been removed from the collection
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 67c4a3c..c437cc5 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -1880,7 +1880,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
else:
package_collection = sync_handlers.PackageCollection()
batch = []
- for pid, file_path in chunk:
+ for pid in chunk:
timestamp = short_package_collection.get_package_timestamp(pid)
package = package_collection.get_package(pid, timestamp)
if package is None:
@@ -1888,7 +1888,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
raise Exception("Package Not Found in Cache, Clear the Cache to \
Regenerate it.")
# Now set the path
- package['path'] = file_path
+# FIXME package['path'] = file_path
batch.append(package)
return batch
commit ac116e50ced003ff24e05ec51632ce84af08a6ab
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Apr 23 11:18:53 2010 +0200
fixed variables changed in b2b2398f7b78938841a2e9c67164dd3780f4516d
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 3f474ae..67c4a3c 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -849,8 +849,8 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
if package_ids is None:
# Not an incremental
package_ids = avail_package_ids
- channel_packages[chn] = set(package_ids or [])
- avail_channel_packages[chn] = set(avail_package_ids or [])
+ self._channel_packages[chn] = set(package_ids or [])
+ self._avail_channel_packages[chn] = set(avail_package_ids or [])
def processShortPackages(self):
log(1, ["", "Retrieving short package metadata (used for
indexing)"])
commit bea4a180f0220a75e065dc2141de5fa214e6906d
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Apr 23 11:10:59 2010 +0200
fixed typo
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 83faa81..3f474ae 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -935,7 +935,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
apply(h.execute, (), nevra)
row = None
- for r in (h.fetchall_dict() or []):
+ for r in (h.fetchall_dict() or []):
# let's check which checksum we have in database
if package['checksums'][r['checksum_type']] ==
r['checksum']:
row = r
commit 503e6a858b5d6ada430a654307b04796e971f095
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Apr 23 10:58:51 2010 +0200
modified rhn-package, rhn-erratum-file and rhn-kickstart-file to import checksum
element
diff --git a/backend/server/importlib/importLib.py
b/backend/server/importlib/importLib.py
index fc5c597..29dfabc 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -349,13 +349,8 @@ class Package(IncompletePackage):
'header_start' : IntType,
'header_end' : IntType,
'path' : StringType,
- # these attributes are mutualy exclusive
'md5sum' : StringType, # xml dumps < 3.5
- 'checksum' : StringType, # xml dumps >= 3.5
- 'checksum_type' : StringType, # xml dumps >= 3.5
- 'sigmd5' : StringType, # xml dumps < 3.5 and rpms
- 'sigchecksum_type' : StringType, # xml dumps >= 3.5
- 'sigchecksum' : StringType, # xml dumps >= 3.5
+ 'sigmd5' : StringType,
# These attributes are lists of objects
'files' : [File],
'requires' : [Dependency],
@@ -364,6 +359,7 @@ class Package(IncompletePackage):
'obsoletes' : [Dependency],
'changelog' : [ChangeLog],
'channels' : [StringType],
+ 'checksum_list' : [Checksum],
}
def __init__(self):
# Inherit from IncompletePackage
@@ -389,11 +385,8 @@ class SourcePackage(IncompletePackage):
'last_modified' : DateType,
# these attributes are mutualy exclusive
'md5sum' : StringType, # xml dumps < 3.5
- 'checksum' : StringType, # xml dumps >= 3.5
- 'checksum_type' : StringType, # xml dumps >= 3.5
'sigmd5' : StringType, # xml dumps < 3.5 and rpms
- 'sigchecksum_type' : StringType, # xml dumps >= 3.5
- 'sigchecksum' : StringType, # xml dumps >= 3.5
+ 'checksum_list' : [Checksum],
}
def __init__(self):
# Inherit from IncompletePackage
@@ -414,8 +407,7 @@ class SourcePackageFile(Information):
'org_id' : IntType,
# these attributes are mutualy exclusive
'md5sum' : StringType, # xml dumps < 3.5
- 'checksum' : StringType, # xml dumps >= 3.5
- 'checksum_type' : StringType, # xml dumps >= 3.5
+ 'checksum_list' : [Checksum],
}
@@ -434,8 +426,7 @@ class ErrataFile(Information):
'package_id' : IntType,
# these attributes are mutualy exclusive
'md5sum' : StringType, # xml dumps < 3.5
- 'checksum' : StringType, # xml dumps >= 3.5
- 'checksum_type' : StringType, # xml dumps >= 3.5
+ 'checksum_list' : [Checksum],
}
@@ -544,10 +535,8 @@ class KickstartFile(Information):
'relative_path' : StringType,
'last_modified' : DateType,
'file_size' : IntType,
- # these attributes are mutualy exclusive
'md5sum' : StringType, # xml dumps < 3.5
- 'checksum' : StringType, # xml dumps >= 3.5
- 'checksum_type' : StringType, # xml dumps >= 3.5
+ 'checksum_list' : [Checksum],
}
class KickstartableTree(Information):
commit 0a3d13f3b3771c6593a3256f2d620e3584c0867a
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Apr 23 10:21:41 2010 +0200
check if any of checksums we got matches to checksum of the package we have
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index a4c616e..83faa81 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -893,14 +893,11 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
and (p.org_id = :org_id or
(p.org_id is null and :org_id is null))
and p.checksum_id = c.id
- and c.checksum = :checksum
- and c.checksum_type = :checksum_type
"""
# XXX the "is null" condition will have to change in multiorg satellites
def _diff_packages(self):
package_collection = sync_handlers.ShortPackageCollection()
- nvrea_keys = ['name', 'epoch', 'version', \
- 'release', 'arch', 'checksum',
'checksum_type']
+ nvrea_keys = ['name', 'epoch', 'version',
'release', 'arch']
h = rhnSQL.prepare(self._query_compare_packages)
missing_channel_packages = {}
@@ -937,7 +934,13 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
nevra['org_id'] = package['org_id']
apply(h.execute, (), nevra)
- row = h.fetchone_dict()
+ row = None
+ for r in (h.fetchall_dict() or []):
+ # let's check which checksum we have in database
+ if package['checksums'][r['checksum_type']] ==
r['checksum']:
+ row = r
+ break
+
# Update the progress bar
pb.addTo(1)
pb.printIncrement()
@@ -955,8 +958,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
In an incremental approach, one may request packages that are actually
not available in the current dump, probably because of applying an
incremental to the wrong base"""
- for channel_label, objs in missing_channel_packages.items():
- pids = map(lambda x: x[0], objs)
+ for channel_label, pids in missing_channel_packages.items():
if sources:
avail_pids = map(lambda x: x[0], self._avail_channel_source_packages[channel_label])
else:
@@ -1014,8 +1016,6 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
nevra = []
for t in ['name', 'epoch', 'version', 'release',
'arch']:
nevra.append(package[t])
- checksum_type = package['checksum_type']
- checksum = package['checksum']
package_size = package['package_size']
if package['org_id'] is not None:
@@ -1023,27 +1023,22 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
else:
orgid = package['org_id']
- path = self._get_rel_package_path(nevra, orgid, source, checksum_type, checksum)
if not row:
# Package is missing completely from the DB
- m_channel_packages.append((package_id, path))
- (errcode, ret_path) = self._verify_file(path,
- l_timestamp, package_size, checksum_type, checksum)
- if errcode == 0:
- # Package on the filesystem, and matches
- return
- # we have to update this rpm
- m_fs_packages.append((package_id, path))
+ m_channel_packages.append(package_id)
+ #m_fs_packages.append((package_id, path))
return
# Package found in the DB
+ checksum_type = row['checksum_type']
+ checksum = package['checksum']
db_timestamp = int(rhnLib.timestamp(row['last_modified']))
- db_checksum_type = row['checksum_type']
db_checksum = row['checksum']
db_package_size = row['package_size']
db_path = row['path']
final_path = db_path
+ path = self._get_rel_package_path(nevra, orgid, source, checksum_type, checksum)
# Check the filesystem
# This is one ugly piece of code
(errcode, ret_path) = self._verify_file(db_path, l_timestamp,
@@ -1065,13 +1060,13 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
m_fs_packages.append((package_id, final_path))
if (l_timestamp <= db_timestamp and
- checksum_type == db_checksum_type and checksum == db_checksum and
+ checksum == db_checksum and
package_size == db_package_size and final_path == db_path):
# Same package
return
# Have to re-import the package - this may be just because the
# path has changed
- m_channel_packages.append((package_id, final_path))
+ m_channel_packages.append(package_id)
def download_rpms(self):
log(1, ["", "Downloading rpm packages"])
@@ -1103,7 +1098,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
# Nothing to see here
continue
- for (pid, path) in pids:
+ for pid in pids:
# XXX Catch errors
timestamp = short_package_collection.get_package_timestamp(pid)
if not package_collection.has_package(pid, timestamp):
commit ab6f2343ee881d88e15c2b26a6be7b7e8dc962bb
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Apr 21 15:49:24 2010 +0200
modified importer to read new checksum element from dump
<rhn-package-short md5sum="ba311903b5549a2ed382ea463f6" ... >
<checksums>
<checksum type="md5" value="ba311903b5549a2ed382ea463f6"/>
<checksum type="sha256"
value="1908d9bfd416739c34cae407b03b9ee046084a9dfd858103b0bf79dd8dcb9129"/>
</checksums>
</rhn-package-short>
diff --git a/backend/satellite_tools/xmlSource.py b/backend/satellite_tools/xmlSource.py
index 13ae0ad..a96dab4 100644
--- a/backend/satellite_tools/xmlSource.py
+++ b/backend/satellite_tools/xmlSource.py
@@ -474,12 +474,15 @@ addItem(ChannelItem)
class BaseChecksummedItem(BaseItem):
def populate(self, attributes, elements):
item = BaseItem.populate(self, attributes, elements)
+ item['checksums'] = {}
if 'md5sum' in item:
- if type(item['checksum']) != types.StringType:
- # xml dumps < 3.5 (aka pre-sha256)
- item['checksum_type'] = 'md5'
- item['checksum'] = item['md5sum']
+ # xml dumps < 3.6 (aka pre-sha256)
+ item['checksums']['md5'] = item['md5sum']
del(item['md5sum'])
+ if 'checksum_list' in item and item['checksum_list']:
+ for csum in item['checksum_list']:
+ item['checksums'][csum['type']] = csum['value']
+ del(item['checksum_list'])
return item
addItem(BaseChecksummedItem)
@@ -492,10 +495,20 @@ class IncompletePackageItem(BaseChecksummedItem):
'last-modified' : 'last_modified',
'package-arch' : 'arch',
'org-id' : 'org_id',
- 'checksum-type' : 'checksum_type', # xml dump 3.5
(sha256)
+ 'checksums' : 'checksum_list',
}
addItem(IncompletePackageItem)
+class ChecksumItem(BaseItem):
+ item_name = 'checksum'
+ item_class = importLib.Checksum
+ tagMap = {
+ 'checksum-type' : 'type',
+ 'checksum-value' : 'value',
+ }
+addItem(ChecksumItem)
+
+
class PackageItem(IncompletePackageItem):
item_name = 'rhn-package'
item_class = importLib.Package
diff --git a/backend/server/importlib/importLib.py
b/backend/server/importlib/importLib.py
index c0b2b64..fc5c597 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -268,6 +268,15 @@ class ChangeLog(Item):
Item.__init__(self, self.attributeTypes)
+class Checksum(Item):
+ attributeTypes = {
+ 'type' : StringType,
+ 'value' : StringType,
+ }
+ def __init__(self):
+ Item.__init__(self, self.attributeTypes)
+
+
class IncompletePackage(BaseInformation):
attributeTypes = {
'package_id' : StringType, # RH db id
@@ -279,12 +288,10 @@ class IncompletePackage(BaseInformation):
'org_id' : IntType,
'package_size' : IntType,
'last_modified' : DateType,
- # those attributes are mutualy exclusive
'md5sum' : StringType, # xml dumps < 3.5
- 'checksum' : StringType, # xml dumps >= 3.5
- 'checksum_type' : StringType, # xml dumps >= 3.5
# These attributes are lists of objects
'channels' : [StringType],
+ 'checksum_list' : [Checksum],
}
def __init__(self):
BaseInformation.__init__(self, IncompletePackage.attributeTypes)
commit bae794c9d7f815b1db0569a381778379fd1a4253
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Apr 21 10:46:28 2010 +0200
changed class and procedure comments to docstrings
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 02522a5..a4c616e 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -259,7 +259,7 @@ class Runner:
def _run_syncer_step(self, function, step_name):
- # Runs a function, and catches the most common error cases
+ """ Runs a function, and catches the most common error cases
"""
try:
ret = function()
except (xmlDiskSource.MissingXmlDiskSourceDirError,
@@ -344,7 +344,7 @@ class Runner:
self.syncer.import_kickstarts()
def sendMail(forceEmail=0):
- ### Send email summary
+ """ Send email summary """
if forceEmail or (OPTIONS is not None and OPTIONS.email):
body = dumpEMAIL_LOG()
if body:
@@ -411,7 +411,7 @@ class Syncer:
self._uq_channel_kickstarts = {}
def initialize(self):
- "Initialization that requires IO, etc."
+ """Initialization that requires IO, etc."""
# Sync from filesystem:
if self.mountpoint:
@@ -542,8 +542,9 @@ class Syncer:
return self._process_cert(cert)
def _process_cert(self, cert, store_cert=1):
- # Give the cert a check - if it's broken xml we'd better find it out
- # now
+ """Give the cert a check - if it's broken xml we'd better
find it out
+ now
+ """
log2(1, 4, " - parsing for sanity")
sat_cert = satellite_cert.SatelliteCert()
try:
@@ -642,8 +643,9 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
self._set_comps_for_channel(backend, data[label]['id'], comps_path,
timestamp)
def process_channels(self):
- # push channels, channel-family and dist. map information
- # as well upon parsing.
+ """ push channels, channel-family and dist. map information
+ as well upon parsing.
+ """
log(1, ["", "Retrieving / parsing channel data"])
h = sync_handlers.get_channel_handler()
@@ -830,7 +832,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
None
def _compute_unique_packages(self):
- ### process package metadata for one channel at a time
+ """ process package metadata for one channel at a time
"""
relevant = self._channel_req.get_requested_channels()
self._channel_packages = {}
self._avail_channel_packages = {}
@@ -1179,7 +1181,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
log(1, "Processing srpm packages complete")
def _compute_unique_source_packages(self):
- ### process package metadata for one channel at a time
+ """ process package metadata for one channel at a
time"""
relevant = self._channel_req.get_requested_channels()
self._channel_source_packages = channel_sp = {}
self._avail_channel_source_packages = avail_channel_source_packages = {}
@@ -1356,7 +1358,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
raise ReprocessingNeeded
def _compute_unique_kickstarts(self):
- ### process package metadata for one channel at a time
+ """ process package metadata for one channel at a
time"""
relevant = self._channel_req.get_requested_channels()
self._channel_kickstarts = channel_kickstarts = {}
self._uq_channel_kickstarts = uq_channel_kickstarts = {}
@@ -1386,7 +1388,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
""")
def _compute_missing_kickstarts(self):
- ### process package metadata for one channel at a time
+ """ process package metadata for one channel at a
time"""
relevant = self._channel_req.get_requested_channels()
coll = sync_handlers.KickstartableTreesCollection()
missing_kickstarts = {}
@@ -1642,7 +1644,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
return db_channel_errata
def _diff_errata(self):
- # Fetch the errata for this channel
+ """ Fetch the errata for this channel"""
db_channel_errata = self._get_db_channel_errata()
relevant = self._channel_req.get_requested_channels()
@@ -1697,9 +1699,10 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
del uq_errata
def _diff_db_errata(self):
- # Compute errata that are missing from the satellite
- # Kind of similar to diff_errata, if we had the timestamp and advisory
- # information available
+ """ Compute errata that are missing from the satellite
+ Kind of similar to diff_errata, if we had the timestamp and advisory
+ information available
+ """
errata_collection = sync_handlers.ErrataCollection()
self._missing_channel_errata = missing_channel_errata = {}
db_channel_errata = self._get_db_channel_errata()
@@ -1873,7 +1876,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
return importer.affected_channels
def _get_cached_package_batch(self, chunk, sources=0):
- # short-circuit the most common case
+ """ short-circuit the most common case"""
if not chunk:
return []
short_package_collection = sync_handlers.ShortPackageCollection()
@@ -1931,7 +1934,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
pb.printComplete()
def _fix_erratum(self, erratum):
- # Replace the list of packages with references to short packages
+ """ Replace the list of packages with references to short
packages"""
sp_coll = sync_handlers.ShortPackageCollection()
pids = unique(erratum['packages'])
# map all the pkgs objects to the erratum
commit 164fad7cad3098ddf3413afe3111fd1b1c0532d7
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Apr 21 10:38:20 2010 +0200
made _compute_unique_packages() simple and straightforward
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py
index 9a5a65d..02522a5 100644
--- a/backend/satellite_tools/satsync.py
+++ b/backend/satellite_tools/satsync.py
@@ -393,7 +393,6 @@ class Syncer:
self.systemid = None
self._channel_packages = {}
- self._uq_channel_packages = {}
self._avail_channel_packages = {}
self._missing_channel_packages = None
@@ -833,10 +832,8 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
def _compute_unique_packages(self):
### process package metadata for one channel at a time
relevant = self._channel_req.get_requested_channels()
- self._channel_packages = channel_packages = {}
- self._avail_channel_packages = avail_channel_packages = {}
- uq_package_ids = {}
- self._uq_channel_packages = uq_channel_packages = {}
+ self._channel_packages = {}
+ self._avail_channel_packages = {}
for chn in relevant:
try:
timestamp = self._channel_collection.get_channel_timestamp(chn)
@@ -850,27 +847,13 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
if package_ids is None:
# Not an incremental
package_ids = avail_package_ids
- channel_packages[chn] = package_ids
- avail_channel_packages[chn] = avail_package_ids
-
- # Uniquify the packages
- for channel_label, package_ids in channel_packages.items():
- ch_package_ids = uq_channel_packages[channel_label] = []
- for pid in package_ids:
- if uq_package_ids.has_key(pid):
- # Saw this package already
- continue
- ch_package_ids.append(pid)
- uq_package_ids[pid] = None
- # Be nice enough to sort the list
- ch_package_ids.sort()
- del uq_package_ids
+ channel_packages[chn] = set(package_ids or [])
+ avail_channel_packages[chn] = set(avail_package_ids or [])
def processShortPackages(self):
log(1, ["", "Retrieving short package metadata (used for
indexing)"])
- # Compute the unique packages and populate self._channel_packages and
- # self._uq_channel_packages
+ # Compute the unique packages and populate self._channel_packages
self._compute_unique_packages()
h = sync_handlers.get_short_package_handler()
@@ -921,7 +904,7 @@ Please contact your RHN representative""" %
(generation, sat_cert.generation))
missing_channel_packages = {}
missing_fs_packages = {}
- for channel_label, upids in self._uq_channel_packages.items():
+ for channel_label, upids in self._channel_packages.items():
log(1, "Diffing package metadata (what's missing locally?): %s"
%
channel_label)
m_channel_packages = missing_channel_packages[channel_label] = []
commit 557446234d37a16a25c4020fa2bc732f9590e093
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 13:25:51 2010 +0200
Setting server.nls_lang once, later in this file, should be enough.
diff --git a/web/conf/rhn_web.conf b/web/conf/rhn_web.conf
index 6e63fea..4e94b63 100644
--- a/web/conf/rhn_web.conf
+++ b/web/conf/rhn_web.conf
@@ -10,8 +10,6 @@ web.base_acls = RHN::Access
web.base_domain =
web.base_port =
-server.nls_lang=english.utf8
-
# Limit the size of POST data (in bytes)
web.post_max = 512000
commit 577d64981ff98f2de6cddff9d7377890756d1e3e
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue May 4 13:23:19 2010 +0200
code cleanup - this configuration files are not used in proxy
diff --git a/web/conf/proxy/httpd.conf b/web/conf/proxy/httpd.conf
deleted file mode 100644
index 63c7843..0000000
--- a/web/conf/proxy/httpd.conf
+++ /dev/null
@@ -1,1201 +0,0 @@
-##
-## httpd.conf -- Apache HTTP server configuration file
-##
-
-#
-# Based upon the NCSA server configuration files originally by Rob McCool.
-#
-# This is the main Apache server configuration file. It contains the
-# configuration directives that give the server its instructions.
-# See <
URL:http://www.apache.org/docs/> for detailed information about
-# the directives.
-#
-# Do NOT simply read the instructions in here without understanding
-# what they do. They're here only as hints or reminders. If you are unsure
-# consult the online docs. You have been warned.
-#
-# After this file is processed, the server will look for and process
-# /usr/conf/srm.conf and then /usr/conf/access.conf
-# unless you have overridden these with ResourceConfig and/or
-# AccessConfig directives here.
-#
-# The configuration directives are grouped into three basic sections:
-# 1. Directives that control the operation of the Apache server process as a
-# whole (the 'global environment').
-# 2. Directives that define the parameters of the 'main' or 'default'
server,
-# which responds to requests that aren't handled by a virtual host.
-# These directives also provide default values for the settings
-# of all virtual hosts.
-# 3. Settings for virtual hosts, which allow Web requests to be sent to
-# different IP addresses or hostnames and have them handled by the
-# same Apache server process.
-#
-# Configuration and logfile names: If the filenames you specify for many
-# of the server's control files begin with "/" (or "drive:/" for
Win32), the
-# server will use that explicit path. If the filenames do *not* begin
-# with "/", the value of ServerRoot is prepended -- so
"logs/foo.log"
-# with ServerRoot set to "/usr/local/apache" will be interpreted by the
-# server as "/usr/local/apache/logs/foo.log".
-#
-
-### Section 1: Global Environment
-#
-# The directives in this section affect the overall operation of Apache,
-# such as the number of concurrent requests it can handle or where it
-# can find its configuration files.
-#
-
-#
-# ServerType is either inetd, or standalone. Inetd mode is only supported on
-# Unix platforms.
-#
-ServerType standalone
-
-#
-# ServerRoot: The top of the directory tree under which the server's
-# configuration, error, and log files are kept.
-#
-# NOTE! If you intend to place this on an NFS (or otherwise network)
-# mounted filesystem then please read the LockFile documentation
-# (available at <
URL:http://www.apache.org/docs/mod/core.html#lockfile>);
-# you will save yourself a lot of trouble.
-#
-# Do NOT add a slash at the end of the directory path.
-#
-ServerRoot "/etc/httpd"
-
-#
-# The LockFile directive sets the path to the lockfile used when Apache
-# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or
-# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at
-# its default value. The main reason for changing it is if the logs
-# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL
-# DISK. The PID of the main server process is automatically appended to
-# the filename.
-#
-LockFile /var/lock/httpd.lock
-
-#
-# PidFile: The file in which the server should record its process
-# identification number when it starts.
-#
-PidFile /var/run/httpd.pid
-
-#
-# ScoreBoardFile: File used to store internal server process information.
-# Not all architectures require this. But if yours does (you'll know because
-# this file will be created when you run Apache) then you *must* ensure that
-# no two invocations of Apache share the same scoreboard file.
-#
-ScoreBoardFile /var/run/httpd.scoreboard
-
-#
-# In the standard configuration, the server will process this file,
-# srm.conf, and access.conf in that order. The latter two files are
-# now distributed empty, as it is recommended that all directives
-# be kept in a single file for simplicity. The commented-out values
-# below are the built-in defaults. You can have the server ignore
-# these files altogether by using "/dev/null" (for Unix) or
-# "nul" (for Win32) for the arguments to the directives.
-#
-#ResourceConfig conf/srm.conf
-#AccessConfig conf/access.conf
-
-#
-# Timeout: The number of seconds before receives and sends time out.
-#
-Timeout 300
-
-#
-# KeepAlive: Whether or not to allow persistent connections (more than
-# one request per connection). Set to "Off" to deactivate.
-#
-KeepAlive On
-
-#
-# MaxKeepAliveRequests: The maximum number of requests to allow
-# during a persistent connection. Set to 0 to allow an unlimited amount.
-# We recommend you leave this number high, for maximum performance.
-#
-MaxKeepAliveRequests 100
-
-#
-# KeepAliveTimeout: Number of seconds to wait for the next request from the
-# same client on the same connection.
-#
-KeepAliveTimeout 15
-
-#
-# Server-pool size regulation. Rather than making you guess how many
-# server processes you need, Apache dynamically adapts to the load it
-# sees --- that is, it tries to maintain enough server processes to
-# handle the current load, plus a few spare servers to handle transient
-# load spikes (e.g., multiple simultaneous requests from a single
-# Netscape browser).
-#
-# It does this by periodically checking how many servers are waiting
-# for a request. If there are fewer than MinSpareServers, it creates
-# a new spare. If there are more than MaxSpareServers, some of the
-# spares die off. The default values are probably OK for most sites.
-#
-MinSpareServers 3
-MaxSpareServers 5
-
-#
-# Number of servers to start initially --- should be a reasonable ballpark
-# figure.
-#
-StartServers 8
-
-#
-# Limit on total number of servers running, i.e., limit on the number
-# of clients who can simultaneously connect --- if this limit is ever
-# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
-# It is intended mainly as a brake to keep a runaway server from taking
-# the system with it as it spirals down...
-#
-MaxClients 40
-
-#
-# MaxRequestsPerChild: the number of requests each child process is
-# allowed to process before the child dies. The child will exit so
-# as to avoid problems after prolonged use when Apache (and maybe the
-# libraries it uses) leak memory or other resources. On most systems, this
-# isn't really needed, but a few (such as Solaris) do have notable leaks
-# in the libraries. For these platforms, set to something like 10000
-# or so; a setting of 0 means unlimited.
-#
-# NOTE: This value does not include keepalive requests after the initial
-# request per connection. For example, if a child process handles
-# an initial request and 10 subsequent "keptalive" requests, it
-# would only count as 1 request towards this limit.
-#
-MaxRequestsPerChild 10000
-
-#
-# Listen: Allows you to bind Apache to specific IP addresses and/or
-# ports, in addition to the default. See also the <VirtualHost>
-# directive.
-#
-#Listen 3000
-#Listen 12.34.56.78:80
-Listen 80
-
-#
-# BindAddress: You can support virtual hosts with this option. This directive
-# is used to tell the server which IP address to listen to. It can either
-# contain "*", an IP address, or a fully qualified Internet domain name.
-# See also the <VirtualHost> and Listen directives.
-#
-#BindAddress *
-
-#
-# Dynamic Shared Object (DSO) Support
-#
-# To be able to use the functionality of a module which was built as a DSO you
-# have to place corresponding `LoadModule' lines at this location so the
-# directives contained in it are actually available _before_ they are used.
-# Please read the file README.DSO in the Apache 1.3 distribution for more
-# details about the DSO mechanism and run `httpd -l' for the list of already
-# built-in (statically linked and thus always available) modules in your httpd
-# binary.
-#
-# Note: The order is which modules are loaded is important. Don't change
-# the order below without expert advice.
-#
-# Example:
-# LoadModule foo_module modules/mod_foo.so
-
-#LoadModule mmap_static_module modules/mod_mmap_static.so
-LoadModule vhost_alias_module modules/mod_vhost_alias.so
-LoadModule env_module modules/mod_env.so
-LoadModule config_log_module modules/mod_log_config.so
-LoadModule agent_log_module modules/mod_log_agent.so
-LoadModule referer_log_module modules/mod_log_referer.so
-#LoadModule mime_magic_module modules/mod_mime_magic.so
-LoadModule mime_module modules/mod_mime.so
-LoadModule negotiation_module modules/mod_negotiation.so
-LoadModule status_module modules/mod_status.so
-LoadModule info_module modules/mod_info.so
-LoadModule includes_module modules/mod_include.so
-LoadModule autoindex_module modules/mod_autoindex.so
-LoadModule dir_module modules/mod_dir.so
-LoadModule cgi_module modules/mod_cgi.so
-LoadModule asis_module modules/mod_asis.so
-LoadModule imap_module modules/mod_imap.so
-LoadModule action_module modules/mod_actions.so
-#LoadModule speling_module modules/mod_speling.so
-LoadModule userdir_module modules/mod_userdir.so
-LoadModule alias_module modules/mod_alias.so
-#LoadModule rewrite_module modules/mod_rewrite.so
-LoadModule access_module modules/mod_access.so
-LoadModule auth_module modules/mod_auth.so
-LoadModule anon_auth_module modules/mod_auth_anon.so
-#LoadModule db_auth_module modules/mod_auth_db.so
-#LoadModule dbm_auth_module modules/mod_auth_dbm.so
-#LoadModule auth_ldap_module modules/mod_auth_ldap.so
-#LoadModule digest_module modules/mod_digest.so
-#LoadModule proxy_module modules/libproxy.so
-#LoadModule cern_meta_module modules/mod_cern_meta.so
-LoadModule expires_module modules/mod_expires.so
-LoadModule headers_module modules/mod_headers.so
-#LoadModule usertrack_module modules/mod_usertrack.so
-#LoadModule example_module modules/mod_example.so
-#LoadModule unique_id_module modules/mod_unique_id.so
-LoadModule setenvif_module modules/mod_setenvif.so
-#LoadModule bandwidth_module modules/mod_bandwidth.so
-#LoadModule put_module modules/mod_put.so
-#LoadModule throttle_module modules/mod_throttle.so
-#LoadModule define_module modules/mod_define.so
-<IfDefine HAVE_PERL>
-LoadModule perl_module modules/libperl.so
-</IfDefine>
-<IfDefine HAVE_PHP>
-LoadModule php_module modules/mod_php.so
-</IfDefine>
-<IfDefine HAVE_PHP3>
-LoadModule php3_module modules/libphp3.so
-</IfDefine>
-<IfDefine HAVE_PHP4>
-LoadModule php4_module modules/libphp4.so
-</IfDefine>
-<IfDefine HAVE_DAV>
-LoadModule dav_module modules/libdav.so
-</IfDefine>
-<IfDefine HAVE_ROAMING>
-LoadModule roaming_module modules/mod_roaming.so
-</IfDefine>
-<IfDefine HAVE_SSL>
-LoadModule ssl_module modules/libssl.so
-</IfDefine>
-
-# Reconstruction of the complete module list from all available modules
-# (static and shared ones) to achieve correct module execution order.
-# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
-ClearModuleList
-#AddModule mod_mmap_static.c
-AddModule mod_vhost_alias.c
-AddModule mod_env.c
-AddModule mod_log_config.c
-AddModule mod_log_agent.c
-AddModule mod_log_referer.c
-#AddModule mod_mime_magic.c
-AddModule mod_mime.c
-AddModule mod_negotiation.c
-AddModule mod_status.c
-AddModule mod_info.c
-AddModule mod_include.c
-AddModule mod_autoindex.c
-AddModule mod_dir.c
-AddModule mod_cgi.c
-AddModule mod_asis.c
-AddModule mod_imap.c
-AddModule mod_actions.c
-#AddModule mod_speling.c
-AddModule mod_userdir.c
-AddModule mod_alias.c
-#AddModule mod_rewrite.c
-AddModule mod_access.c
-AddModule mod_auth.c
-AddModule mod_auth_anon.c
-#AddModule mod_auth_db.c
-#AddModule mod_digest.c
-#AddModule mod_proxy.c
-#AddModule mod_cern_meta.c
-AddModule mod_expires.c
-AddModule mod_headers.c
-#AddModule mod_usertrack.c
-#AddModule mod_example.c
-#AddModule mod_unique_id.c
-AddModule mod_so.c
-AddModule mod_setenvif.c
-#AddModule mod_bandwidth.c
-#AddModule mod_put.c
-<IfDefine HAVE_PERL>
-AddModule mod_perl.c
-</IfDefine>
-<IfDefine HAVE_PHP>
-AddModule mod_php.c
-</IfDefine>
-<IfDefine HAVE_PHP3>
-AddModule mod_php3.c
-</IfDefine>
-<IfDefine HAVE_PHP4>
-AddModule mod_php4.c
-</IfDefine>
-<IfDefine HAVE_DAV>
-AddModule mod_dav.c
-</IfDefine>
-<IfDefine HAVE_ROAMING>
-AddModule mod_roaming.c
-</IfDefine>
-<IfDefine HAVE_SSL>
-AddModule mod_ssl.c
-</IfDefine>
-
-#
-# ExtendedStatus: controls whether Apache will generate "full" status
-# information (ExtendedStatus On) or just basic information (ExtendedStatus
-# Off) when the "server-status" handler is called. The default is Off.
-#
-#ExtendedStatus On
-
-### Section 2: 'Main' server configuration
-#
-# The directives in this section set up the values used by the 'main'
-# server, which responds to any requests that aren't handled by a
-# <VirtualHost> definition. These values also provide defaults for
-# any <VirtualHost> containers you may define later in the file.
-#
-# All of these directives may appear inside <VirtualHost> containers,
-# in which case these default settings will be overridden for the
-# virtual host being defined.
-#
-
-#
-# If your ServerType directive (set earlier in the 'Global Environment'
-# section) is set to "inetd", the next few directives don't have any
-# effect since their settings are defined by the inetd configuration.
-# Skip ahead to the ServerAdmin directive.
-#
-
-#
-# Port: The port to which the standalone server listens. For
-# ports < 1023, you will need httpd to be run as root initially.
-#
-Port 80
-
-#
-# If you wish httpd to run as a different user or group, you must run
-# httpd as root initially and it will switch.
-#
-# User/Group: The name (or #number) of the user/group to run httpd as.
-# . On SCO (ODT 3) use "User nouser" and "Group nogroup".
-# . On HPUX you may not be able to use shared memory as nobody, and the
-# suggested workaround is to create a user www and use that user.
-# NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
-# when the value of (unsigned)Group is above 60000;
-# don't use Group nobody on these systems!
-#
-User apache
-Group apache
-
-#
-# ServerAdmin: Your address, where problems with the server should be
-# e-mailed. This address appears on some server-generated pages, such
-# as error documents.
-#
-ServerAdmin rhn-feedback(a)redhat.com
-
-#
-# ServerName: allows you to set a host name which is sent back to clients for
-# your server if it's different than the one the program would get (i.e., use
-# "www" instead of the host's real name).
-#
-# Note: You cannot just invent host names and hope they work. The name you
-# define here must be a valid DNS name for your host. If you don't understand
-# this, ask your network administrator.
-# If your host doesn't have a registered DNS name, enter its IP address here.
-# You will have to access it by its address (e.g.,
http://123.45.67.89/)
-# anyway, and this will make redirections work in a sensible way.
-#
-ServerName
www.devel.rhns.redhat.com
-
-#
-# DocumentRoot: The directory out of which you will serve your
-# documents. By default, all requests are taken from this directory, but
-# symbolic links and aliases may be used to point to other locations.
-#
-DocumentRoot "/var/www/html"
-
-#
-# Each directory to which Apache has access, can be configured with respect
-# to which services and features are allowed and/or disabled in that
-# directory (and its subdirectories).
-#
-# First, we configure the "default" to be a very restrictive set of
-# permissions.
-#
-<Directory />
- Options FollowSymLinks
- AllowOverride None
-</Directory>
-
-#
-# Note that from this point forward you must specifically allow
-# particular features to be enabled - so if something's not working as
-# you might expect, make sure that you have specifically enabled it
-# below.
-#
-
-#
-# This should be changed to whatever you set DocumentRoot to.
-#
-<Directory "/var/www/html">
-
-#
-# This may also be "None", "All", or any combination of
"Indexes",
-# "Includes", "FollowSymLinks", "ExecCGI", or
"MultiViews".
-#
-# Note that "MultiViews" must be named *explicitly* --- "Options
All"
-# doesn't give it to you.
-#
- Options Indexes Includes FollowSymLinks
-
-#
-# This controls which options the .htaccess files in directories can
-# override. Can also be "All", or any combination of "Options",
"FileInfo",
-# "AuthConfig", and "Limit"
-#
- AllowOverride None
-
-#
-# Controls who can get stuff from this server.
-#
- Order allow,deny
- Allow from all
-</Directory>
-
-#
-# UserDir: The name of the directory which is appended onto a user's home
-# directory if a ~user request is received.
-#
-# The path to the end user account 'public_html' directory must be
-# accessible to the webserver userid. This usually means that ~userid
-# must have permissions of 711, ~userid/public_html must have permissions
-# of 755, and documents contained therein must be world-readable.
-# Otherwise, the client will only receive a "403 Forbidden" message.
-#
-# See also:
http://httpd.apache.org/docs/misc/FAQ.html#forbidden
-#
-UserDir public_html
-
-#
-# Control access to UserDir directories. The following is an example
-# for a site where these directories are restricted to read-only.
-#
-#<Directory /home/*/public_html>
-# AllowOverride FileInfo AuthConfig Limit
-# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
-# <Limit GET POST OPTIONS PROPFIND>
-# Order allow,deny
-# Allow from all
-# </Limit>
-# <Limit PUT DELETE PATCH PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
-# Order deny,allow
-# Deny from all
-# </Limit>
-#</Directory>
-
-#
-# DirectoryIndex: Name of the file or files to use as a pre-written HTML
-# directory index. Separate multiple entries with spaces.
-#
-DirectoryIndex index.html index.htm index.shtml index.php index.php4 index.php3
index.cgi
-
-#
-# AccessFileName: The name of the file to look for in each directory
-# for access control information.
-#
-AccessFileName .htaccess
-
-#
-# The following lines prevent .htaccess files from being viewed by
-# Web clients. Since .htaccess files often contain authorization
-# information, access is disallowed for security reasons. Comment
-# these lines out if you want Web visitors to see the contents of
-# .htaccess files. If you change the AccessFileName directive above,
-# be sure to make the corresponding changes here.
-#
-# Also, folks tend to use names such as .htpasswd for password
-# files, so this will protect those as well.
-#
-<Files ~ "^\.ht">
- Order allow,deny
- Deny from all
-</Files>
-
-#
-# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each
-# document that was negotiated on the basis of content. This asks proxy
-# servers not to cache the document. Uncommenting the following line disables
-# this behavior, and proxies will be allowed to cache the documents.
-#
-#CacheNegotiatedDocs
-
-#
-# UseCanonicalName: (new for 1.3) With this setting turned on, whenever
-# Apache needs to construct a self-referencing URL (a URL that refers back
-# to the server the response is coming from) it will use ServerName and
-# Port to form a "canonical" name. With this setting off, Apache will
-# use the hostname:port that the client supplied, when possible. This
-# also affects SERVER_NAME and SERVER_PORT in CGI scripts.
-#
-UseCanonicalName On
-
-#
-# TypesConfig describes where the mime.types file (or equivalent) is
-# to be found.
-#
-TypesConfig /etc/mime.types
-
-#
-# DefaultType is the default MIME type the server will use for a document
-# if it cannot otherwise determine one, such as from filename extensions.
-# If your server contains mostly text or HTML documents, "text/plain" is
-# a good value. If most of your content is binary, such as applications
-# or images, you may want to use "application/octet-stream" instead to
-# keep browsers from trying to display binary files as though they are
-# text.
-#
-DefaultType text/plain
-
-#
-# The mod_mime_magic module allows the server to use various hints from the
-# contents of the file itself to determine its type. The MIMEMagicFile
-# directive tells the module where the hint definitions are located.
-# mod_mime_magic is not part of the default server (you have to add
-# it yourself with a LoadModule [see the DSO paragraph in the 'Global
-# Environment' section], or recompile the server and include mod_mime_magic
-# as part of the configuration), so it's enclosed in an <IfModule> container.
-# This means that the MIMEMagicFile directive will only be processed if the
-# module is part of the server.
-#
-<IfModule mod_mime_magic.c>
- MIMEMagicFile conf/magic
-</IfModule>
-
-#
-# HostnameLookups: Log the names of clients or just their IP addresses
-# e.g.,
www.apache.org (on) or 204.62.129.132 (off).
-# The default is off because it'd be overall better for the net if people
-# had to knowingly turn this feature on, since enabling it means that
-# each client request will result in AT LEAST one lookup request to the
-# nameserver.
-#
-HostnameLookups Off
-
-#
-# ErrorLog: The location of the error log file.
-# If you do not specify an ErrorLog directive within a <VirtualHost>
-# container, error messages relating to that virtual host will be
-# logged here. If you *do* define an error logfile for a <VirtualHost>
-# container, that host's errors will be logged there and not here.
-#
-ErrorLog /var/log/httpd/error_log
-
-#
-# LogLevel: Control the number of messages logged to the error_log.
-# Possible values include: debug, info, notice, warn, error, crit,
-# alert, emerg.
-#
-LogLevel warn
-
-#
-# The following directives define some format nicknames for use with
-# a CustomLog directive (see below).
-#
-LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
-LogFormat "%h %l %u %t \"%r\" %>s %b" common
-LogFormat "%{Referer}i -> %U" referer
-LogFormat "%{User-agent}i" agent
-
-#
-# The location and format of the access logfile (Common Logfile Format).
-# If you do not define any access logfiles within a <VirtualHost>
-# container, they will be logged here. Contrariwise, if you *do*
-# define per-<VirtualHost> access logfiles, transactions will be
-# logged therein and *not* in this file.
-#
-# CustomLog /var/log/httpd/access_log common
-CustomLog /var/log/httpd/access_log combined
-
-#
-# If you would like to have agent and referer logfiles, uncomment the
-# following directives.
-#
-#CustomLog /var/log/httpd/referer_log referer
-#CustomLog /var/log/httpd/agent_log agent
-
-#
-# If you prefer a single logfile with access, agent, and referer information
-# (Combined Logfile Format) you can use the following directive.
-#
-#CustomLog /var/log/httpd/access_log combined
-
-#
-# Optionally add a line containing the server version and virtual host
-# name to server-generated pages (error documents, FTP directory listings,
-# mod_status and mod_info output etc., but not CGI generated documents).
-# Set to "EMail" to also include a mailto: link to the ServerAdmin.
-# Set to one of: On | Off | EMail
-#
-ServerSignature On
-
-#
-# Aliases: Add here as many aliases as you need (with no limit). The format is
-# Alias fakename realname
-#
-# Note that if you include a trailing / on fakename then the server will
-# require it to be present in the URL. So "/icons" isn't aliased in this
-# example, only "/icons/"..
-#
-Alias /icons/ "/var/www/icons/"
-
-<Directory "/var/www/icons">
- Options Indexes MultiViews
- AllowOverride None
- Order allow,deny
- Allow from all
-</Directory>
-
-#
-# ScriptAlias: This controls which directories contain server scripts.
-# ScriptAliases are essentially the same as Aliases, except that
-# documents in the realname directory are treated as applications and
-# run by the server when requested rather than as documents sent to the client.
-# The same rules about trailing "/" apply to ScriptAlias directives as to
-# Alias.
-#
-ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
-
-#
-# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
-# CGI directory exists, if you have that configured.
-#
-<Directory "/var/www/cgi-bin">
- AllowOverride None
- Options ExecCGI
- Order allow,deny
- Allow from all
-</Directory>
-
-#
-# Redirect allows you to tell clients about documents which used to exist in
-# your server's namespace, but do not anymore. This allows you to tell the
-# clients where to look for the relocated document.
-# Format: Redirect old-URI new-URL
-#
-
-#
-# Directives controlling the display of server-generated directory listings.
-#
-
-#
-# FancyIndexing: whether you want fancy directory indexing or standard
-#
-IndexOptions FancyIndexing NameWidth=*
-
-#
-# AddIcon* directives tell the server which icon to show for different
-# files or filename extensions. These are only displayed for
-# FancyIndexed directories.
-#
-AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
-
-AddIconByType (TXT,/icons/text.gif) text/*
-AddIconByType (IMG,/icons/image2.gif) image/*
-AddIconByType (SND,/icons/sound2.gif) audio/*
-AddIconByType (VID,/icons/movie.gif) video/*
-
-AddIcon /icons/binary.gif .bin .exe
-AddIcon /icons/binhex.gif .hqx
-AddIcon /icons/tar.gif .tar
-AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
-AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
-AddIcon /icons/a.gif .ps .ai .eps
-AddIcon /icons/layout.gif .html .shtml .htm .pdf
-AddIcon /icons/text.gif .txt
-AddIcon /icons/c.gif .c
-AddIcon /icons/p.gif .pl .py
-AddIcon /icons/f.gif .for
-AddIcon /icons/dvi.gif .dvi
-AddIcon /icons/uuencoded.gif .uu
-AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
-AddIcon /icons/tex.gif .tex
-AddIcon /icons/bomb.gif core
-
-AddIcon /icons/back.gif ..
-AddIcon /icons/hand.right.gif README
-AddIcon /icons/folder.gif ^^DIRECTORY^^
-AddIcon /icons/blank.gif ^^BLANKICON^^
-
-#
-# DefaultIcon: which icon to show for files which do not have an icon
-# explicitly set.
-#
-DefaultIcon /icons/unknown.gif
-
-#
-# AddDescription: allows you to place a short description after a file in
-# server-generated indexes. These are only displayed for FancyIndexed
-# directories.
-# Format: AddDescription "description" filename
-#
-#AddDescription "GZIP compressed document" .gz
-#AddDescription "tar archive" .tar
-#AddDescription "GZIP compressed tar archive" .tgz
-
-#
-# ReadmeName: the name of the README file the server will look for by
-# default, and append to directory listings.
-#
-# HeaderName: the name of a file which should be prepended to
-# directory indexes.
-#
-# The server will first look for name.html and include it if found.
-# If name.html doesn't exist, the server will then look for name.txt
-# and include it as plaintext if found.
-#
-ReadmeName README.html
-HeaderName HEADER.html
-
-#
-# IndexIgnore: a set of filenames which directory indexing should ignore
-# and not include in the listing. Shell-style wildcarding is permitted.
-#
-IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
-
-#
-# AddEncoding: allows you to have certain browsers (Mosaic/X 2.1+) uncompress
-# information on the fly. Note: Not all browsers support this.
-# Despite the name similarity, the following Add* directives have nothing
-# to do with the FancyIndexing customization directives above.
-#
-AddEncoding x-compress Z
-AddEncoding x-gzip gz tgz
-
-#
-# AddLanguage: allows you to specify the language of a document. You can
-# then use content negotiation to give a browser a file in a language
-# it can understand. Note that the suffix does not have to be the same
-# as the language keyword --- those with documents in Polish (whose
-# net-standard language code is pl) may wish to use "AddLanguage pl .po"
-# to avoid the ambiguity with the common suffix for perl scripts.
-#
-AddLanguage en .en
-AddLanguage fr .fr
-AddLanguage de .de
-AddLanguage da .da
-AddLanguage el .el
-AddLanguage it .it
-
-#
-# LanguagePriority: allows you to give precedence to some languages
-# in case of a tie during content negotiation.
-# Just list the languages in decreasing order of preference.
-#
-LanguagePriority en fr de
-
-#
-# AddType: allows you to tweak mime.types without actually editing it, or to
-# make certain files to be certain types.
-#
-# The following is for PHP4 (conficts with PHP/FI, below):
-<IfModule mod_php4.c>
- AddType application/x-httpd-php .php4 .php3 .phtml .php
- AddType application/x-httpd-php-source .phps
-</IfModule>
-
-# The following is for PHP3:
-<IfModule mod_php3.c>
- AddType application/x-httpd-php3 .php3
- AddType application/x-httpd-php3-source .phps
-</IfModule>
-
-# The following is for PHP/FI (PHP2):
-<IfModule mod_php.c>
- AddType application/x-httpd-php .phtml
-</IfModule>
-
-AddType application/x-tar .tgz
-
-#
-# AddHandler: allows you to map certain file extensions to "handlers",
-# actions unrelated to filetype. These can be either built into the server
-# or added with the Action command (see below)
-#
-# If you want to use server side includes, or CGI outside
-# ScriptAliased directories, uncomment the following lines.
-#
-# To use CGI scripts:
-#
-#AddHandler cgi-script .cgi
-
-#
-# To use server-parsed HTML files
-#
-AddType text/html .shtml
-AddHandler server-parsed .shtml
-
-#
-# Uncomment the following line to enable Apache's send-asis HTTP file
-# feature
-#
-#AddHandler send-as-is asis
-
-#
-# If you wish to use server-parsed imagemap files, use
-#
-AddHandler imap-file map
-
-#
-# To enable type maps, you might want to use
-#
-#AddHandler type-map var
-
-#
-# Action: lets you define media types that will execute a script whenever
-# a matching file is called. This eliminates the need for repeated URL
-# pathnames for oft-used CGI file processors.
-# Format: Action media/type /cgi-script/location
-# Format: Action handler-name /cgi-script/location
-#
-
-#
-# MetaDir: specifies the name of the directory in which Apache can find
-# meta information files. These files contain additional HTTP headers
-# to include when sending the document
-#
-#MetaDir .web
-
-#
-# MetaSuffix: specifies the file name suffix for the file containing the
-# meta information.
-#
-#MetaSuffix .meta
-
-#
-# Customizable error response (Apache style)
-# these come in three flavors
-#
-# 1) plain text
-#ErrorDocument 500 "The server made a boo boo.
-# n.b. the (") marks it as text, it does not get output
-#
-# 2) local redirects
-#ErrorDocument 404 /missing.html
-# to redirect to local URL /missing.html
-#ErrorDocument 404 /cgi-bin/missing_handler.pl
-# N.B.: You can redirect to a script or a document using server-side-includes.
-#
-# 3) external redirects
-#ErrorDocument 402
http://some.other_server.com/subscription_info.html
-# N.B.: Many of the environment variables associated with the original
-# request will *not* be available to such a script.
-
-#
-# The following directives modify normal HTTP response behavior.
-# The first directive disables keepalive for Netscape 2.x and browsers that
-# spoof it. There are known problems with these browser implementations.
-# The second directive is for Microsoft Internet Explorer 4.0b2
-# which has a broken HTTP/1.1 implementation and does not properly
-# support keepalive when it is used on 301 or 302 (redirect) responses.
-#
-BrowserMatch "Mozilla/2" nokeepalive
-BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
-
-#
-# The following directive disables HTTP/1.1 responses to browsers which
-# are in violation of the HTTP/1.0 spec by not being able to grok a
-# basic 1.1 response.
-#
-BrowserMatch "RealPlayer 4\.0" force-response-1.0
-BrowserMatch "Java/1\.0" force-response-1.0
-BrowserMatch "JDK/1\.0" force-response-1.0
-
-
-# If the perl module is installed, this will be enabled.
-<IfModule mod_perl.c>
- Alias /perl/ /var/www/perl/
- <Location /perl>
- SetHandler perl-script
- PerlHandler Apache::Registry
- Options +ExecCGI
- </Location>
-</IfModule>
-
-#
-# Allow http put (such as Netscape Gold's publish feature)
-# Use htpasswd to generate /etc/httpd/conf/passwd.
-# You must unremark these two lines at the top of this file as well:
-#LoadModule put_module modules/mod_put.so
-#AddModule mod_put.c
-#
-#Alias /upload /tmp
-#<Location /upload>
-# EnablePut On
-# AuthType Basic
-# AuthName Temporary
-# AuthUserFile /etc/httpd/conf/passwd
-# EnableDelete Off
-# umask 007
-# <Limit PUT>
-# require valid-user
-# </Limit>
-#</Location>
-
-#
-# Allow server status reports, with the URL of
http://servername/server-status
-# Change the ".your_domain.com" to match your domain to enable.
-#
-#<Location /server-status>
-# SetHandler server-status
-# Order deny,allow
-# Deny from all
-# Allow from .your_domain.com
-#</Location>
-
-#
-# Allow remote server configuration reports, with the URL of
-#
http://servername/server-info (requires that mod_info.c be loaded).
-# Change the ".your_domain.com" to match your domain to enable.
-#
-#<Location /server-info>
-# SetHandler server-info
-# Order deny,allow
-# Deny from all
-# Allow from .your_domain.com
-#</Location>
-
-# Allow access to local system documentation from localhost
-Alias /doc/ /usr/share/doc/
-<Location /doc>
- order deny,allow
- deny from all
- allow from localhost .localdomain
- Options Indexes FollowSymLinks
-</Location>
-
-#
-# There have been reports of people trying to abuse an old bug from pre-1.1
-# days. This bug involved a CGI script distributed as a part of Apache.
-# By uncommenting these lines you can redirect these attacks to a logging
-# script on
phf.apache.org. Or, you can record them yourself, using the script
-# support/phf_abuse_log.cgi.
-#
-#<Location /cgi-bin/phf*>
-# Deny from all
-# ErrorDocument 403
http://phf.apache.org/phf_abuse_log.cgi
-#</Location>
-
-#
-# Proxy Server directives. Uncomment the following lines to
-# enable the proxy server:
-#
-#<IfModule mod_proxy.c>
-#ProxyRequests On
-#
-#<Directory proxy:*>
-# Order deny,allow
-# Deny from all
-# Allow from .your_domain.com
-#</Directory>
-
-#
-# Enable/disable the handling of HTTP/1.1 "Via:" headers.
-# ("Full" adds the server version; "Block" removes all outgoing Via:
headers)
-# Set to one of: Off | On | Full | Block
-#
-#ProxyVia On
-
-#
-# To enable the cache as well, edit and uncomment the following lines:
-# (no cacheing without CacheRoot)
-#
-#CacheRoot "/var/cache/httpd"
-#CacheSize 5
-#CacheGcInterval 4
-#CacheMaxExpire 24
-#CacheLastModifiedFactor 0.1
-#CacheDefaultExpire 1
-#NoCache
a_domain.com another_domain.edu joes.garage_sale.com
-
-#</IfModule>
-# End of proxy directives.
-
-### Section 3: Virtual Hosts
-#
-# VirtualHost: If you want to maintain multiple domains/hostnames on your
-# machine you can setup VirtualHost containers for them.
-# Please see the documentation at <
URL:http://www.apache.org/docs/vhosts/>
-# for further details before you try to setup virtual hosts.
-# You may use the command line option '-S' to verify your virtual host
-# configuration.
-
-#
-# If you want to use name-based virtual hosts you need to define at
-# least one IP address (and port number) for them.
-#
-#NameVirtualHost 12.34.56.78:80
-#NameVirtualHost 12.34.56.78
-
-#
-# VirtualHost example:
-# Almost any Apache directive may go into a VirtualHost container.
-#
-#<VirtualHost ip.address.of.host.some_domain.com>
-# ServerAdmin webmaster(a)host.some_domain.com
-# DocumentRoot /www/docs/host.some_domain.com
-# ServerName
host.some_domain.com
-# ErrorLog logs/host.some_domain.com-error_log
-# CustomLog logs/host.some_domain.com-access_log common
-#</VirtualHost>
-
-#<VirtualHost _default_:*>
-#</VirtualHost>
-
-<IfDefine HAVE_SSL>
-##
-## SSL Virtual Host Context
-##
-
-# Apache will only listen on port 80 by default. Defining the virtual server
-# (below) won't make it automatically listen on the virtual server's port.
-Listen 443
-
-# SSL Session Cache:
-# The cache speeds up processing of multiple parallel requests from
-# the same client.
-SSLSessionCache shm:/var/cache/ssl_gcache_data(524288)
-
-<VirtualHost _default_:443>
-
-# General setup for the virtual host
-DocumentRoot "/var/www/html"
-
-# SSL Engine Switch:
-# Enable/Disable SSL for this virtual host.
-SSLEngine on
-
-# SSL Cipher Suite:
-# List the ciphers that the client is permitted to negotiate.
-# See the mod_ssl documentation for a complete list.
-#SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
-
-# Server Certificate:
-# Point SSLCertificateFile at a PEM encoded certificate. If
-# the certificate is encrypted, then you will be prompted for a
-# pass phrase. Note that a kill -HUP will prompt again. A test
-# certificate can be generated with `make certificate' under
-# built time. Keep in mind that if you've both a RSA and a DSA
-# certificate you can configure both in parallel (to also allow
-# the use of DSA ciphers, etc.)
-SSLCertificateFile /etc/httpd/conf/cert-beta.rhns
-#SSLCertificateFile /etc/httpd/conf/ssl.crt/server-dsa.crt
-
-# Server Private Key:
-# If the key is not combined with the certificate, use this
-# directive to point at the key file. Keep in mind that if
-# you've both a RSA and a DSA private key you can configure
-# both in parallel (to also allow the use of DSA ciphers, etc.)
-SSLCertificateKeyFile /etc/httpd/conf/cert-beta.rhns
-#SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server-dsa.key
-
-# Server Certificate Chain:
-# Point SSLCertificateChainFile at a file containing the
-# concatenation of PEM encoded CA certificates which form the
-# certificate chain for the server certificate. Alternatively
-# the referenced file can be the same as SSLCertificateFile
-# when the CA certificates are directly appended to the server
-# certificate for convinience.
-#SSLCertificateChainFile /etc/httpd/conf/ssl.crt/ca.crt
-
-# Certificate Authority (CA):
-# Set the CA certificate verification path where to find CA
-# certificates for client authentication or alternatively one
-# huge file containing all of them (file must be PEM encoded)
-# Note: Inside SSLCACertificatePath you need hash symlinks
-# to point to the certificate files. Use the provided
-# Makefile to update the hash symlinks after changes.
-#SSLCACertificatePath /etc/httpd/conf/ssl.crt
-#SSLCACertificateFile /etc/httpd/conf/ssl.crt/ca-bundle.crt
-
-# Certificate Revocation Lists (CRL):
-# Set the CA revocation path where to find CA CRLs for client
-# authentication or alternatively one huge file containing all
-# of them (file must be PEM encoded)
-# Note: Inside SSLCARevocationPath you need hash symlinks
-# to point to the certificate files. Use the provided
-# Makefile to update the hash symlinks after changes.
-#SSLCARevocationPath /etc/httpd/conf/ssl.crl
-#SSLCARevocationFile /etc/httpd/conf/ssl.crl/ca-bundle.crl
-# Client Authentication (Type):
-# Client certificate verification type and depth. Types are
-# none, optional, require and optional_no_ca. Depth is a
-# number which specifies how deeply to verify the certificate
-# issuer chain before deciding the certificate is not valid.
-#SSLVerifyClient require
-#SSLVerifyDepth 10
-
-# Access Control:
-# With SSLRequire you can do per-directory access control based
-# on arbitrary complex boolean expressions containing server
-# variable checks and other lookup directives. The syntax is a
-# mixture between C and Perl. See the mod_ssl documentation
-# for more details.
-#<Location />
-#SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)-/ \
-# and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
-# and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA",
"Dev"} \
-# and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
-# and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
-# or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
-#</Location>
-# SSL Engine Options:
-# Set various options for the SSL engine.
-# o FakeBasicAuth:
-# Translate the client X.509 into a Basic Authorisation. This means that
-# the standard Auth/DBMAuth methods can be used for access control. The
-# user name is the `one line' version of the client's X.509 certificate.
-# Note that no password is obtained from the user. Every entry in the user
-# file needs this password: `xxj31ZMTZzkVA'.
-# o ExportCertData:
-# This exports two additional environment variables: SSL_CLIENT_CERT and
-# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
-# server (always existing) and the client (only existing when client
-# authentication is used). This can be used to import the certificates
-# into CGI scripts.
-# o StdEnvVars:
-# This exports the standard SSL/TLS related `SSL_*' environment variables.
-# Per default this exportation is switched off for performance reasons,
-# because the extraction step is an expensive operation and is usually
-# useless for serving static content. So one usually enables the
-# exportation for CGI and SSI requests only.
-# o CompatEnvVars:
-# This exports obsolete environment variables for backward compatibility
-# to Apache-SSL 1.x, mod_ssl 2.0.x, Sioux 1.0 and Stronghold 2.x. Use this
-# to provide compatibility to existing CGI scripts.
-# o StrictRequire:
-# This denies access when "SSLRequireSSL" or "SSLRequire" applied
even
-# under a "Satisfy any" situation, i.e. when it applies access is denied
-# and no other module can change it.
-# o OptRenegotiate:
-# This enables optimized SSL connection renegotiation handling when SSL
-# directives are used in per-directory context.
-#SSLOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire
-<Files ~ "\.(cgi|shtml)$">
- SSLOptions +StdEnvVars
-</Files>
-<Directory "/var/www/cgi-bin">
- SSLOptions +StdEnvVars
-</Directory>
-
-# Notice: Most problems of broken clients are also related to the HTTP
-# keep-alive facility, so you usually additionally want to disable
-# keep-alive for those clients, too. Use variable "nokeepalive" for this.
-SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
-
-# Per-Server Logging:
-# The home of a custom SSL log file. Use this when you want a
-# compact non-error SSL logfile on a virtual host basis.
-CustomLog /var/log/httpd/ssl_request_log \
- "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
-
-</VirtualHost>
-
-</IfDefine>
-
-
-Include conf/local.conf
-Include conf/proxy.conf
diff --git a/web/conf/proxy/local.conf b/web/conf/proxy/local.conf
deleted file mode 100644
index 085b6da..0000000
--- a/web/conf/proxy/local.conf
+++ /dev/null
@@ -1,6 +0,0 @@
-
-##
-## RHN STUFF
-##
-
-
diff --git a/web/conf/proxy/proxy.conf b/web/conf/proxy/proxy.conf
deleted file mode 100644
index f2bff1f..0000000
--- a/web/conf/proxy/proxy.conf
+++ /dev/null
@@ -1,8 +0,0 @@
-LoadModule proxy_module modules/libproxy.so
-AddModule mod_proxy.c
-
-# so the backend can know what the request host was
-ProxyVia full
-
-ProxyPass /network/
http://webapp.devel.rhns.redhat.com/network/
-ProxyPassReverse /network/
http://webapp.devel.rhns.redhat.com/network/
commit 40e70a160fb4fa208aea16625207118a97327175
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 13:22:10 2010 +0200
The satellite-httpd service is no more.
diff --git a/satellite/setup-symlinks.sh b/satellite/setup-symlinks.sh
index d9bbdac..a77d1cf 100755
--- a/satellite/setup-symlinks.sh
+++ b/satellite/setup-symlinks.sh
@@ -116,10 +116,6 @@ symlink $SVNDIR/eng/java/conf/workers.properties
chdir /etc/init.d
symlink $SVNDIR/eng/satellite/config/etc/init.d/satellite-httpd
-chdir /etc/sysconfig
-symlink $SVNDIR/eng/satellite/config/etc/sysconfig/satellite-httpd
-sudo sed -i 's/@@serverDOTnls_lang@(a)/english.UTF8/g'
/etc/sysconfig/satellite-httpd
-
chdir /var/www
symlink $SVNDIR/eng/web/html
diff --git a/spacewalk/config/etc/httpd/conf.d/zz-spacewalk-www.conf
b/spacewalk/config/etc/httpd/conf.d/zz-spacewalk-www.conf
index 2b6fd5e..24bde80 100644
--- a/spacewalk/config/etc/httpd/conf.d/zz-spacewalk-www.conf
+++ b/spacewalk/config/etc/httpd/conf.d/zz-spacewalk-www.conf
@@ -11,7 +11,7 @@ PerlFixupHandler Apache2::SizeLimit
PerlRequire /etc/rhn/satellite-httpd/conf/startup.pl
-# these will be set via /etc/sysconfig/satellite-httpd
+# these will be set via /etc/sysconfig/httpd
PerlPassEnv ORACLE_HOME
PerlPassEnv NLS_LANG
commit 54eadab1897ccae70861e74f9f68164efeda355e
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 12:09:15 2010 +0200
Removing web/conf/*.conf files that are not packages nor used.
diff --git a/web/conf/rhn-profile.conf b/web/conf/rhn-profile.conf
deleted file mode 100644
index 95a6823..0000000
--- a/web/conf/rhn-profile.conf
+++ /dev/null
@@ -1 +0,0 @@
-web.profile_queries = 1
diff --git a/web/conf/rhn-r.conf b/web/conf/rhn-r.conf
deleted file mode 100644
index a484177..0000000
--- a/web/conf/rhn-r.conf
+++ /dev/null
@@ -1 +0,0 @@
-web.pxt_database_dsn = rdu
diff --git a/web/conf/rhn-sat.conf b/web/conf/rhn-sat.conf
deleted file mode 100644
index 3cd07e6..0000000
--- a/web/conf/rhn-sat.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-web.satellite = 1
-web.encrypted_passwords = 0
diff --git a/web/conf/rhn-test02.conf b/web/conf/rhn-test02.conf
deleted file mode 100644
index 4f07680..0000000
--- a/web/conf/rhn-test02.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-web.satellite = 1
-web.encrypted_passwords = 1
-web.pxt_database_dsn = foo/foo@foo
-web.enable_oai_sync = 0
diff --git a/web/conf/rhnapp.conf b/web/conf/rhnapp.conf
deleted file mode 100644
index 0b5890a..0000000
--- a/web/conf/rhnapp.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-##
-## RHN STUFF
-##
-
-# added for oracle
-SetEnv ORACLE_HOME /opt/oracle
-SetEnv NLS_LANG english.UTF8
-
-# MOD_PYTHON
-LoadModule python_module modules/mod_python.so
-PythonPath "sys.path+['/var/www/rhns']"
-PythonDebug Off
-
-<Location /XMLRPC>
- SetHandler python-program
- # all of these handlers are defined in apacheServer
- PythonHeaderParserHandler server.apacheServer::HeaderParserHandler
- PythonHandler server.apacheServer::Handler
- PythonLogHandler server.apacheServer::LogHandler
- PythonCleanupHandler server.apacheServer::CleanupHandler
- PythonOption SERVER xmlrpcServer
- PythonOption RootDir /var/www/rhns
- PythonOption RHNComponentType Server
- DefaultType text/xml
-</Location>
-
commit f8fbd444cd087e561a934671639b64c94fe4d22e
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 11:08:28 2010 +0200
Automatic commit of package [osad] release [5.9.34-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 5f09511..dc4901d 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -9,7 +9,7 @@ Group: System Environment/Daemons
License: GPLv2
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.33
+Version: 5.9.34
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -247,6 +247,9 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
# $Id$
%changelog
+* Tue May 04 2010 Jan Pazdziora 5.9.34-1
+- 575555 - address corecmd_exec_sbin deprecation warning.
+
* Tue May 04 2010 Jan Pazdziora 5.9.33-1
- 580047 - address AVCs about sqlnet.log when the database is down.
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad
index 0775396..a1dc89a 100644
--- a/rel-eng/packages/osad
+++ b/rel-eng/packages/osad
@@ -1 +1 @@
-5.9.33-1 client/tools/osad/
+5.9.34-1 client/tools/osad/
commit ffa0917cee789470fd79ee7153e3768faea6efed
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 10:57:17 2010 +0200
575555 - remove corecmd_exec_sbin as we already have corecmd_exec_bin there.
Addressing
osa-dispatcher.te:34: Warning: corecmd_exec_sbin() has been deprecated, please use
corecmd_exec_bin() instead.
diff --git a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te
b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te
index fc620f5..3cb9c6b 100644
--- a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te
+++ b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te
@@ -31,7 +31,6 @@ libs_use_shared_libs(osa_dispatcher_t)
miscfiles_read_localization(osa_dispatcher_t)
corecmd_exec_bin(osa_dispatcher_t)
-corecmd_exec_sbin(osa_dispatcher_t)
kernel_read_system_state(osa_dispatcher_t)
commit ec7628914b39627969dca1146eccb96c58f71ed8
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 10:22:14 2010 +0200
Automatic commit of package [osad] release [5.9.33-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 141c22e..5f09511 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -9,7 +9,7 @@ Group: System Environment/Daemons
License: GPLv2
URL:
https://fedorahosted.org/spacewalk
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.9.32
+Version: 5.9.33
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -247,6 +247,9 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
# $Id$
%changelog
+* Tue May 04 2010 Jan Pazdziora 5.9.33-1
+- 580047 - address AVCs about sqlnet.log when the database is down.
+
* Mon Apr 19 2010 Michael Mraka <michael.mraka(a)redhat.com> 5.9.32-1
- do not start osad by default
- require python-haslib only in RHEL5
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad
index 3373d11..0775396 100644
--- a/rel-eng/packages/osad
+++ b/rel-eng/packages/osad
@@ -1 +1 @@
-5.9.32-1 client/tools/osad/
+5.9.33-1 client/tools/osad/
commit f0dbdc76ff853e1e57896999c9d9fa3db4c3c5c1
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 09:47:47 2010 +0200
No need to be extra verbose.
This addresses the warning
Warning! /etc/rhn/tns_admin/osa-dispatcher/tnsnames.ora refers to a symbolic link, not
following last component.
diff --git a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
index b444e21..7628576 100644
--- a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
+++ b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
@@ -12,6 +12,6 @@ for selinuxvariant in mls strict targeted
| grep '^osa_dispatcher_upstream_notif_server_port_t\b.*\btcp\b.*\b1290\b' >
/dev/null \
|| /usr/sbin/semanage port -a -t osa_dispatcher_upstream_notif_server_port_t -p tcp
1290
-rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
+rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
/sbin/restorecon -vvi /var/log/rhn/osa-dispatcher.log
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 2935260..141c22e 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -168,7 +168,7 @@ fi
%posttrans -n osa-dispatcher-selinux
#this may be safely remove when BZ 505066 is fixed
if /usr/sbin/selinuxenabled ; then
- rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
+ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
/sbin/restorecon -vvi /var/log/rhn/osa-dispatcher.log
fi
@@ -188,7 +188,7 @@ if [ $1 -eq 0 ]; then
done
fi
-rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
+rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvi {}
/sbin/restorecon -vvi /var/log/rhn/osa-dispatcher.log
%endif
commit d3875dda3c49529843ec9a890359cf636f71040a
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 09:46:09 2010 +0200
Silence semanage upon package upgrade.
We do not issue the semanage port -a if the port is already there, which
addresses the warning
/usr/sbin/semanage: Port tcp/1290 already defined
diff --git a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
index dc2a01c..b444e21 100644
--- a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
+++ b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher-selinux-enable
@@ -8,7 +8,9 @@ for selinuxvariant in mls strict targeted
/usr/share/selinux/${selinuxvariant}/osa-dispatcher.pp || :
done
-/usr/sbin/semanage port -a -t osa_dispatcher_upstream_notif_server_port_t -p tcp 1290 ||
:
+/usr/sbin/semanage port -l \
+ | grep '^osa_dispatcher_upstream_notif_server_port_t\b.*\btcp\b.*\b1290\b' >
/dev/null \
+ || /usr/sbin/semanage port -a -t osa_dispatcher_upstream_notif_server_port_t -p tcp
1290
rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
/sbin/restorecon -vvi /var/log/rhn/osa-dispatcher.log
commit d9c9529015b0ae3705046cc318e238fd415484d6
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue May 4 08:52:39 2010 +0200
580047 - label /var/log/rhn/oracle/osa-dispatcher as osa_dispatcher_log_t, so that
osa-dispatcher can create sqlnet.logs there.
diff --git a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.fc
b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.fc
index 303ec7d..503b076 100644
--- a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.fc
+++ b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.fc
@@ -1,3 +1,4 @@
/usr/sbin/osa-dispatcher gen_context(system_u:object_r:osa_dispatcher_exec_t,s0)
/var/log/rhn/osa-dispatcher\.log gen_context(system_u:object_r:osa_dispatcher_log_t,s0)
+/var/log/rhn/oracle/osa-dispatcher gen_context(system_u:object_r:osa_dispatcher_log_t,s0)
/var/run/osa-dispatcher\.pid gen_context(system_u:object_r:osa_dispatcher_var_run_t,s0)
commit 72755b7518ecde99364eb8726fca0d39f6b1fbb2
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Mon May 3 17:05:33 2010 +0200
580047 - configure osa-dispatcher to put sqlnet.log to
/var/log/rhn/oracle/osa-dispatcher.
diff --git a/client/tools/osad/Makefile.defs b/client/tools/osad/Makefile.defs
index 48605b7..5adc1c1 100644
--- a/client/tools/osad/Makefile.defs
+++ b/client/tools/osad/Makefile.defs
@@ -35,11 +35,13 @@ INSTALL_DEST ?= $(ROOT)/$(SUBDIR)
DIRS += $(addprefix $(PREFIX), \
$(sort $(EXTRA_DIRS)) $(INSTALL_DEST))
-all :: $(INSTALL_FILES)
+all :: $(INSTALL_FILES) $(INSTALL_LINKS)
-install :: all $(DIRS) $(INSTALL_FILES)
+install :: all $(DIRS) $(INSTALL_FILES) $(INSTALL_LINKS)
@$(foreach f,$(INSTALL_FILES), \
$(INSTALL_DATA) $(f) $(PREFIX)$(INSTALL_DEST)/$(f) ; )
+ @$(foreach f,$(INSTALL_LINKS), \
+ ln -s `echo $(f)` $(PREFIX)$(INSTALL_DEST)/$(f) ; )
$(DIRS):
$(INSTALL_DIR) $@
diff --git a/client/tools/osad/Makefile.osad b/client/tools/osad/Makefile.osad
index 2dcded3..f8424cd 100644
--- a/client/tools/osad/Makefile.osad
+++ b/client/tools/osad/Makefile.osad
@@ -7,11 +7,11 @@ VERSION = $(shell echo `awk '{ print $$1 }' version`)
RELEASE = $(shell echo `awk '{ print $$2 }' version`)
CODE_DIRS = src
-CONF_DIRS = rhn-conf osad-conf logrotate
+CONF_DIRS = rhn-conf osad-conf logrotate sysconfig tns-admin-osa-dispatcher
# We look for config files in "well known" locations (rhn-conf,
# httpd-conf, logrotate)
-EXTRA_DIRS = /var/log/rhn $(BINDIR) $(SBINDIR) $(INITDIR)
+EXTRA_DIRS = /var/log/rhn /var/log/rhn/oracle /var/log/rhn/oracle/osa-dispatcher
$(BINDIR) $(SBINDIR) $(INITDIR)
BINDIR = /usr/bin
SBINDIR = /usr/sbin
INITDIR = /etc/rc.d/init.d
diff --git a/client/tools/osad/logrotate/osa-dispatcher
b/client/tools/osad/logrotate/osa-dispatcher
index 2dac67e..d0b8be4 100644
--- a/client/tools/osad/logrotate/osa-dispatcher
+++ b/client/tools/osad/logrotate/osa-dispatcher
@@ -1,6 +1,4 @@
-# logrotation file for Red Hat Network Server
-#
-# $Id$
+# logrotation file for RHN Satellite's osa-dispatcher
/var/log/rhn/osa-dispatcher.log {
weekly
@@ -11,3 +9,13 @@
missingok
size 100M
}
+
+/var/log/rhn/oracle/osa-dispatcher/sqlnet.ora {
+ weekly
+ rotate 5
+ copytruncate
+ compress
+ notifempty
+ missingok
+ size 100M
+}
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index 6834e7e..2935260 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -220,9 +220,15 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
%{rhnroot}/osad/osa_dispatcher.py*
%{rhnroot}/osad/dispatcher_client.py*
%{rhnroot}/osad/rhn_log.py*
+%config(noreplace) %{_sysconfdir}/sysconfig/osa-dispatcher
%config(noreplace) %{_sysconfdir}/logrotate.d/osa-dispatcher
%config %{_sysconfdir}/rhn/default/rhn_osa-dispatcher.conf
+%config %{_sysconfdir}/rhn/tns_admin/osa-dispatcher
+%config(noreplace) %{_sysconfdir}/rhn/tns_admin/osa-dispatcher/tnsnames.ora
+%config(noreplace) %{_sysconfdir}/rhn/tns_admin/osa-dispatcher/sqlnet.ora
%attr(755,root,root) %{_initrddir}/osa-dispatcher
+%attr(770,root,apache) %dir %{_var}/log/rhn/oracle
+%attr(770,root,root) %dir %{_var}/log/rhn/oracle/osa-dispatcher
%doc LICENSE
%doc PYTHON-LICENSES.txt
diff --git a/client/tools/osad/prog.init b/client/tools/osad/prog.init
index a214e2c..58db558 100755
--- a/client/tools/osad/prog.init
+++ b/client/tools/osad/prog.init
@@ -20,6 +20,11 @@
# Source networking configuration.
. /etc/sysconfig/network
+# Source prog-specific configuration
+if [ -f /etc/sysconfig/@@PROG@@ ]; then
+ . /etc/sysconfig/@@PROG@@
+fi
+
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
diff --git a/client/tools/osad/sysconfig/Makefile b/client/tools/osad/sysconfig/Makefile
new file mode 100644
index 0000000..5badc70
--- /dev/null
+++ b/client/tools/osad/sysconfig/Makefile
@@ -0,0 +1,9 @@
+# Makefile for installation of the RHN server configuration files
+
+# what is the backend top dir
+TOP = ..
+
+INSTALL_FILES = osa-dispatcher
+INSTALL_DEST = /etc/sysconfig
+
+include $(TOP)/Makefile.defs
diff --git a/client/tools/osad/sysconfig/osa-dispatcher
b/client/tools/osad/sysconfig/osa-dispatcher
new file mode 100644
index 0000000..4347d64
--- /dev/null
+++ b/client/tools/osad/sysconfig/osa-dispatcher
@@ -0,0 +1,4 @@
+
+TNS_ADMIN=/etc/rhn/tns_admin/osa-dispatcher
+export TNS_ADMIN
+
diff --git a/client/tools/osad/tns-admin-osa-dispatcher/Makefile
b/client/tools/osad/tns-admin-osa-dispatcher/Makefile
new file mode 100644
index 0000000..d88544b
--- /dev/null
+++ b/client/tools/osad/tns-admin-osa-dispatcher/Makefile
@@ -0,0 +1,10 @@
+# Makefile for installation of the RHN server configuration files
+
+# what is the backend top dir
+TOP = ..
+
+INSTALL_FILES = sqlnet.ora
+INSTALL_LINKS = tnsnames.ora
+INSTALL_DEST = /etc/rhn/tns_admin/osa-dispatcher
+
+include $(TOP)/Makefile.defs
diff --git a/client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora
b/client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora
new file mode 100644
index 0000000..13206ad
--- /dev/null
+++ b/client/tools/osad/tns-admin-osa-dispatcher/sqlnet.ora
@@ -0,0 +1,3 @@
+
+log_directory_client = /var/log/rhn/oracle/osa-dispatcher
+
diff --git a/client/tools/osad/tns-admin-osa-dispatcher/tnsnames.ora
b/client/tools/osad/tns-admin-osa-dispatcher/tnsnames.ora
new file mode 100644
index 0000000..7c467fe
--- /dev/null
+++ b/client/tools/osad/tns-admin-osa-dispatcher/tnsnames.ora
@@ -0,0 +1 @@
+/etc/tnsnames.ora
commit aa08c95f9340b930c7f0c52bfb6a403b97708af8
Author: Partha Aji <paji(a)redhat.com>
Date: Mon May 3 18:47:21 2010 -0400
Updated the list tag to deal with parent vs child filtering
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
index d5a7676..90ce809 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
@@ -62,6 +62,9 @@ public class DataSetManipulator {
private int unfilteredDataSize;
private boolean parentIsAnElement;
+ private boolean searchParent;
+ private boolean searchChild;
+
private String defaultSortAttribute;
private static final String IMG_FIRST = "/img/list-allbackward.gif";
private static final String IMG_FIRST_UNFOCUSED =
@@ -90,9 +93,15 @@ public class DataSetManipulator {
* @param parentIsElement true of the parent value
* in the list should be considered as an element
* this is useful for tree like data
+ * @param doSearchParent true if we want to search the parent value
+ * in the list when filtering.
+ * @param doSearchChild true if we want to search the child value
+ * in the list when filtering.
*/
public DataSetManipulator(int pageSizeIn, List datasetIn,
- HttpServletRequest requestIn, String listNameIn, boolean parentIsElement) {
+ HttpServletRequest requestIn, String listNameIn,
+ boolean parentIsElement, boolean doSearchParent,
+ boolean doSearchChild) {
pageSize = pageSizeIn;
dataset = datasetIn;
request = requestIn;
@@ -100,6 +109,8 @@ public class DataSetManipulator {
totalDataSetSize = dataset.size();
unfilteredDataSize = dataset.size();
parentIsAnElement = parentIsElement;
+ searchParent = doSearchParent;
+ searchChild = doSearchChild;
}
private List expand(List data) {
@@ -109,9 +120,9 @@ public class DataSetManipulator {
if (obj instanceof Expandable) {
Expandable ex = (Expandable) obj;
List children = ex.expand();
- if (filter != null) {
+ if (searchChild && filter != null) {
expanded.addAll(ListFilterHelper.filter(children,
- filter, filterBy, filterValue));
+ filter, filterBy, filterValue, searchParent, searchChild));
}
else {
expanded.addAll(children);
@@ -410,7 +421,8 @@ public class DataSetManipulator {
filterClass.setAttribute("value",
f.getClass().getCanonicalName());
ListTagUtil.write(context, filterClass.render());
- dataset = ListFilterHelper.filter(dataset, f, filterBy, filterValue);
+ dataset = ListFilterHelper.filter(dataset, f, filterBy, filterValue,
+ searchParent, searchChild);
totalDataSetSize = dataset.size();
}
}
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java
index 8c2d41a..6efb977 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListFilterHelper.java
@@ -39,10 +39,14 @@ public class ListFilterHelper {
* @param filter the filter to use
* @param filterBy which value to filter by in the bean
* @param filterValue the value to filter on
+ * @param searchParent true if we want to search the parent value
+ * in the list when filtering.
+ * @param searchChild true if we want to search the child value
+ * in the list when filtering.
* @return the filtered list
*/
public static List filter(List dataSet, ListFilter filter, String filterBy,
- String filterValue) {
+ String filterValue, boolean searchParent, boolean searchChild) {
String tmp = null;
try {
tmp = URLDecoder.decode(filterBy, "UTF-8");
@@ -74,14 +78,18 @@ public class ListFilterHelper {
Expandable parent = null;
for (Object object : dataSet) {
if (object instanceof Expandable) {
- parent = (Expandable) object;
- for (Object child : parent.expand()) {
- if (filter.filter(child, filterBy, filterValue)) {
- filteredData.add(parent);
- break;
+ if (searchParent && filter.filter(object, filterBy, filterValue))
{
+ filteredData.add(object);
+ }
+ if (searchChild) {
+ parent = (Expandable) object;
+ for (Object child : parent.expand()) {
+ if (filter.filter(child, filterBy, filterValue)) {
+ filteredData.add(parent);
+ break;
+ }
}
}
-
}
else if (filter.filter(object, filterBy, filterValue)) {
filteredData.add(object);
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
index 6c5a265..670d50c 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
@@ -84,7 +84,25 @@ public class ListTag extends BodyTagSupport {
private String title;
private boolean sortable;
private boolean parentIsElement;
+ private boolean searchParent = true;
+ private boolean searchChild;
+
+ /**
+ * @param searchParentIn The searchParent to set.
+ */
+ public void setSearchparent(String searchParentIn) {
+ searchParent = ListTagUtil.toBoolean(searchParentIn);
+ }
+
+
+ /**
+ * @param searchChildIn The searchChild to set.
+ */
+ public void setSearchchild(String searchChildIn) {
+ searchChild = ListTagUtil.toBoolean(searchChildIn);
+ }
+
/**
* method to let the list tag know
* that atleast one of its columns
@@ -587,7 +605,7 @@ public class ListTag extends BodyTagSupport {
setPageSize();
manip = new DataSetManipulator(pageSize, pageData,
(HttpServletRequest) pageContext.getRequest(),
- getUniqueName(), isParentAnElement());
+ getUniqueName(), isParentAnElement(), searchParent, searchChild);
int retval = BodyTagSupport.EVAL_BODY_INCLUDE;
emitId();
@@ -678,6 +696,8 @@ public class ListTag extends BodyTagSupport {
title = null;
sortable = false;
parentIsElement = true;
+ searchParent = true;
+ searchChild = false;
super.release();
}
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
index 16abb68..d4b31a2 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
@@ -91,7 +91,16 @@
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
-
+ <attribute>
+ <name>searchparent</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>searchchild</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
<attribute>
<name>reflink</name>
<required>false</required>
diff --git a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
index 1c4fa92..7ac9b2f 100644
--- a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
@@ -23,6 +23,8 @@
<rl:list
emptykey="nosystems.message"
parentiselement = "false"
+ searchparent="true"
+ searchchild="false"
<rl:rowrenderer name="ExpandableRowRenderer" />
@@ -44,7 +46,7 @@
<!-- Name Column -->
- <rl:column headerkey="systemlist.jsp.system" filterattr="id">
+ <rl:column headerkey="systemlist.jsp.system"
filterattr="key">
<rl:expandable rendericon="true">${current.key}
<em>(${rl:countChildren(current)} systems)</em> </rl:expandable>
<rl:non-expandable
rendericon="true">${current.id}</rl:non-expandable>
commit 52415e8c5f658e744d23ea2d13c24180cb5be4e8
Author: Partha Aji <paji(a)redhat.com>
Date: Mon May 3 18:17:23 2010 -0400
More changes to properly handle selection javascript magic
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/RhnListTagFunctions.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/RhnListTagFunctions.java
index 08fcd7a..d743e2c 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/RhnListTagFunctions.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/RhnListTagFunctions.java
@@ -36,4 +36,17 @@ public class RhnListTagFunctions {
public static boolean isExpandable(Object current) {
return current instanceof Expandable;
}
+
+ /**
+ * Quick check to see if the passed in object is expandable.
+ *
+ * @param current The object to be checked
+ * @return true if the current object is expandable
+ */
+ public static int getChildrenCount(Object current) {
+ if (!isExpandable(current)) {
+ return 0;
+ }
+ return ((Expandable)current).expand().size();
+ }
}
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
index cb7c1f7..d5a7676 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/DataSetManipulator.java
@@ -15,6 +15,7 @@
package com.redhat.rhn.frontend.taglibs.list;
+import com.redhat.rhn.common.localization.LocalizationService;
import com.redhat.rhn.common.util.DynamicComparator;
import com.redhat.rhn.common.util.MethodUtil;
import com.redhat.rhn.common.util.StringUtil;
@@ -59,6 +60,7 @@ public class DataSetManipulator {
private int alphaPosition = -1;
private boolean ascending = true;
private int unfilteredDataSize;
+ private boolean parentIsAnElement;
private String defaultSortAttribute;
private static final String IMG_FIRST = "/img/list-allbackward.gif";
@@ -85,15 +87,19 @@ public class DataSetManipulator {
* @param datasetIn dataset to be displayed
* @param requestIn HttpServletRequest of the caller
* @param listNameIn name of the list
+ * @param parentIsElement true of the parent value
+ * in the list should be considered as an element
+ * this is useful for tree like data
*/
public DataSetManipulator(int pageSizeIn, List datasetIn,
- HttpServletRequest requestIn, String listNameIn) {
+ HttpServletRequest requestIn, String listNameIn, boolean parentIsElement) {
pageSize = pageSizeIn;
dataset = datasetIn;
request = requestIn;
uniqueName = listNameIn;
totalDataSetSize = dataset.size();
unfilteredDataSize = dataset.size();
+ parentIsAnElement = parentIsElement;
}
private List expand(List data) {
@@ -163,7 +169,7 @@ public class DataSetManipulator {
* Returns the starting element index for a page (1 based)
* @return int
*/
- public int getPageStartIndex() {
+ private int getPageStartIndex() {
//no data ==> no start index...
if (getTotalDataSetSize() == 0) {
return 0;
@@ -174,30 +180,64 @@ public class DataSetManipulator {
if (startOffset < 0) {
startOffset = 0;
}
- return startOffset + 1;
+ List parentList = dataset.subList(0, startOffset);
+ List data = expand(parentList);
+ int ret = data.size() + 1;
+
+ if (!parentIsAnElement) {
+ ret = ret - parentList.size();
+ }
+ return ret;
}
/**
* Returns the ending element index for a page (1 based)
* @return int
*/
- public int getPageEndIndex() {
+ private int getPageEndIndex() {
int startOffset = getCurrentPageNumber() * pageSize;
if (startOffset < 0) {
startOffset = 0;
}
+
int endOffset = startOffset + pageSize;
if (endOffset > dataset.size()) {
endOffset = dataset.size();
}
- return endOffset;
+ List parentList = dataset.subList(0, endOffset);
+ List data = expand(parentList);
+
+ if (!parentIsAnElement) {
+ return data.size() - parentList.size();
+ }
+
+ return data.size();
+ }
+
+ private int getExpandedDataSize() {
+ if (!parentIsAnElement) {
+ return expand(dataset).size() - dataset.size();
+ }
+ return expand(dataset).size();
}
/**
+ * Returns the pagination message (1 - 2 of 3 for example)
+ * @return the pagination message
+ */
+ public String getPaginationMessage() {
+ LocalizationService ls = LocalizationService.getInstance();
+ return ls.getMessage("message.range", getPageStartIndex(),
+ getPageEndIndex(), getExpandedDataSize());
+
+ }
+
+
+ /**
* Determines the current page number based on URL params
* @return current page number
*/
- public int getCurrentPageNumber() {
+ private int getCurrentPageNumber() {
if (AlphaBarHelper.getInstance().isSelected(uniqueName, request)) {
int pos = findAlphaPosition();
@@ -240,6 +280,12 @@ public class DataSetManipulator {
}
/**
+ * Binds information pertaining to pagination to the request
+ */
+ public void bindPaginationInfo() {
+ request.setAttribute("pageNum",
String.valueOf(getCurrentPageNumber()));
+ }
+ /**
* Returns the pagination param (|<, <, >, >|) that was selected
* returns null if no pagination action was selected.
* @param request the http servlet request
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
index 8488e2a..6c5a265 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/ListTag.java
@@ -83,6 +83,7 @@ public class ListTag extends BodyTagSupport {
private String refLinkKeyArg0;
private String title;
private boolean sortable;
+ private boolean parentIsElement;
/**
* method to let the list tag know
@@ -478,8 +479,7 @@ public class ListTag extends BodyTagSupport {
startTable();
HttpServletRequest request = (HttpServletRequest) pageContext
.getRequest();
- request.setAttribute("pageNum", String.valueOf(manip
- .getCurrentPageNumber()));
+ manip.bindPaginationInfo();
request.setAttribute("dataSize", String
.valueOf(pageData.size() + 1));
ListTagUtil.setCurrentCommand(pageContext, getUniqueName(),
@@ -586,7 +586,8 @@ public class ListTag extends BodyTagSupport {
setupPageData();
setPageSize();
manip = new DataSetManipulator(pageSize, pageData,
- (HttpServletRequest) pageContext.getRequest(), getUniqueName());
+ (HttpServletRequest) pageContext.getRequest(),
+ getUniqueName(), isParentAnElement());
int retval = BodyTagSupport.EVAL_BODY_INCLUDE;
emitId();
@@ -676,7 +677,7 @@ public class ListTag extends BodyTagSupport {
decoratorName = null;
title = null;
sortable = false;
-
+ parentIsElement = true;
super.release();
}
@@ -788,13 +789,7 @@ public class ListTag extends BodyTagSupport {
ListTagUtil.write(pageContext,
"<td valign=\"middle\"
class=\"list-infotext\">");
if (!isEmpty() && !hidePageNums) {
- Object[] range = new Integer[3];
- range[0] = new Integer(manip.getPageStartIndex());
- range[1] = new Integer(manip.getPageEndIndex());
- range[2] = new Integer(manip.getTotalDataSetSize());
- LocalizationService ls = LocalizationService.getInstance();
- String msg = ls.getMessage("message.range", range);
- ListTagUtil.write(pageContext, msg);
+ ListTagUtil.write(pageContext, manip.getPaginationMessage());
}
if (!manip.isListEmpty()) {
@@ -919,12 +914,29 @@ public class ListTag extends BodyTagSupport {
* @param value true or false
*/
public void setHidepagenums(String value) {
- if (value.equals("true") || value.equals("True")) {
- hidePageNums = true;
- }
+ hidePageNums = ListTagUtil.toBoolean(value);
}
/**
+ * if set to true, the parent in a tree setup will
+ * be considered as an element by itself
+ * @param value true or false
+ */
+ public void setParentiselement(String value) {
+ parentIsElement = ListTagUtil.toBoolean(value);
+ }
+
+ /**
+ * if set to true, the parent in a tree setup will
+ * be considered as an element by itself
+ * @return true if the parent itself is an element
+ */
+ public boolean isParentAnElement() {
+ return parentIsElement;
+ }
+
+
+ /**
*
* @return CSS ID for <table>
*/
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java
index 7cb860d..ac05db5 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/list/SelectableColumnTag.java
@@ -34,7 +34,8 @@ public class SelectableColumnTag extends TagSupport {
private static final long serialVersionUID = 2749189931275777440L;
private static final String CHECKBOX_CLICKED_SCRIPT =
- "process_checkbox_clicked(this,'%s', this.form.%s, %s,
%s, '%s')";
+ "process_checkbox_clicked(this,'%s', this.form.%s, %s,
%s, '%s', %s)";
+ private static final String CHECK_ALL_SCRIPT = "process_check_all('%s',
%s, %s, %s)";
private String valueExpr;
private String selectExpr;
private String disabledExpr;
@@ -188,19 +189,14 @@ public class SelectableColumnTag extends TagSupport {
ListTagUtil.write(pageContext, " name=\"");
ListTagUtil.write(pageContext, makeSelectAllCheckboxName());
ListTagUtil.write(pageContext, "\" ");
- ListTagUtil.write(pageContext, "onclick=\"");
- ListTagUtil.write(pageContext, "process_check_all(");
- ListTagUtil.write(pageContext, "'");
-
- if (rhnSet != null) {
- ListTagUtil.write(pageContext, rhnSet);
- }
- ListTagUtil.write(pageContext, "', ");
- ListTagUtil.write(pageContext, "this.form." +
- ListTagUtil.makeSelectedItemsName(listName));
- ListTagUtil.write(pageContext, ", this.checked)");
-
- ListTagUtil.write(pageContext, "\" />");
+ ListTagUtil.write(pageContext, "onclick=\"");
+ String script = String.format(CHECK_ALL_SCRIPT,
+ StringUtils.defaultString(rhnSet),
+ "this.form." + ListTagUtil.
+ makeSelectedItemsName(listName),
"this.checked",
+ getIgnorableParentIds());
+ ListTagUtil.write(pageContext, script);
+ ListTagUtil.write(pageContext, "\" />");
}
private void renderCheckbox() throws JspException {
render(valueExpr);
@@ -249,6 +245,8 @@ public class SelectableColumnTag extends TagSupport {
String childIds = "[]";
String memberIds = "[]";
String parentId = "";
+ ListTag parentTag = (ListTag)
+ BodyTagSupport.findAncestorWithClass(this, ListTag.class);
if (RhnListTagFunctions.isExpandable(current)) {
childIds = getChildIds(current);
@@ -261,7 +259,8 @@ public class SelectableColumnTag extends TagSupport {
ListTagUtil.write(pageContext, " onclick=\"");
ListTagUtil.write(pageContext, String.format(CHECKBOX_CLICKED_SCRIPT,
rhnSet, makeSelectAllCheckboxName(),
- childIds, memberIds, parentId));
+ childIds, memberIds, parentId,
+ parentTag.isParentAnElement()));
ListTagUtil.write(pageContext, "\" ");
}
}
@@ -362,5 +361,27 @@ public class SelectableColumnTag extends TagSupport {
ListTag parent = (ListTag)
BodyTagSupport.findAncestorWithClass(this, ListTag.class);
return parent.getParentObject();
+ }
+
+ private String getIgnorableParentIds() {
+ ListTag parent = (ListTag)
+ BodyTagSupport.findAncestorWithClass(this, ListTag.class);
+ if (!parent.isParentAnElement()) {
+ StringBuilder buf = new StringBuilder();
+ for (Object current : parent.getPageData()) {
+ if (RhnListTagFunctions.isExpandable(current)) {
+ if (buf.length() > 0) {
+ buf.append(",");
+ }
+ buf.append("'");
+ buf.append(makeCheckboxId(ListTagHelper.getObjectId(current)));
+ buf.append("'");
+ }
+ }
+ buf.insert(0, "[");
+ buf.append("]");
+ return buf.toString();
+ }
+ return "[]";
}
}
diff --git
a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java
index 3198608..fa413b9 100644
---
a/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java
+++
b/java/code/src/com/redhat/rhn/frontend/taglibs/list/decorators/ExpansionDecorator.java
@@ -33,7 +33,7 @@ public class ExpansionDecorator extends BaseListDecorator {
"style=\"cursor: pointer;\">Hide All</a>";
private static final String NEW_VAR_SCRIPT = "<script
type=\"text/javascript\">var " +
- "rowHash%s = new
Array();</script>";
+ "rowHash%s = new
Array();</script>";
private static final String LOAD_SCRIPT = "<script
type=\"text/javascript\">" +
"onLoadStuff(%s, '%s',
rowHash%s);</script>";
@@ -44,8 +44,16 @@ public class ExpansionDecorator extends BaseListDecorator {
@Override
public void beforeList() throws JspException {
ListTagUtil.write(pageContext, String.format(NEW_VAR_SCRIPT, listName));
- ListTagUtil.write(pageContext, String.format(SHOW_ALL_SCRIPT, listName,
listName));
-
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ @Override
+ public void beforeTopPagination() throws JspException {
+ ListTagUtil.write(pageContext, String.format(SHOW_ALL_SCRIPT,
+ listName, listName));
}
/**
diff --git a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
index bc6ec20..16abb68 100644
--- a/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
+++ b/java/code/src/com/redhat/rhn/frontend/taglibs/rhn-list.tld
@@ -86,6 +86,12 @@
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
+ <attribute>
+ <name>parentiselement</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+
<attribute>
<name>reflink</name>
<required>false</required>
@@ -311,5 +317,10 @@
<name>expandable</name>
<function-class>com.redhat.rhn.frontend.taglibs.RhnListTagFunctions</function-class>
<function-signature>boolean
isExpandable(java.lang.Object)</function-signature>
- </function>
+ </function>
+ <function>
+ <name>countChildren</name>
+
<function-class>com.redhat.rhn.frontend.taglibs.RhnListTagFunctions</function-class>
+ <function-signature>int
getChildrenCount(java.lang.Object)</function-signature>
+ </function>
</taglib>
diff --git a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
index 50addb4..1c4fa92 100644
--- a/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/duplicate/duplicateIPList.jsp
@@ -22,6 +22,7 @@
<rl:listset name="DupesListSet" legend="system">
<rl:list
emptykey="nosystems.message"
+ parentiselement = "false"
<rl:rowrenderer name="ExpandableRowRenderer" />
@@ -44,7 +45,7 @@
<!-- Name Column -->
<rl:column headerkey="systemlist.jsp.system" filterattr="id">
- <rl:expandable
rendericon="true">${current.key}</rl:expandable>
+ <rl:expandable rendericon="true">${current.key}
<em>(${rl:countChildren(current)} systems)</em> </rl:expandable>
<rl:non-expandable
rendericon="true">${current.id}</rl:non-expandable>
</rl:column>
diff --git a/web/html/javascript/check_all.js b/web/html/javascript/check_all.js
index b5331b1..b422c0a 100644
--- a/web/html/javascript/check_all.js
+++ b/web/html/javascript/check_all.js
@@ -25,13 +25,37 @@ function check_all_on_page(form, set_label) {
}
var flag = eval("document.forms['" + form_name +
"'].checkall.checked");
var cboxes = eval("document.forms['" + form_name +
"'].items_selected");
- process_check_all(set_label, cboxes, flag);
+ process_check_all(set_label, cboxes, flag, []);
}
-function process_check_all(set_label, cboxes, flag) {
- update_server_set("ids", set_label, flag, process_group(set_label, cboxes,
flag));
+function process_check_all(set_label, cboxes, flag, ignorables_ids) {
+ var boxes = process_group(set_label, cboxes, flag);
+ var ignorables = ids_to_elements(ignorables_ids);
+ var includes = new Array();
+ for (var i = 0; i < boxes.length; i++) {
+ var include = true;
+ for (var j = 0; j < ignorables.length; j++) {
+ if (ignorables[j].value == boxes[i]) {
+ include = false;
+ break;
+ }
+ }
+ if (include) {
+ includes.push(boxes[i]);
+ }
+ }
+ update_server_set("ids", set_label, flag, includes);
+}
+
+function ids_to_elements(elem_ids) {
+ var elements = new Array();
+ for (var i = 0; i < elem_ids.length; i++) {
+ elements.push(document.getElementById(elem_ids[i]));
+ }
+ return elements;
}
+
function process_group(set_label, cboxes, flag) {
var i;
var changed = new Array();
@@ -62,7 +86,7 @@ function checkbox_clicked(thebox, set_label) {
form_name = thebox.form.id;
}
var checkall = eval("document.forms['" + form_name +
"'].checkall");
- process_checkbox_clicked(thebox, set_label, checkall, [], [],"");
+ process_checkbox_clicked(thebox, set_label, checkall, [], [],"", true);
}
@@ -79,9 +103,16 @@ function checkbox_clicked(thebox, set_label) {
* parent_id - if this is a child node then list the parent_id or [] otherwise
**/
-function process_checkbox_clicked(thebox, set_label, checkall, children, members,
parent_id ) {
+function process_checkbox_clicked(thebox, set_label, checkall, children, members,
parent_id, parentIsElement) {
var a = new Array();
- a.push(thebox.value);
+ if (parent_id == '') {
+ if(parentIsElement) {
+ a.push(thebox.value);
+ }
+ }
+ else {
+ a.push(thebox.value);
+ }
var checkboxes = new Array();
for (var i = 0; i < children.length; i++) {
@@ -95,11 +126,7 @@ function process_checkbox_clicked(thebox, set_label, checkall,
children, members
if (parent_id) {
var parentBox = document.getElementById(parent_id);
- var boxes = new Array();
- for (var i = 0; i < members.length; i++) {
- var checkbox = document.getElementById(members[i]);
- boxes.push(checkbox);
- }
+ var boxes = ids_to_elements(members) ;
process_single_checkbox(boxes, parentBox);
}
var form_name = thebox.form.name;