backend/Makefile.defs | 14 backend/common/rhn_rpm.py | 2 backend/satellite_tools/Makefile | 11 backend/satellite_tools/reports.py | 108 +++++ backend/satellite_tools/reports/data/inventory | 114 +++++ backend/satellite_tools/satsync.py | 36 - backend/satellite_tools/spacewalk-report | 168 +++++++ backend/satellite_tools/spacewalk-report.sgml | 119 +++++ backend/satellite_tools/sync_handlers.py | 10 backend/server/handlers/config/rhn_config_management.py | 2 backend/server/importlib/backend.py | 5 backend/server/importlib/channelImport.py | 16 backend/server/importlib/headerSource.py | 5 backend/spacewalk-backend.spec | 73 +++ branding/spacewalk-branding.spec | 6 client/rhel/rhnsd/rhnsd.spec | 5 client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te | 5 client/tools/osad/osad.spec | 17 client/tools/spacewalk-koan/spacewalk-koan.spec | 6 client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py | 4 java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java | 13 java/code/src/com/redhat/rhn/common/db/datasource/xml/General_queries.xml | 2 java/code/src/com/redhat/rhn/common/security/acl/KickstartAclHandler.java | 64 ++ java/code/src/com/redhat/rhn/common/util/StringUtil.java | 2 java/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml | 5 java/code/src/com/redhat/rhn/domain/channel/Channel.java | 39 + java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java | 58 +- java/code/src/com/redhat/rhn/domain/channel/test/ChannelFactoryTest.java | 16 java/code/src/com/redhat/rhn/domain/common/ChecksumType.hbm.xml | 32 + java/code/src/com/redhat/rhn/domain/common/ChecksumType.java | 105 ++++ java/code/src/com/redhat/rhn/domain/common/test/ChecksumTypeTest.java | 42 + java/code/src/com/redhat/rhn/domain/kickstart/KickstartData.java | 10 java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java | 47 +- java/code/src/com/redhat/rhn/domain/kickstart/KickstartableTree.hbm.xml | 7 java/code/src/com/redhat/rhn/domain/kickstart/KickstartableTree.java | 14 java/code/src/com/redhat/rhn/domain/kickstart/test/KickstartDataTest.java | 31 - java/code/src/com/redhat/rhn/domain/kickstart/test/KickstartableTreeTest.java | 40 + java/code/src/com/redhat/rhn/domain/org/OrgImpl.java | 8 java/code/src/com/redhat/rhn/domain/rhnpackage/Package.java | 35 + java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java | 26 + java/code/src/com/redhat/rhn/domain/task/Task.hbm.xml | 9 java/code/src/com/redhat/rhn/domain/task/TaskFactory.java | 21 java/code/src/com/redhat/rhn/domain/task/test/TaskTest.java | 15 java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java | 46 +- java/code/src/com/redhat/rhn/frontend/action/kickstart/AdvancedModeDetailsAction.java | 41 + java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java | 11 java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java | 10 java/code/src/com/redhat/rhn/frontend/action/kickstart/ViewTreesAction.java | 39 + java/code/src/com/redhat/rhn/frontend/action/kickstart/tree/TreeEditAction.java | 35 + java/code/src/com/redhat/rhn/frontend/action/kickstart/tree/test/TreeActionTest.java | 11 java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java | 10 java/code/src/com/redhat/rhn/frontend/dto/kickstart/KickstartDto.java | 1 java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 8 java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 120 ++++- java/code/src/com/redhat/rhn/frontend/taglibs/list/ColumnTag.java | 1 java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/tree/test/KickstartTreeHandlerTest.java | 11 java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 5 java/code/src/com/redhat/rhn/manager/BaseTransactionCommand.java | 75 +++ java/code/src/com/redhat/rhn/manager/channel/CreateChannelCommand.java | 16 java/code/src/com/redhat/rhn/manager/channel/UpdateChannelCommand.java | 11 java/code/src/com/redhat/rhn/manager/errata/cache/UpdateErrataCacheCommand.java | 41 - java/code/src/com/redhat/rhn/manager/kickstart/IpAddress.java | 4 java/code/src/com/redhat/rhn/manager/kickstart/KickstartDeleteCommand.java | 6 java/code/src/com/redhat/rhn/manager/kickstart/KickstartEditCommand.java | 4 java/code/src/com/redhat/rhn/manager/kickstart/KickstartLister.java | 32 + java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java | 30 + java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java | 11 java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java | 41 - java/code/src/com/redhat/rhn/manager/kickstart/ProvisionVirtualInstanceCommand.java | 15 java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerCommand.java | 79 --- java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCommand.java | 39 + java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCreateCommand.java | 31 + java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroDeleteCommand.java | 7 java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroSyncCommand.java | 6 java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileCommand.java | 10 java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileDeleteCommand.java | 13 java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileEditCommand.java | 8 java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileSyncCommand.java | 14 java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java | 53 +- java/code/src/com/redhat/rhn/manager/kickstart/cobbler/test/CobblerCommandTest.java | 24 - java/code/src/com/redhat/rhn/manager/kickstart/test/KickstartWizardCommandTest.java | 4 java/code/src/com/redhat/rhn/manager/kickstart/tree/BaseTreeEditOperation.java | 48 +- java/code/src/com/redhat/rhn/manager/kickstart/tree/TreeEditOperation.java | 6 java/code/src/com/redhat/rhn/manager/kickstart/tree/test/TreeEditOperationTest.java | 6 java/code/src/com/redhat/rhn/manager/satellite/UpgradeCommand.java | 105 ++++ java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java | 59 ++ java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepomdIndexData.java | 8 java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepositoryWriter.java | 28 - java/code/src/com/redhat/rhn/testing/RhnBaseTestCase.java | 18 java/code/src/com/redhat/rhn/webapp/RhnServletListener.java | 12 java/code/src/org/cobbler/CobblerObject.java | 10 java/code/src/org/cobbler/SystemRecord.java | 9 java/code/src/org/cobbler/test/MockConnection.java | 4 java/code/webapp/WEB-INF/nav/kickstart_details.xml | 32 - java/code/webapp/WEB-INF/nav/kickstart_raw_mode.xml | 6 java/code/webapp/WEB-INF/nav/kickstart_tree_details.xml | 4 java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp | 13 java/code/webapp/WEB-INF/pages/common/fragments/kickstart/advanced/details.jspf | 47 ++ java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/network-options.jspf | 8 java/code/webapp/WEB-INF/pages/kickstart/kickstartdetails.jsp | 18 java/code/webapp/WEB-INF/pages/kickstart/kickstarts.jsp | 14 java/code/webapp/WEB-INF/pages/kickstart/kstrees.jsp | 45 +- java/code/webapp/WEB-INF/struts-config.xml | 1 java/spacewalk-java.spec | 43 +- monitoring/PerlModules/NP/OracleDB/OracleDB.pm | 1 monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec | 8 monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec | 9 monitoring/SatConfig/bootstrap/npBootstrap.pl | 3 monitoring/SatConfig/cluster/PhysCluster.pm | 2 monitoring/SatConfig/general/NOCpulse-ini | 215 ++++++++++ monitoring/SatConfig/general/SatConfig-general.spec | 9 monitoring/nocpulse-common/nocpulse-common.spec | 4 monitoring/nocpulse-common/perl-API/NOCpulse/NOCpulseini.pm | 29 + monitoring/spacewalk-monitoring/spacewalk-monitoring.spec | 24 - proxy/installer/cluster.ini | 1 proxy/installer/configure-proxy.sh | 2 proxy/installer/spacewalk-proxy-installer.spec | 5 proxy/proxy/spacewalk-proxy.spec | 6 rel-eng/lib/spacewalk/releng/builder.py | 4 rel-eng/packages/SatConfig-general | 2 rel-eng/packages/osad | 2 rel-eng/packages/perl-NOCpulse-OracleDB | 2 rel-eng/packages/perl-NOCpulse-Probe | 2 rel-eng/packages/rhnsd | 2 rel-eng/packages/spacewalk | 2 rel-eng/packages/spacewalk-backend | 2 rel-eng/packages/spacewalk-branding | 2 rel-eng/packages/spacewalk-config | 2 rel-eng/packages/spacewalk-java | 2 rel-eng/packages/spacewalk-koan | 2 rel-eng/packages/spacewalk-monitoring | 2 rel-eng/packages/spacewalk-proxy | 2 rel-eng/packages/spacewalk-proxy-installer | 2 rel-eng/packages/spacewalk-schema | 2 rel-eng/packages/spacewalk-selinux | 2 rel-eng/packages/spacewalk-setup | 2 rel-eng/packages/spacewalk-utils | 2 rel-eng/packages/spacewalk-web | 2 rel-eng/tito.props | 1 satellite/install/install.pl | 5 schema/spacewalk/rhnsat/tables/rhnChannel.sql | 2 schema/spacewalk/rhnsat/tables/rhnChecksumType_data.sql | 12 schema/spacewalk/spacewalk-schema.spec | 8 schema/spacewalk/upgrade/spacewalk-0.2-spacewalk-0.3/100-rhnCpuArch-i86pc.sql | 11 schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/124-rhn_probe_param_value.sql | 27 + schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/125-rhnChecksumType.sql | 44 ++ schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/126-rhnChecksumType_data.sql | 37 + schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-rhnChannel.sql | 7 schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-upgrade_kickstart_profiles.sql | 20 selinux/spacewalk-selinux/spacewalk-selinux.spec | 6 spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/c2s.xml | 2 spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/sm.xml | 4 spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/cluster.ini | 1 spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf | 9 spacewalk/config/satellite-rules.conf | 4 spacewalk/config/spacewalk-config.spec | 6 spacewalk/package/spacewalk.spec | 18 spacewalk/setup/bin/spacewalk-setup | 8 spacewalk/setup/share/upgrade/rhn-load-config.pl | 4 spacewalk/setup/share/upgrade/rhn-update-monitoring.pl | 65 +++ spacewalk/setup/spacewalk-setup.spec | 7 utils/Makefile | 7 utils/spacewalk-api | 142 ++++++ utils/spacewalk-utils.spec | 12 web/html/applications/rhn-proxy/4.0/httpd/cobbler-proxy.conf | 9 web/html/applications/rhn-proxy/4.0/httpd/httpd.conf | 5 web/html/applications/rhn-proxy/4.0/httpd/rhn_proxy.conf | 3 web/html/applications/rhn-proxy/4.0/install-rhn-proxy.xml | 6 web/html/applications/rhn-proxy/4.1/httpd/cobbler-proxy.conf | 9 web/html/applications/rhn-proxy/4.1/httpd/httpd.conf | 5 web/html/applications/rhn-proxy/4.1/httpd/rhn_proxy.conf | 3 web/html/applications/rhn-proxy/4.1/install-rhn-proxy.xml | 6 web/html/applications/rhn-proxy/4.2/httpd/cobbler-proxy.conf | 9 web/html/applications/rhn-proxy/4.2/httpd/httpd.conf | 5 web/html/applications/rhn-proxy/4.2/httpd/rhn_proxy.conf | 4 web/html/applications/rhn-proxy/4.2/install-rhn-proxy.xml | 6 web/html/applications/rhn-proxy/5.0/httpd/cobbler-proxy.conf | 9 web/html/applications/rhn-proxy/5.0/httpd/httpd.conf | 5 web/html/applications/rhn-proxy/5.0/httpd/rhn_proxy.conf | 3 web/html/applications/rhn-proxy/5.0/install-rhn-proxy.xml | 6 web/html/applications/rhn-proxy/5.1/httpd/cobbler-proxy.conf | 9 web/html/applications/rhn-proxy/5.1/httpd/rhn_proxy.conf | 2 web/html/applications/rhn-proxy/5.1/install-rhn-proxy.xml | 6 web/html/applications/rhn-proxy/5.2/httpd/cobbler-proxy.conf | 9 web/html/applications/rhn-proxy/5.2/httpd/rhn_proxy.conf | 2 web/html/applications/rhn-proxy/5.2/install-rhn-proxy.xml | 6 web/html/applications/rhn-proxy/5.3/cluster.ini | 1 web/spacewalk-web.spec | 5 188 files changed, 3117 insertions(+), 679 deletions(-)
New commits: commit d8500832faa8a3e24970a99ecb6ad8bdbf23930c Merge: 312f96b... 6fe72d0... Author: Pradeep Kilambi pkilambi@redhat.com Date: Mon Jul 27 09:52:10 2009 -0400
Merge branch 'master' into sha256-support
Conflicts: schema/spacewalk/rhnsat/tables/rhnChecksumType.sql schema/spacewalk/rhnsat/tables/rhnChecksumType_data.sql
commit 6fe72d00af2c2663a6a1f621561bc8c6bc1701f0 Author: Jan Pazdziora jpazdziora@redhat.com Date: Mon Jul 27 15:31:58 2009 +0200
osa-dispatcher-selinux is back, in osad-5.9.19-1.*.
diff --git a/spacewalk/package/spacewalk.spec b/spacewalk/package/spacewalk.spec index 0d57fca..d53bea0 100644 --- a/spacewalk/package/spacewalk.spec +++ b/spacewalk/package/spacewalk.spec @@ -62,6 +62,7 @@ Requires: spacewalk-monitoring # Requires: rhn_solaris_bootstrap_5_1_0_3
# SELinux +Requires: osa-dispatcher-selinux %if 0%{?fedora} == 11 %else # Fedora 11 has its own selinux policy for jabberd: @@ -69,7 +70,6 @@ Requires: jabberd-selinux
# Replace these for Fedora 11 when possible: Requires: spacewalk-selinux -Requires: osa-dispatcher-selinux Requires: spacewalk-monitoring-selinux %endif
commit 3e3cf309f23fcf9805f7d3f676b6a7ab3858e82f Author: Jan Pazdziora jpazdziora@redhat.com Date: Mon Jul 27 15:17:06 2009 +0200
Automatic commit of package [osad] release [5.9.19-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec index 3912e05..16a6b60 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/%%7Bname%7D-%%7Bversion%7D.t... -Version: 5.9.18 +Version: 5.9.19 Release: 1%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -236,6 +236,10 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
# $Id$ %changelog +* Mon Jul 27 2009 Jan Pazdziora 5.9.19-1 +- 512732 - on Fedora 11, corenet_udp_bind_lo_node is no longer available +- Build osa-dispatcher-selinux again + * Thu Jul 23 2009 Devan Goodwin dgoodwin@redhat.com 5.9.18-1 - Remove Requires python-optik. (dgoodwin@redhat.com)
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad index 7d7a99e..f7a41a1 100644 --- a/rel-eng/packages/osad +++ b/rel-eng/packages/osad @@ -1 +1 @@ -5.9.18-1 client/tools/osad/ +5.9.19-1 client/tools/osad/
commit 5cfdfa5104c744a9ed13dfa73ca007573825797f Author: Jan Pazdziora jpazdziora@redhat.com Date: Mon Jul 27 14:59:31 2009 +0200
Revert "Disable osad selinux for Fedora 11." -- build osa-dispatcher-selinux again.
This reverts commit 4caf9e06a6268beb6ca5bf455ca6d8d207eaa942.
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec index 6ce5303..3912e05 100644 --- a/client/tools/osad/osad.spec +++ b/client/tools/osad/osad.spec @@ -53,14 +53,10 @@ OSA dispatcher get message from Spacewalk server that some command is need to execute on client. The message is transported via jabber protocol to OSAD agent.
-%define include_selinux_package 1 - %if 0%{?rhel} && 0%{?rhel} <= 4 %define include_selinux_package 0 -%endif - -%if 0%{?fedora} == 11 -%define include_selinux_package 0 +%else +%define include_selinux_package 1 %endif
%if %{include_selinux_package}
commit f2ebf211b1c34f2456bbd38c6715c29b15e97ebc Author: Jan Pazdziora jpazdziora@redhat.com Date: Mon Jul 27 15:01:16 2009 +0200
512732 - on Fedora 11, corenet_udp_bind_lo_node is no longer available.
diff --git a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te index 2454e28..573f5a9 100644 --- a/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te +++ b/client/tools/osad/osa-dispatcher-selinux/osa-dispatcher.te @@ -53,7 +53,10 @@ read_files_pattern(osa_dispatcher_t,httpd_sys_content_t,httpd_sys_content_t)
allow osa_dispatcher_t self:fifo_file rw_fifo_file_perms;
-corenet_udp_bind_lo_node(osa_dispatcher_t) +gen_require(` + type lo_node_t; +') +allow osa_dispatcher_t lo_node_t:udp_socket node_bind; corenet_udp_bind_generic_node(osa_dispatcher_t)
sysnet_dns_name_resolve(osa_dispatcher_t)
commit 657617c5fc9c3589e821fa75d16bcd922b8b2edc Author: Devan Goodwin dgoodwin@redhat.com Date: Mon Jul 27 10:03:44 2009 -0300
Disable jabberd-selinux for Fedora 11 permanently.
F11 has it's own selinux policies for jabberd.
diff --git a/rel-eng/tito.props b/rel-eng/tito.props index 01525f9..8bb9f57 100644 --- a/rel-eng/tito.props +++ b/rel-eng/tito.props @@ -13,3 +13,4 @@ disttag = .el5
[dist-f11-sw-0.6-candidate] disttag = .fc11 +blacklist=jabberd-selinux diff --git a/spacewalk/package/spacewalk.spec b/spacewalk/package/spacewalk.spec index f328895..0d57fca 100644 --- a/spacewalk/package/spacewalk.spec +++ b/spacewalk/package/spacewalk.spec @@ -64,8 +64,11 @@ Requires: spacewalk-monitoring # SELinux %if 0%{?fedora} == 11 %else -Requires: spacewalk-selinux +# Fedora 11 has its own selinux policy for jabberd: Requires: jabberd-selinux + +# Replace these for Fedora 11 when possible: +Requires: spacewalk-selinux Requires: osa-dispatcher-selinux Requires: spacewalk-monitoring-selinux %endif
commit c2eec27920d8da8354918fcb83d81462da108ec8 Author: Partha Aji paji@redhat.com Date: Fri Jul 24 18:56:04 2009 -0400
513683 - Added 'link' as a network device option
diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java index 02850f9..1d2cd51 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ScheduleKickstartWizardAction.java @@ -98,7 +98,8 @@ public class ScheduleKickstartWizardAction extends RhnWizardAction { public static final String TARGET_PROFILE_TYPE = "targetProfileType"; public static final String NETWORK_TYPE_DHCP = "networkTypeDhcp"; public static final String NETWORK_INTERFACE = "networkInterface"; - public static final String NETWORK_INTERFACES = "networkInterfaces"; + public static final String DHCP_NETWORK_INTERFACES = "dhcpNetworkInterfaces"; + public static final String STATIC_NETWORK_INTERFACES = "staticNetworkInterfaces"; /** * {@inheritDoc} */ @@ -191,7 +192,12 @@ public class ScheduleKickstartWizardAction extends RhnWizardAction { itr.remove(); } } - context.getRequest().setAttribute(NETWORK_INTERFACES, nics); + context.getRequest().setAttribute(STATIC_NETWORK_INTERFACES, nics); + List<NetworkInterface> dhcpNics = new LinkedList<NetworkInterface>(nics); + NetworkInterface link = new NetworkInterface(); + link.setName("link"); + dhcpNics.add(0, link); + context.getRequest().setAttribute(DHCP_NETWORK_INTERFACES, dhcpNics); if (form.get(NETWORK_TYPE_DHCP) == null) { form.set(NETWORK_TYPE_DHCP, Boolean.TRUE); } diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java index 942fdbd..ca44b42 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java @@ -1464,7 +1464,8 @@ public class KickstartScheduleCommand extends BaseSystemOperation { }
private ValidatorError validateNetworkInterface() { - if (!StringUtils.isEmpty(networkInterface)) { + if (!StringUtils.isEmpty(networkInterface) && + !(isDhcp && "link".equals(networkInterface))) { boolean nicAvailable = false; for (NetworkInterface nic : server.getNetworkInterfaces()) { if (networkInterface.equals(nic.getName())) { diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/network-options.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/network-options.jspf index db56262..c2cca49 100644 --- a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/network-options.jspf +++ b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/schedule/network-options.jspf @@ -11,7 +11,7 @@ /> <bean:message key="kickstart.netconn.dhcp.jsp.label"/> <c:choose> - <c:when test="${empty requestScope.networkInterfaces}"> + <c:when test="${empty requestScope.dhcpNetworkInterfaces}"> <input type="text" name="networkInterface" id="dhcpNetworkId" size="4" maxlength="10" <c:if test="${not form.networkTypeDhcp}">disabled="true"</c:if> value="${form.networkInterface}"/> @@ -20,7 +20,7 @@ <select name="networkInterface" id="dhcpNetworkId" <c:if test="${not form.networkTypeDhcp}">disabled="true"</c:if> > - <c:forEach var="nic" items="${requestScope.networkInterfaces}"> + <c:forEach var="nic" items="${requestScope.dhcpNetworkInterfaces}"> <option <c:if test="${nic.name == form.networkInterface}">selected="selected"</c:if> value='${nic.name}'>${nic.name}</option> @@ -35,7 +35,7 @@ /> <bean:message key="kickstart.netconn.static.jsp.label"/> <c:choose> - <c:when test="${empty requestScope.networkInterfaces}"> + <c:when test="${empty requestScope.staticNetworkInterfaces}"> <input type="text" name="networkInterface" id="staticNetworkId" size="4" maxlength="10" <c:if test="${form.networkTypeDhcp}">disabled="true"</c:if> value="${form.networkInterface}"/> @@ -44,7 +44,7 @@ <select name="networkInterface" id="staticNetworkId" <c:if test="${form.networkTypeDhcp}">disabled="true"</c:if> > - <c:forEach var="nic" items="${requestScope.networkInterfaces}"> + <c:forEach var="nic" items="${requestScope.staticNetworkInterfaces}"> <option <c:if test="${nic.name == form.networkInterface}">selected="selected"</c:if> value='${nic.name}'>${nic.name}</option>
commit 88e29677361c7051475f4e53a796b5182119bc54 Author: Devan Goodwin dgoodwin@redhat.com Date: Fri Jul 24 17:37:19 2009 -0300
513073 - Fix rhnpush of packages with duplicate requires.
Detects duplicate requires/provides/obsoletes/conflicts based on a hash of name/version/flags.
diff --git a/backend/server/importlib/headerSource.py b/backend/server/importlib/headerSource.py index 0be41d6..e41e854 100644 --- a/backend/server/importlib/headerSource.py +++ b/backend/server/importlib/headerSource.py @@ -209,10 +209,10 @@ class rpmBinaryPackage(Package, rpmPackage): obj = Class() # Fedora 10+ rpms have duplicate provides deps, # Lets clean em up before db inserts. - if tag == 'provides': + if tag in ['requires', 'provides', 'obsoletes', 'conflicts']: if not len(hash['name']): continue - dep_nv = hash['name'] + hash['version'] + dep_nv = (hash['name'], hash['version'], hash['flags'])
if dep_nv not in unique_deps: unique_deps.append(dep_nv) @@ -222,7 +222,6 @@ class rpmBinaryPackage(Package, rpmPackage): # duplicate dep, ignore continue else: - # requires, conflicts, obsoletes lets process as usual obj.populate(hash) self[tag].append(obj)
commit bdb02d37b4d19c13bbf8a244ed9b1fe7357a8731 Author: Pradeep Kilambi pkilambi@redhat.com Date: Fri Jul 24 14:22:45 2009 -0400
Automatic commit of package [spacewalk-backend] release [0.6.25-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec index 9cb3117..1675804 100644 --- a/backend/spacewalk-backend.spec +++ b/backend/spacewalk-backend.spec @@ -7,7 +7,7 @@ Name: spacewalk-backend Summary: Common programs needed to be installed on the Spacewalk servers/proxies Group: Applications/Internet License: GPLv2 -Version: 0.6.24 +Version: 0.6.25 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -572,6 +572,13 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$ %changelog +* Fri Jul 24 2009 Pradeep Kilambi pkilambi@redhat.com 0.6.25-1 +- 513652 - Dumping the debug level so the info shows up only with --debug flag. + (pkilambi@redhat.com) +- 513435 - WebUI creates these for us at the org creation time. So dont try to + insert those at the sync time as ui is not smart enough to check if exists + before inserting a row. (pkilambi@redhat.com) + * Fri Jul 24 2009 Jan Pazdziora 0.6.24-1 - add spacewalk-report script and inventory report.
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend index 85034a3..8171b9c 100644 --- a/rel-eng/packages/spacewalk-backend +++ b/rel-eng/packages/spacewalk-backend @@ -1 +1 @@ -0.6.24-1 backend/ +0.6.25-1 backend/
commit d0cde03dda87cc4d7f582a31ddcb343fb38ec070 Author: Pradeep Kilambi pkilambi@redhat.com Date: Fri Jul 24 14:17:42 2009 -0400
513652 - Dumping the debug level so the info shows up only with --debug flag.
diff --git a/backend/satellite_tools/sync_handlers.py b/backend/satellite_tools/sync_handlers.py index 48645ef..f1de603 100644 --- a/backend/satellite_tools/sync_handlers.py +++ b/backend/satellite_tools/sync_handlers.py @@ -211,7 +211,8 @@ def import_channels(channels, orgid=None): family['label'] = 'private-channel-family-' + \ str(c_obj['org_id'])
- syncLib.log(1, "Syncing Channel to Org %s " % c_obj['org_id']) + syncLib.log(6, "Syncing Channel %s to Org %s " % \ + (c_obj['label'], c_obj['org_id'])) batch.append(c_obj)
importer = channelImport.ChannelImport(batch, diskImportLib.get_backend())
commit d0b940d026b70d914a7ea66c861304c37859efd3 Author: Pradeep Kilambi pkilambi@redhat.com Date: Fri Jul 24 14:13:03 2009 -0400
513435 - WebUI creates these for us at the org creation time. So dont try to insert those at the sync time as ui is not smart enough to check if exists before inserting a row.
diff --git a/backend/server/importlib/channelImport.py b/backend/server/importlib/channelImport.py index 1d96598..7d2b43d 100644 --- a/backend/server/importlib/channelImport.py +++ b/backend/server/importlib/channelImport.py @@ -17,6 +17,7 @@
from importLib import Import, InvalidArchError, \ InvalidChannelError, InvalidChannelFamilyError, MissingParentChannelError +from common import CFG
class ChannelImport(Import): def __init__(self, batch, backend): @@ -187,7 +188,10 @@ class ChannelImport(Import): self.backend.commit()
class ChannelFamilyImport(Import): - def preprocess(self): + def preprocess(self): + if CFG.ISS_PARENT: + # Filter out private channel families from ISS syncs + self.__filterCustomChannelFamilies() # We have to look up the channels for this channel family first self.channels = {} for cf in self.batch: @@ -217,6 +221,16 @@ class ChannelFamilyImport(Import): raise self.backend.commit()
+ def __filterCustomChannelFamilies(self): + """Filter out private channel families from ISS syncs. WebUI + creates these for us at the org creation time. + """ + new_batch = [] + for cf in self.batch: + if not cf['label'].startswith("private-channel-family"): + new_batch.append(cf) + self.batch = new_batch + class ChannelFamilyPermissionsImport(Import): def __init__(self, batch, backend): Import.__init__(self, batch, backend)
commit 4dd630505f3866ccea60cd28e594000fc200cfdf Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 16:41:22 2009 +0200
Automatic commit of package [spacewalk-backend] release [0.6.24-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec index 01c3eef..9cb3117 100644 --- a/backend/spacewalk-backend.spec +++ b/backend/spacewalk-backend.spec @@ -7,7 +7,7 @@ Name: spacewalk-backend Summary: Common programs needed to be installed on the Spacewalk servers/proxies Group: Applications/Internet License: GPLv2 -Version: 0.6.23 +Version: 0.6.24 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -572,6 +572,9 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$ %changelog +* Fri Jul 24 2009 Jan Pazdziora 0.6.24-1 +- add spacewalk-report script and inventory report. + * Thu Jul 23 2009 Pradeep Kilambi pkilambi@redhat.com 0.6.23-1 - 513432, 513435 : Our channel family import is written such that we compare and resync the red hat channel families. But in iss case we can have provate diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend index bfb1562..85034a3 100644 --- a/rel-eng/packages/spacewalk-backend +++ b/rel-eng/packages/spacewalk-backend @@ -1 +1 @@ -0.6.23-1 backend/ +0.6.24-1 backend/
commit 5b824796fe66357ed1e99008e260db66e4cf791d Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 16:13:16 2009 +0200
reporting: add man page for spacewalk-report.
diff --git a/backend/satellite_tools/spacewalk-report.sgml b/backend/satellite_tools/spacewalk-report.sgml new file mode 100644 index 0000000..5f8c5c2 --- /dev/null +++ b/backend/satellite_tools/spacewalk-report.sgml @@ -0,0 +1,119 @@ +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN"> + +<refentry> + +<RefMeta> +<RefEntryTitle>spacewalk-report</RefEntryTitle><manvolnum>8</manvolnum> +</RefMeta> + +<RefNameDiv> +<RefName><command>spacewalk-report</command></RefName> +<RefPurpose> +Generate reports from Spacewalk server in csv format +</RefPurpose> +</RefNameDiv> + +<RefSynopsisDiv> +<Synopsis> + <cmdsynopsis> + <command>spacewalk-report</command> + <arg>--db=<replaceable>connect_string</replaceable></arg> + </cmdsynopsis> + <cmdsynopsis> + <command>spacewalk-report</command> + <sbr /> + <group> + <arg>--multival-on-rows</arg> + <arg>--multival-separator=<replaceable>separator-string</replaceable></arg> + </group> + <sbr /> + <arg>--db=<replaceable>connect-string</replaceable></arg> + <sbr /> + <arg choice='plain'><replaceable>report-name</replaceable></arg> + <sbr /> + <arg>--list-fields</arg> + <sbr /> + <arg choice='plain'>other report specific options</arg> + </cmdsynopsis> +</Synopsis> +</RefSynopsisDiv> + +<RefSect1><Title>Description</Title> +<para> + The <command>spacewalk-report</command> command can be used to + generate canned reports from Spacewalk server database. The report + which will be generated is selected by specifying its name as + a parameter to <command>spacewalk-report</command>. +</para> + +<para> + The command takes some general options, specified on the command + line before the report name. Each report may have a set of + report-specific options, those are placed on the command line + after the report name. +</para> + +<para> + If the report name is not specified, list of available report + names is printed, one name per line. +</para> + +<RefSect1><Title>General Options</Title> +<variablelist> + <varlistentry> + <term>--multival-on-rows</term> + <listitem> + <para>If certain field can have multiple values, you can + use this option to have records for the entity repeated + in output in the form of cartesian product. By default, + those multiple values are presented on one row in one + field, separated by semicolon.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>--multival-separator=<replaceable>separator-string</replaceable></term> + <listitem> + <para>If multiple values are output on one row (the + default), this option can change the string which + separates multiple values in one field. The default is + semicolon.</para> + </listitem> + </varlistentry> + <varlistentry> + <term>--db=<replaceable>connect-string</replaceable></term> + <listitem> + <para>Database connect string in the form of + <replaceable>username/password@dbname</replaceable> can be + specified to generated report from user-defined database. + By default, connect string from default_db option from + /etc/rhn/rhn.conf is used.</para> + <para>This option should be considered obsoleted and may + not be available in next versions of + <command>spacewalk-report</command>. + </listitem> + </varlistentry> +</variablelist> +</RefSect1> + +<RefSect1><Title>Report-specific Options</Title> +<variablelist> + <varlistentry> + <term>--list-fields</term> + <listitem> + <para>Instead of running the report, shows fields that the + report has, one field name per line.</para> + </listitem> + </varlistentry> +</variablelist> +</RefSect1> + +<RefSect1><Title>Authors</Title> +<simplelist> + <member>Jan Pazdziora</member> +</simplelist> +</RefSect1> +</RefEntry> + +<!-- +vim: sw=4 +--> diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec index 4e89aa2..01c3eef 100644 --- a/backend/spacewalk-backend.spec +++ b/backend/spacewalk-backend.spec @@ -546,6 +546,7 @@ rm -f %{rhnconf}/rhnSecret.py* %{_mandir}/man8/rhn-db-stats.8* %{_mandir}/man8/satellite-sync.8* %{_mandir}/man8/spacewalk-debug.8* +%{_mandir}/man8/spacewalk-report.8* %{_mandir}/man8/satpasswd.8* %{_mandir}/man8/satwho.8*
commit 6ea8f3ce6484860dfd1ede600a57d4d1ac917a78 Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 16:06:39 2009 +0200
reporting: change the --fields option to --show-fields.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index bd831a2..eb80584 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -74,8 +74,9 @@ def processCommandlineReport(report): """ process the commandline options for one report """
optionsTable = [ - Option('--fields', action='store_true', - help='show fields of the report'), + Option('--list-fields', action='store_true', + dest='listfields', + help='list fields of the report instead of running the report'), ] optionParserReport = OptionParser( usage="options for report %s" % report, @@ -99,7 +100,7 @@ if __name__ == '__main__': except(reports.spacewalk_unknown_report): systemExit(-4, 'Unknown report [%s].' % report_name)
- if report_options.fields: + if report_options.listfields: for c in report.columns: print c sys.exit(0)
commit 75c6620b424300984da54fa90a9269e0089cb5fc Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 15:25:31 2009 +0200
reporting: add hardware info -- number of CPUs, and list of network interfaces.
diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory index 5d334bb..fe75a2c 100755 --- a/backend/satellite_tools/reports/data/inventory +++ b/backend/satellite_tools/reports/data/inventory @@ -18,6 +18,7 @@ columns: organization virtual_host architecture + hardware
multival_columns:
@@ -50,7 +51,12 @@ sql: virtual_data.host_system_id as virtual_host, ( select rhnserverarch.name from rhnserverarch where rhnserver.server_arch_id = rhnserverarch.id - ) as architecture + ) as architecture, + ( + ( + select count(*) || ' CPUs' from rhncpu where rhnserver.id = rhncpu.server_id + ) || network_data.col + ) as hardware from rhnserver, ( select server_id, hostname, ipaddr @@ -79,7 +85,20 @@ sql: select host_system_id, virtual_system_id from rhnvirtualinstance where host_system_id is not null - ) virtual_data + ) virtual_data, + ( + select server_id, max(sys_connect_by_path(val, '; ')) col + from ( + select server_id, + name||' '||ip_addr||'/'||netmask||' '||hw_addr val, + row_number() over (partition by server_id order by name, rowid) rn + from rhnservernetinterface + ) + start with rn = 1 + connect by prior rn = rn - 1 + and prior server_id = server_id + group by server_id + ) network_data where rhnserver.id = rhnservernetwork.server_id (+) and rhnserver.id = rhnserverchannel.server_id (+) and rhnserverchannel.channel_id = rhnchannel.id (+) @@ -88,6 +107,7 @@ sql: and rhnserver.id = entitlement_data.server_id (+) and rhnserver.id = group_data.server_id (+) and rhnserver.id = virtual_data.virtual_system_id (+) + and rhnserver.id = network_data.server_id (+) order by server_id, rhnchannel.parent_channel nulls first, rhnchannel.id, rhnconfigchannel.id, entitlement_data.server_group_id, group_data.server_group_id, virtual_data.host_system_id
commit e8488469561c7bfb2e53b0d2c4557ff18ffe170e Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 15:22:48 2009 +0200
reporting: add system architecture to the inventory report.
diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory index bc12d9f..5d334bb 100755 --- a/backend/satellite_tools/reports/data/inventory +++ b/backend/satellite_tools/reports/data/inventory @@ -17,6 +17,7 @@ columns: system_group organization virtual_host + architecture
multival_columns:
@@ -46,7 +47,10 @@ sql: ( select name from web_customer where rhnserver.org_id = web_customer.id ) as organization, - virtual_data.host_system_id as virtual_host + virtual_data.host_system_id as virtual_host, + ( + select rhnserverarch.name from rhnserverarch where rhnserver.server_arch_id = rhnserverarch.id + ) as architecture from rhnserver, ( select server_id, hostname, ipaddr
commit 847e45da3e4e0e75eb3b49ac4e27e944f6adcdf9 Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 15:21:52 2009 +0200
reporting: add virtual host association.
diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory index a7cf8a1..bc12d9f 100755 --- a/backend/satellite_tools/reports/data/inventory +++ b/backend/satellite_tools/reports/data/inventory @@ -16,6 +16,7 @@ columns: entitlements system_group organization + virtual_host
multival_columns:
@@ -24,6 +25,7 @@ multival_columns: configuration_channel : configuration_channel entitlements : entitlements system_group : system_group + virtual_host : virtual_host
sql:
@@ -43,7 +45,8 @@ sql: group_data.name as system_group, ( select name from web_customer where rhnserver.org_id = web_customer.id - ) as organization + ) as organization, + virtual_data.host_system_id as virtual_host from rhnserver, ( select server_id, hostname, ipaddr @@ -67,7 +70,12 @@ sql: from rhnservergroupmembers, rhnservergroup where rhnservergroupmembers.server_group_id = rhnservergroup.id (+) and rhnservergroup.group_type is null - ) group_data + ) group_data, + ( + select host_system_id, virtual_system_id + from rhnvirtualinstance + where host_system_id is not null + ) virtual_data where rhnserver.id = rhnservernetwork.server_id (+) and rhnserver.id = rhnserverchannel.server_id (+) and rhnserverchannel.channel_id = rhnchannel.id (+) @@ -75,6 +83,8 @@ sql: and rhnserverconfigchannel.config_channel_id = rhnconfigchannel.id (+) and rhnserver.id = entitlement_data.server_id (+) and rhnserver.id = group_data.server_id (+) + and rhnserver.id = virtual_data.virtual_system_id (+) order by server_id, rhnchannel.parent_channel nulls first, rhnchannel.id, - rhnconfigchannel.id, entitlement_data.server_group_id, group_data.server_group_id + rhnconfigchannel.id, entitlement_data.server_group_id, group_data.server_group_id, + virtual_data.host_system_id
commit bb75c84ff103c42da3ae97bc9866e3ac4e702821 Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 15:19:40 2009 +0200
reporting: add organization membership.
diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory index 7adce63..a7cf8a1 100755 --- a/backend/satellite_tools/reports/data/inventory +++ b/backend/satellite_tools/reports/data/inventory @@ -15,6 +15,7 @@ columns: configuration_channel entitlements system_group + organization
multival_columns:
@@ -39,7 +40,10 @@ sql: rhnchannel.name as software_channel, rhnconfigchannel.name as configuration_channel, entitlement_data.name as entitlements, - group_data.name as system_group + group_data.name as system_group, + ( + select name from web_customer where rhnserver.org_id = web_customer.id + ) as organization from rhnserver, ( select server_id, hostname, ipaddr
commit 4edb190118a9b50f951a7a244efbb1a938d88059 Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 15:18:33 2009 +0200
reporting: add entitlements and system groups.
diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory index 0d1a157..7adce63 100755 --- a/backend/satellite_tools/reports/data/inventory +++ b/backend/satellite_tools/reports/data/inventory @@ -13,12 +13,16 @@ columns: errata_out_of_date software_channel configuration_channel + entitlements + system_group
multival_columns:
server_id software_channel : software_channel configuration_channel : configuration_channel + entitlements : entitlements + system_group : system_group
sql:
@@ -33,7 +37,9 @@ sql: and rhnserverneededpackagecache.package_id = rhnpackage.id ) as packages_out_of_date, ( select count(*) from rhnServerErrataTypeView where rhnserver.id = server_id ) as errata_out_of_date, rhnchannel.name as software_channel, - rhnconfigchannel.name as configuration_channel + rhnconfigchannel.name as configuration_channel, + entitlement_data.name as entitlements, + group_data.name as system_group from rhnserver, ( select server_id, hostname, ipaddr @@ -45,12 +51,26 @@ sql: ) ) rhnservernetwork, rhnserverchannel, rhnchannel, - rhnserverconfigchannel, rhnconfigchannel + rhnserverconfigchannel, rhnconfigchannel, + ( + select rhnservergroupmembers.server_id, rhnservergroupmembers.server_group_id, rhnservergroup.name + from rhnservergroupmembers, rhnservergroup + where rhnservergroupmembers.server_group_id = rhnservergroup.id (+) + and rhnservergroup.group_type is not null + ) entitlement_data, + ( + select rhnservergroupmembers.server_id, rhnservergroupmembers.server_group_id, rhnservergroup.name + from rhnservergroupmembers, rhnservergroup + where rhnservergroupmembers.server_group_id = rhnservergroup.id (+) + and rhnservergroup.group_type is null + ) group_data where rhnserver.id = rhnservernetwork.server_id (+) and rhnserver.id = rhnserverchannel.server_id (+) and rhnserverchannel.channel_id = rhnchannel.id (+) and rhnserver.id = rhnserverconfigchannel.server_id (+) and rhnserverconfigchannel.config_channel_id = rhnconfigchannel.id (+) + and rhnserver.id = entitlement_data.server_id (+) + and rhnserver.id = group_data.server_id (+) order by server_id, rhnchannel.parent_channel nulls first, rhnchannel.id, - rhnconfigchannel.id + rhnconfigchannel.id, entitlement_data.server_group_id, group_data.server_group_id
commit 14ea93bfd94eea8906900b0cded55eacb36659c7 Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 15:16:09 2009 +0200
reporting: fix the logic in spacewalk-report to avoid having duplicated values.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index 5d2f911..bd831a2 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -118,38 +118,40 @@ if __name__ == '__main__': "Columns in report spec and in the database do not match:\nexpected %s\n got %s" % ( report.columns, db_columns )) writer.writerow(report.columns)
- multival_keys = sorted(report.multival_columns_stop + report.multival_columns_reverted.keys()) - row = h.fetchone() prevrow = None outrow = None + multival_dupes = {} while row != None: if options.multivalonrows: writer.writerow(row) row = h.fetchone() continue
- if outrow == None: - outrow = [ x for x in row ] - else: - go = True - for m in multival_keys: + if outrow != None: + for m in report.multival_columns_stop: + if prevrow[m] != row[m]: + writer.writerow(outrow) + outrow = None + break + + if outrow != None: + for m in report.multival_columns_reverted.keys(): if prevrow[m] != row[m]: - if m in report.multival_columns_reverted: - for v in report.multival_columns_reverted[m]: - outrow[v] = str(outrow[v]) + options.multivalseparator + str(row[v]) - go = False - break - else: - break - if not go: + if not m in multival_dupes: + multival_dupes[m] = {} + if not row[m] in multival_dupes[m]: + outrow[m] = str(outrow[m]) + options.multivalseparator + str(row[m]) + multival_dupes[m][row[m]] = 1 break
- if go: - writer.writerow(outrow) - outrow = [ x for x in row ] + if outrow == None: + outrow = [ x for x in row ] + multival_dupes = {} + prevrow = row row = h.fetchone() + if outrow != None: writer.writerow(outrow) else:
commit 5e06b348bf5acd747dde84ed03321902fd5ce234 Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 09:48:42 2009 +0200
reporting: add the configuration channel to the report.
diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory index 1423fc8..0d1a157 100755 --- a/backend/satellite_tools/reports/data/inventory +++ b/backend/satellite_tools/reports/data/inventory @@ -12,11 +12,13 @@ columns: packages_out_of_date errata_out_of_date software_channel + configuration_channel
multival_columns:
server_id software_channel : software_channel + configuration_channel : configuration_channel
sql:
@@ -30,7 +32,8 @@ sql: where rhnserver.id = rhnserverneededpackagecache.server_id and rhnserverneededpackagecache.package_id = rhnpackage.id ) as packages_out_of_date, ( select count(*) from rhnServerErrataTypeView where rhnserver.id = server_id ) as errata_out_of_date, - rhnchannel.name as software_channel + rhnchannel.name as software_channel, + rhnconfigchannel.name as configuration_channel from rhnserver, ( select server_id, hostname, ipaddr @@ -41,9 +44,13 @@ sql: group by server_id ) ) rhnservernetwork, - rhnserverchannel, rhnchannel + rhnserverchannel, rhnchannel, + rhnserverconfigchannel, rhnconfigchannel where rhnserver.id = rhnservernetwork.server_id (+) and rhnserver.id = rhnserverchannel.server_id (+) and rhnserverchannel.channel_id = rhnchannel.id (+) - order by server_id, rhnchannel.parent_channel nulls first, rhnchannel.id + and rhnserver.id = rhnserverconfigchannel.server_id (+) + and rhnserverconfigchannel.config_channel_id = rhnconfigchannel.id (+) + order by server_id, rhnchannel.parent_channel nulls first, rhnchannel.id, + rhnconfigchannel.id
commit 2a5dbae1c9258bdb96df78152ff66b92071fff66 Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 09:43:35 2009 +0200
reporting: add the --multival-separator option (semicolon is the default).
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index 7384f98..5d2f911 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -51,6 +51,10 @@ def processCommandline(): optionsTable = [ Option('--multival-on-rows', action='store_true', dest='multivalonrows', help='if there are multiple values for certain field, repeat the rows'), + Option('--multival-separator', action='store', dest='multivalseparator', + default=';', + help='if there are multiple values for certain field, separate them with this string' \ + ' (unless --multival-on-rows)'), Option('--db', action='store', type="string", help='alternative database string (username/password@sid);' \ + ' default is default_db from /etc/rhn/rhn.conf'), @@ -133,7 +137,7 @@ if __name__ == '__main__': if prevrow[m] != row[m]: if m in report.multival_columns_reverted: for v in report.multival_columns_reverted[m]: - outrow[v] = str(outrow[v]) + ';' + str(row[v]) + outrow[v] = str(outrow[v]) + options.multivalseparator + str(row[v]) go = False break else:
commit c1f2d53585dbf80d9eed8ea3ee5ef276e571456e Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Jul 24 09:40:17 2009 +0200
reporting: make merging multiple values the default, and add the --multival-on-rows option to prevent it.
diff --git a/backend/satellite_tools/reports.py b/backend/satellite_tools/reports.py index b584347..d947244 100644 --- a/backend/satellite_tools/reports.py +++ b/backend/satellite_tools/reports.py @@ -12,6 +12,10 @@ class report: full_path = os.path.join(REPORT_DEFINITIONS, name) self.sql = None self.columns = None + self.column_indexes = None + self.multival_column_names = {} + self.multival_columns_reverted = {} + self.multival_columns_stop = [] self._load(full_path)
def _load(self, full_path): @@ -42,9 +46,51 @@ class report: if tag != None: self._set(tag, value)
+ if self.multival_column_names != None: + unknown_columns = [] + + for c in self.multival_column_names: + if c in self.column_indexes: + c_id = self.column_indexes[c] + v = self.multival_column_names[c] + if v == None: + self.multival_columns_stop.append(c_id) + elif v in self.column_indexes: + v_id = self.column_indexes[v] + if v_id in self.multival_columns_reverted: + self.multival_columns_reverted[v_id].append(c_id) + else: + self.multival_columns_reverted[v_id] = [ c_id ] + else: + unknown_columns.append(c) + if len(unknown_columns) > 0: + raise spacewalk_report_unknown_multival_column_exception(unknown_columns) + + def _set(self, tag, value): if tag == 'columns': self.columns = filter(lambda x: x != '', re.split('\s+', value)) + # set mapping from column name to column position in column_indexes + self.column_indexes = {} + i = 0 + for c in self.columns: + self.column_indexes[c] = i + i = i + 1 + elif tag == 'multival_columns': + # the multival_columns specifies either + # a "stop" column, usually the first one, + # or a pair of column names separated by colon, + # where the first on is column which should be + # joined together and the second one is column + # whose value should be used to distinguish if + # we still have the same entity or not. + for l in filter(lambda x: x != '', re.split('\n', value)): + m = re.match('^\s*(\S+?)(\s*:\s*(\S*)\s*)?$', l) + if m == None: + continue + ( col, id_col ) = ( m.group(1), m.group(3) ) + if col != None: + self.multival_column_names[col] = id_col elif tag == 'sql': self.sql = value else: @@ -57,3 +103,6 @@ class spacewalk_unknown_report(Exception): class spacewalk_report_unknown_tag_exception(Exception): pass
+class spacewalk_report_unknown_multival_column_exception(Exception): + pass + diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory index 1921ccb..1423fc8 100755 --- a/backend/satellite_tools/reports/data/inventory +++ b/backend/satellite_tools/reports/data/inventory @@ -13,6 +13,11 @@ columns: errata_out_of_date software_channel
+multival_columns: + + server_id + software_channel : software_channel + sql:
select rhnserver.id as server_id, rhnserver.name as profile_name, diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index 48c1357..7384f98 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -49,6 +49,8 @@ except KeyboardInterrupt: def processCommandline(): """ process the commandline """ optionsTable = [ + Option('--multival-on-rows', action='store_true', dest='multivalonrows', + help='if there are multiple values for certain field, repeat the rows'), Option('--db', action='store', type="string", help='alternative database string (username/password@sid);' \ + ' default is default_db from /etc/rhn/rhn.conf'), @@ -112,10 +114,40 @@ if __name__ == '__main__': "Columns in report spec and in the database do not match:\nexpected %s\n got %s" % ( report.columns, db_columns )) writer.writerow(report.columns)
+ multival_keys = sorted(report.multival_columns_stop + report.multival_columns_reverted.keys()) + row = h.fetchone() + prevrow = None + outrow = None while row != None: - writer.writerow(row) + if options.multivalonrows: + writer.writerow(row) + row = h.fetchone() + continue + + if outrow == None: + outrow = [ x for x in row ] + else: + go = True + for m in multival_keys: + if prevrow[m] != row[m]: + if m in report.multival_columns_reverted: + for v in report.multival_columns_reverted[m]: + outrow[v] = str(outrow[v]) + ';' + str(row[v]) + go = False + break + else: + break + if not go: + break + + if go: + writer.writerow(outrow) + outrow = [ x for x in row ] + prevrow = row row = h.fetchone() + if outrow != None: + writer.writerow(outrow) else: for r in reports.available_reports(): print r
commit e8f6177222045bc30a6e0818cdd3aa36bea2d659 Author: Partha Aji paji@redhat.com Date: Fri Jul 24 00:05:45 2009 -0400
515539 - Made the cobbler create system record command always delete and create a new version of system
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java index 00b7abe..09ad45d 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java @@ -150,14 +150,7 @@ public class CobblerSystemCreateCommand extends CobblerCommand { sysname = (String) sysmap.get("name"); } } - if (sysname != null) { - String handle = (String) invokeXMLRPC("get_system_handle", - sysname, xmlRpcToken); - log.debug("getSystemHandleByMAC.returning handle: " + handle); - return handle; - } - - return null; + return sysname; }
private Map getSystemMapByMac() { @@ -209,27 +202,30 @@ public class CobblerSystemCreateCommand extends CobblerCommand { * @return ValidatorError if the store failed. */ public ValidatorError store() { - String handle = null; // First lookup by MAC addr - handle = lookupExisting(); - if (handle == null) { + String sysName = lookupExisting(); + if (sysName == null) { // Next try by name try { - handle = (String) invokeXMLRPC("get_system_handle", + String handle = (String) invokeXMLRPC("get_system_handle", getCobblerSystemRecordName(), xmlRpcToken); + if (!StringUtils.isBlank(handle)) { + sysName = getCobblerSystemRecordName(); + } log.debug("Did we find handle by name: " + handle); } catch (RuntimeException e) { log.debug("No system by that name either. create a new one"); } } - // Else, lets make a new system - if (handle == null) { - handle = (String) invokeXMLRPC("new_system", xmlRpcToken); - log.debug("handle: " + handle); - invokeXMLRPC("modify_system", handle, "name", getCobblerSystemRecordName(), - xmlRpcToken); + if (!StringUtils.isBlank(sysName)) { + invokeXMLRPC("remove_system", sysName, xmlRpcToken); + invokeCobblerUpdate(); } + String handle = (String) invokeXMLRPC("new_system", xmlRpcToken); + log.debug("handle: " + handle); + invokeXMLRPC("modify_system", handle, "name", getCobblerSystemRecordName(), + xmlRpcToken);
if (this.server.getNetworkInterfaces() != null && !this.server.getNetworkInterfaces().isEmpty()) { @@ -321,10 +317,9 @@ public class CobblerSystemCreateCommand extends CobblerCommand { if (!StringUtils.isBlank(n.getNetmask())) { inet.put("subnet-" + n.getName(), n.getNetmask()); } - if (!StringUtils.isBlank(staticNetwork) && - n.getName().equals(staticNetwork)) { - inet.put("static-" + n.getName(), Boolean.TRUE); - } + inet.put("static-" + n.getName(), + !StringUtils.isBlank(staticNetwork) && + n.getName().equals(staticNetwork)); } } log.debug("Networks: " + inet);
commit 0082f6412e4a55b8de665278056645e99764f3d0 Author: Partha Aji paji@redhat.com Date: Thu Jul 23 19:20:58 2009 -0400
512440 - Fixed the proxies to turn SSLProxyEngine to deal with Cobbler KS files
diff --git a/web/html/applications/rhn-proxy/5.0/httpd/rhn_proxy.conf b/web/html/applications/rhn-proxy/5.0/httpd/rhn_proxy.conf index 7699ae6..9729ab7 100644 --- a/web/html/applications/rhn-proxy/5.0/httpd/rhn_proxy.conf +++ b/web/html/applications/rhn-proxy/5.0/httpd/rhn_proxy.conf @@ -52,3 +52,6 @@ RewriteRule ^/rhn/?$ https://%%7BSERVER_NAME%7D/rhn/ [R,L] </IfModule>
+#Disable SSL2, left only higher +SSLProtocol all -SSLv2 +SSLProxyEngine on
commit d5df7da09e32ff9d5e5a814a17d5d50ff7471bb5 Author: Partha Aji paji@redhat.com Date: Thu Jul 23 18:52:03 2009 -0400
510299 & 510785- Fixed issues pertaining to static network and upgrade.
diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java index ae19e78..c7a5108 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java @@ -871,7 +871,7 @@ public class KickstartFactory extends HibernateFactory { * @param tree to lookup by * @return List of KickstartData objects if found */ - public static List lookupKickstartDatasByTree(KickstartableTree tree) { + public static List<KickstartData> lookupKickstartDatasByTree(KickstartableTree tree) { String query = "KickstartData.lookupByTreeId"; Session session = HibernateFactory.getSession(); return session.getNamedQuery(query) @@ -1023,4 +1023,5 @@ public class KickstartFactory extends HibernateFactory { Session session = HibernateFactory.getSession(); return (List<KickstartableTree>) session.getNamedQuery(query).list(); } + } 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 cb90be6..bdddc4c 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 @@ -4062,6 +4062,9 @@ public class SystemHandler extends BaseHandler { String hostName = (String)data.get("hostname"); String command = KickstartFormatter.makeStaticNetworkCommand(device, ip, gateway, nameservers.get(0), netmask, hostName); + rec.setHostName(hostName); + rec.setGateway(gateway); + rec.setNameServers(nameservers); Map<String, Object> meta = rec.getKsMeta(); meta.put(KickstartFormatter.STATIC_NETWORK_VAR, command); rec.setKsMeta(meta); diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java index ff57259..942fdbd 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java @@ -576,6 +576,9 @@ public class KickstartScheduleCommand extends BaseSystemOperation { cmd.setKernelOptions(getExtraOptions()); cmd.setPostKernelOptions(postKernelOptions); cmd.setScheduledAction(kickstartAction); + if (!isDhcp) { + cmd.setStaticNetwork(networkInterface); + } ValidatorError cobblerError = cmd.store(); if (cobblerError != null) { return cobblerError; @@ -589,6 +592,9 @@ public class KickstartScheduleCommand extends BaseSystemOperation { cmd.setKernelOptions(kernelOptions); cmd.setPostKernelOptions(postKernelOptions); cmd.setScheduledAction(kickstartAction); + if (!isDhcp) { + cmd.setStaticNetwork(networkInterface); + } ValidatorError cobblerError = cmd.store(); if (cobblerError != null) { return cobblerError; diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCreateCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCreateCommand.java index e24207c..e8e07d4 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCreateCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCreateCommand.java @@ -15,6 +15,8 @@ package com.redhat.rhn.manager.kickstart.cobbler;
import com.redhat.rhn.common.validator.ValidatorError; +import com.redhat.rhn.domain.kickstart.KickstartData; +import com.redhat.rhn.domain.kickstart.KickstartFactory; import com.redhat.rhn.domain.kickstart.KickstartableTree; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.manager.kickstart.KickstartUrlHelper; @@ -23,6 +25,7 @@ import org.apache.log4j.Logger; import org.cobbler.Distro;
import java.util.HashMap; +import java.util.List; import java.util.Map;
/** @@ -95,10 +98,17 @@ public class CobblerDistroCreateCommand extends CobblerDistroCommand { }
if (syncProfiles) { - CobblerProfileSyncCommand syncer = new CobblerProfileSyncCommand(); - syncer.store(); + List<KickstartData> profiles = KickstartFactory. + lookupKickstartDatasByTree(tree); + for (KickstartData profile : profiles) { + createProfile(profile); + } } return null; }
+ private void createProfile(KickstartData profile) { + CobblerProfileCreateCommand creator = new CobblerProfileCreateCommand(profile); + creator.store(); + } } diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileSyncCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileSyncCommand.java index a9f8b53..7c83dc8 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileSyncCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileSyncCommand.java @@ -70,12 +70,10 @@ public class CobblerProfileSyncCommand extends CobblerCommand { public ValidatorError store() { //First are there any profiles within spacewalk that aren't within cobbler List<KickstartData> profiles = KickstartFactory.listAllKickstartData(); - - Map<String, Map> profileNames = getModifiedProfileNames(); for (KickstartData profile : profiles) { if (!profileNames.containsKey(profile.getCobblerId())) { - if (profile.getKickstartDefaults().getKstree().getCobblerId() != null) { + if (profile.getKickstartDefaults().getKstree().getCobblerId() == null) { log.warn("Kickstart profile " + profile.getLabel() + " could not be synced to cobbler, due to it's " + "tree being unsynced. Please edit the tree url " + diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java index 853dd7b..00b7abe 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java @@ -55,6 +55,14 @@ public class CobblerSystemCreateCommand extends CobblerCommand { private String kickstartHost; private String kernelOptions; private String postKernelOptions; + private String staticNetwork; + + /** + * @param staticNetworkIn The staticNetwork to set. + */ + public void setStaticNetwork(String staticNetworkIn) { + staticNetwork = staticNetworkIn; + }
/** * Constructor @@ -313,6 +321,10 @@ public class CobblerSystemCreateCommand extends CobblerCommand { if (!StringUtils.isBlank(n.getNetmask())) { inet.put("subnet-" + n.getName(), n.getNetmask()); } + if (!StringUtils.isBlank(staticNetwork) && + n.getName().equals(staticNetwork)) { + inet.put("static-" + n.getName(), Boolean.TRUE); + } } } log.debug("Networks: " + inet); diff --git a/java/code/src/org/cobbler/SystemRecord.java b/java/code/src/org/cobbler/SystemRecord.java index 32bcd50..234ad40 100644 --- a/java/code/src/org/cobbler/SystemRecord.java +++ b/java/code/src/org/cobbler/SystemRecord.java @@ -27,6 +27,7 @@ import java.util.Set; */
public class SystemRecord extends CobblerObject { + private static final String HOSTNAME = "hostname"; private static final String NAME_SERVERS = "name_servers"; private static final String GATEWAY = "gateway"; private static final String PROFILE = "profile"; @@ -306,7 +307,7 @@ public class SystemRecord extends CobblerObject { /** * @param nameServersIn the NameServers */ - public void setNameServers(String nameServersIn) { + public void setNameServers(List<String> nameServersIn) { modify(NAME_SERVERS, nameServersIn); }
@@ -316,4 +317,10 @@ public class SystemRecord extends CobblerObject { public void setGateway(String gateway) { modify(GATEWAY, gateway); } + /** + * @param hostname the hostname + */ + public void setHostName(String hostname) { + modify(HOSTNAME, hostname); + } }
commit cd92c65cf39ec26dabf3889ad4a6d17c713e1abb Author: Partha Aji paji@redhat.com Date: Thu Jul 23 16:45:51 2009 -0400
512440 - Fixed the proxies to turn SSLProxyEngine to deal with Cobbler KS files
diff --git a/web/html/applications/rhn-proxy/4.0/httpd/rhn_proxy.conf b/web/html/applications/rhn-proxy/4.0/httpd/rhn_proxy.conf index fba9c9e..4832797 100644 --- a/web/html/applications/rhn-proxy/4.0/httpd/rhn_proxy.conf +++ b/web/html/applications/rhn-proxy/4.0/httpd/rhn_proxy.conf @@ -44,3 +44,6 @@ DefaultType text/plain </LocationMatch>
+#Disable SSL2, left only higher +SSLProtocol all -SSLv2 +SSLProxyEngine on diff --git a/web/html/applications/rhn-proxy/4.1/httpd/rhn_proxy.conf b/web/html/applications/rhn-proxy/4.1/httpd/rhn_proxy.conf index fba9c9e..4832797 100644 --- a/web/html/applications/rhn-proxy/4.1/httpd/rhn_proxy.conf +++ b/web/html/applications/rhn-proxy/4.1/httpd/rhn_proxy.conf @@ -44,3 +44,6 @@ DefaultType text/plain </LocationMatch>
+#Disable SSL2, left only higher +SSLProtocol all -SSLv2 +SSLProxyEngine on diff --git a/web/html/applications/rhn-proxy/4.2/httpd/rhn_proxy.conf b/web/html/applications/rhn-proxy/4.2/httpd/rhn_proxy.conf index fba9c9e..741e2e5 100644 --- a/web/html/applications/rhn-proxy/4.2/httpd/rhn_proxy.conf +++ b/web/html/applications/rhn-proxy/4.2/httpd/rhn_proxy.conf @@ -44,3 +44,7 @@ DefaultType text/plain </LocationMatch>
+#Disable SSL2, left only higher +SSLProtocol all -SSLv2 +SSLProxyEngine on + diff --git a/web/html/applications/rhn-proxy/5.1/httpd/rhn_proxy.conf b/web/html/applications/rhn-proxy/5.1/httpd/rhn_proxy.conf index 20fbbc1..93bf30b 100644 --- a/web/html/applications/rhn-proxy/5.1/httpd/rhn_proxy.conf +++ b/web/html/applications/rhn-proxy/5.1/httpd/rhn_proxy.conf @@ -69,5 +69,5 @@ RewriteRule .* - [F]
#Disable SSL2, left only higher SSLProtocol all -SSLv2 - +SSLProxyEngine on
diff --git a/web/html/applications/rhn-proxy/5.2/httpd/rhn_proxy.conf b/web/html/applications/rhn-proxy/5.2/httpd/rhn_proxy.conf index 56ecec7..fe5e6eb 100644 --- a/web/html/applications/rhn-proxy/5.2/httpd/rhn_proxy.conf +++ b/web/html/applications/rhn-proxy/5.2/httpd/rhn_proxy.conf @@ -79,5 +79,5 @@
#Disable SSL2, left only higher SSLProtocol all -SSLv2 - +SSLProxyEngine on
commit c5347c63d83b4d5ad0a5146dca7d13bde98d8879 Author: Pradeep Kilambi pkilambi@redhat.com Date: Thu Jul 23 15:11:57 2009 -0400
Automatic commit of package [spacewalk-java] release [0.6.35-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec index 6aba9bc..220d838 100644 --- a/java/spacewalk-java.spec +++ b/java/spacewalk-java.spec @@ -12,7 +12,7 @@ Name: spacewalk-java Summary: Spacewalk Java site packages Group: Applications/Internet License: GPLv2 -Version: 0.6.34 +Version: 0.6.35 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -250,6 +250,11 @@ fi %attr(644, root, root) %{_datadir}/rhn/lib/rhn.jar
%changelog +* Thu Jul 23 2009 Pradeep Kilambi pkilambi@redhat.com 0.6.35-1 +- Sha256 support for channel creation: (pkilambi@redhat.com) +- checkstyle (mmccune@redhat.com) +- 512814 - unit test fix (mmccune@redhat.com) + * Wed Jul 22 2009 John Matthews jmatthew@redhat.com 0.6.34-1 - 512814 - adding spot to add 'upgrade' logic to our startup of tomact. (mmccune@redhat.com) diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java index 20a093c..ad5d5c7 100644 --- a/rel-eng/packages/spacewalk-java +++ b/rel-eng/packages/spacewalk-java @@ -1 +1 @@ -0.6.34-1 java/ +0.6.35-1 java/
commit a7d5a732f095a646bc473d6c7fbb54651bf0d7f7 Author: Pradeep Kilambi pkilambi@redhat.com Date: Thu Jul 23 15:09:14 2009 -0400
Automatic commit of package [spacewalk-backend] release [0.6.23-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec index bdaeca6..4e89aa2 100644 --- a/backend/spacewalk-backend.spec +++ b/backend/spacewalk-backend.spec @@ -7,7 +7,7 @@ Name: spacewalk-backend Summary: Common programs needed to be installed on the Spacewalk servers/proxies Group: Applications/Internet License: GPLv2 -Version: 0.6.22 +Version: 0.6.23 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -571,6 +571,39 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$ %changelog +* Thu Jul 23 2009 Pradeep Kilambi pkilambi@redhat.com 0.6.23-1 +- 513432, 513435 : Our channel family import is written such that we compare + and resync the red hat channel families. But in iss case we can have provate + channel family ties to a channel ebing imported that will not match whats on + the slave as slaves default to org 1. This fix should only post process the + channel families if its a non custom one. (pkilambi@redhat.com) +- reporting: add report option for listing fields for report. + (jpazdziora@redhat.com) +- reporting: after having parsed the common options, put the rest back to + sys.argv. (jpazdziora@redhat.com) +- reporting: show error message when unknown report is specified. + (jpazdziora@redhat.com) +- reporting: change structure of the report definition file to also include + column names. (jpazdziora@redhat.com) +- reporting: add channel(s) to which the server is registered. + (jpazdziora@redhat.com) +- reporting: add number of out-of-date packages and errata. + (jpazdziora@redhat.com) +- reporting: add kernel version to the report. (jpazdziora@redhat.com) +- reporting: when report name is not specified on the command line, show list + of available reports. (jpazdziora@redhat.com) +- reporting: move the SQL to definition file, to allow for multiple reports. + (jpazdziora@redhat.com) +- reporting: add registration time and last check-in time. + (jpazdziora@redhat.com) +- reporting: add the registered by information. (jpazdziora@redhat.com) +- reporting: add hostname and IP address to the report. (jpazdziora@redhat.com) +- reporting: output field names as the first row. (jpazdziora@redhat.com) +- reporting: output formatted as csv. (jpazdziora@redhat.com) +- reporting: initial prepare, execute, and fetch loop. (jpazdziora@redhat.com) +- reporting: add spacewalk-report to the rpm package. (jpazdziora@redhat.com) +- reporting: a stub for new script, spacewalk-report. (jpazdziora@redhat.com) + * Wed Jul 22 2009 John Matthews jmatthew@redhat.com 0.6.22-1 - 511283 - Package compare between db and cache should see if the db is newer than cache and only then import the content. (pkilambi@redhat.com) diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend index b232b7a..bfb1562 100644 --- a/rel-eng/packages/spacewalk-backend +++ b/rel-eng/packages/spacewalk-backend @@ -1 +1 @@ -0.6.22-1 backend/ +0.6.23-1 backend/
commit d478fbdfe058ee3846a798ab4b5208a63fca0c8d Author: Devan Goodwin dgoodwin@redhat.com Date: Thu Jul 23 16:07:56 2009 -0300
Automatic commit of package [osad] release [5.9.18-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec index 89c15b7..6ce5303 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/%%7Bname%7D-%%7Bversion%7D.t... -Version: 5.9.17 +Version: 5.9.18 Release: 1%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -240,6 +240,9 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
# $Id$ %changelog +* Thu Jul 23 2009 Devan Goodwin dgoodwin@redhat.com 5.9.18-1 +- Remove Requires python-optik. (dgoodwin@redhat.com) + * Wed Jul 22 2009 Devan Goodwin dgoodwin@redhat.com 5.9.17-1 - Disable osad selinux for Fedora 11. (dgoodwin@redhat.com)
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad index 5d08fc4..7d7a99e 100644 --- a/rel-eng/packages/osad +++ b/rel-eng/packages/osad @@ -1 +1 @@ -5.9.17-1 client/tools/osad/ +5.9.18-1 client/tools/osad/
commit c4ffe28c7bab3101f379743a13b5ab0c4166c71e Author: Devan Goodwin dgoodwin@redhat.com Date: Thu Jul 23 16:02:40 2009 -0300
Remove osad Requires python-optik.
This is only required for RHEL 4 and earlier, which is not built from this source code.
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec index 621b971..89c15b7 100644 --- a/client/tools/osad/osad.spec +++ b/client/tools/osad/osad.spec @@ -17,7 +17,6 @@ BuildRequires: python-devel Requires: python Requires: rhnlib >= 1.8-3 Requires: jabberpy -Requires: python-optik # This should have been required by rhnlib Requires: PyXML %if "%{pythongen}" == "1.5"
commit 8c44a17c0fdf5bb35a50c6cc1e6bde9d3db0c892 Author: Pradeep Kilambi pkilambi@redhat.com Date: Thu Jul 23 15:06:33 2009 -0400
fixing descritpion on checksums
diff --git a/schema/spacewalk/rhnsat/tables/rhnChecksumType_data.sql b/schema/spacewalk/rhnsat/tables/rhnChecksumType_data.sql index 627d4ee..a788487 100644 --- a/schema/spacewalk/rhnsat/tables/rhnChecksumType_data.sql +++ b/schema/spacewalk/rhnsat/tables/rhnChecksumType_data.sql @@ -18,7 +18,7 @@
insert into rhnChecksumType (id, label, description) values - (rhn_checksum_id_seq.nextval, 'md5', 'md5sum' ); + (rhn_checksum_id_seq.nextval, 'md5', 'md5' ); insert into rhnChecksumType (id, label, description) values (rhn_checksum_id_seq.nextval, 'sha1', 'sha' ); insert into rhnChecksumType (id, label, description) values diff --git a/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/126-rhnChecksumType_data.sql b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/126-rhnChecksumType_data.sql index 0977588..a788487 100644 --- a/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/126-rhnChecksumType_data.sql +++ b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/126-rhnChecksumType_data.sql @@ -18,9 +18,9 @@
insert into rhnChecksumType (id, label, description) values - (rhn_checksum_id_seq.nextval, 'md5', 'md5sum' ); + (rhn_checksum_id_seq.nextval, 'md5', 'md5' ); insert into rhnChecksumType (id, label, description) values - (rhn_checksum_id_seq.nextval, 'sha1', 'sha1' ); + (rhn_checksum_id_seq.nextval, 'sha1', 'sha' ); insert into rhnChecksumType (id, label, description) values (rhn_checksum_id_seq.nextval, 'sha-256', 'sha256' ); insert into rhnChecksumType (id, label, description) values
commit a39bf26b3a479712458f103c7e05bc58c49458e9 Author: Pradeep Kilambi pkilambi@redhat.com Date: Thu Jul 23 14:30:00 2009 -0400
Sha256 support for channel creation:
- Added the ablility for user to specify a yum repository checksum type at the channel creation time.
- Added a new table lookup table called rhnChecksumType
- Added a new column to rhnChannel checksum_type_id
- Channel creation sets the checksum_type_id and stores it for further lookup for repo generation to pick the user specified checksum.
- Edit channel page should reset the checksum_type_id value and trigger the repo generation with new checksum type.
diff --git a/java/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml b/java/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml index f4ecff3..c5ac8f3 100644 --- a/java/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml +++ b/java/code/src/com/redhat/rhn/domain/channel/Channel.hbm.xml @@ -45,6 +45,11 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" class="com.redhat.rhn.domain.channel.ChannelArch" column="channel_arch_id"/>
+ <many-to-one + name="checksum" + class="com.redhat.rhn.domain.common.ChecksumType" + column="checksum_type_id"/> + <set name="distChannelMaps"> <key column="channel_id"/> <one-to-many class="com.redhat.rhn.domain.channel.DistChannelMap"/> diff --git a/java/code/src/com/redhat/rhn/domain/channel/Channel.java b/java/code/src/com/redhat/rhn/domain/channel/Channel.java index ca5071e..9a40950 100644 --- a/java/code/src/com/redhat/rhn/domain/channel/Channel.java +++ b/java/code/src/com/redhat/rhn/domain/channel/Channel.java @@ -20,6 +20,7 @@ import com.redhat.rhn.domain.org.Org; import com.redhat.rhn.domain.rhnpackage.Package; import com.redhat.rhn.domain.server.Server; import com.redhat.rhn.domain.user.User; +import com.redhat.rhn.domain.common.ChecksumType; import com.redhat.rhn.manager.channel.ChannelManager; import com.redhat.rhn.manager.system.IncompatibleArchException; import com.redhat.rhn.manager.system.SystemManager; @@ -50,8 +51,8 @@ public class Channel extends BaseDomainHelper implements Comparable { public static final String PUBLIC = "public"; public static final String PROTECTED = "protected"; public static final String PRIVATE = "private"; - private static final String CHECKSUM_SHA_1 = "SHA1"; - private static final String CHECKSUM_SHA_256 = "SHA-256"; + private static final String CHECKSUM_SHA_1 = "sha1"; + private static final String CHECKSUM_SHA_256 = "sha-256";
private static List<String> releaseToSkipRepodata = new ArrayList<String>(Arrays .asList("2.1AS", "2.1ES", "2.1WS", "3AS", "3ES", "3WS", "3Desktop", "4AS", @@ -63,6 +64,8 @@ public class Channel extends BaseDomainHelper implements Comparable { .asList("5Server", "5Client")); private String baseDir; private ChannelArch channelArch; + private ChecksumType checksum; + private String description; private Date endOfLife; private String GPGKeyUrl; @@ -159,6 +162,21 @@ public class Channel extends BaseDomainHelper implements Comparable { public void setChannelArch(ChannelArch c) { this.channelArch = c; } + + /** + * @return Returns the channelChecksum. + */ + public ChecksumType getChecksum() { + return checksum; + } + + /** + * @param checksumIn The checksum to set. + */ + public void setChecksum(ChecksumType checksumIn) { + this.checksum = checksumIn; + } +
/** * @param compsIn The Comps to set. @@ -798,12 +816,14 @@ public class Channel extends BaseDomainHelper implements Comparable {
/** * get the compatible checksum type to be used for repomd.xml - * based on channel release. If its RHEL-5 we use sha1 - * anything newer will be sha256. + * based on channel release. + * If its a custom channel use the checksum_type_id from db set at creation time + * If its RHEL-5 we use sha1 anything newer will be sha256. * @return checksumType */ public String getChecksumType() { Channel toConsider = this; + while (toConsider.getParentChannel() != null) { toConsider = toConsider.getParentChannel(); } @@ -811,13 +831,16 @@ public class Channel extends BaseDomainHelper implements Comparable { if (channelDist != null) { String release = channelDist.getRelease(); // If channel or parent is RHEL-5 use sha1, else use sha256 - if (toConsider.isCustom() || sha1compatiblechannels.contains(release)) { + if (sha1compatiblechannels.contains(release)) { return CHECKSUM_SHA_1; } - else { - return CHECKSUM_SHA_256; - } } + + // IF its custom use the one set at channel creation time + if (toConsider.isCustom()) { + return toConsider.getChecksum().getLabel(); + } + // default to sha256 return CHECKSUM_SHA_256; } diff --git a/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java b/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java index aff50d6..ec8d52c 100644 --- a/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java +++ b/java/code/src/com/redhat/rhn/domain/channel/ChannelFactory.java @@ -14,6 +14,22 @@ */ package com.redhat.rhn.domain.channel;
+import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.log4j.Logger; +import org.hibernate.Criteria; +import org.hibernate.HibernateException; +import org.hibernate.Session; +import org.hibernate.criterion.CriteriaSpecification; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; + import com.redhat.rhn.common.db.datasource.CallableMode; import com.redhat.rhn.common.db.datasource.DataResult; import com.redhat.rhn.common.db.datasource.ModeFactory; @@ -21,28 +37,13 @@ import com.redhat.rhn.common.db.datasource.SelectMode; import com.redhat.rhn.common.db.datasource.WriteMode; import com.redhat.rhn.common.hibernate.HibernateFactory; import com.redhat.rhn.common.hibernate.HibernateRuntimeException; +import com.redhat.rhn.domain.common.ChecksumType; import com.redhat.rhn.domain.kickstart.KickstartableTree; import com.redhat.rhn.domain.org.Org; import com.redhat.rhn.domain.rhnpackage.Package; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.manager.channel.ChannelManager;
-import org.apache.log4j.Logger; -import org.hibernate.Criteria; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.hibernate.criterion.CriteriaSpecification; -import org.hibernate.criterion.Projections; -import org.hibernate.criterion.Restrictions; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - /** * ChannelFactory * @version $Rev$ @@ -223,7 +224,6 @@ public class ChannelFactory extends HibernateFactory { c.add(Restrictions.in("label", labels)); return c.list(); } -
/** * Returns list of channel architectures @@ -234,7 +234,7 @@ public class ChannelFactory extends HibernateFactory { Criteria criteria = session.createCriteria(ChannelArch.class); return criteria.list(); } - + /** * returns a ChannelArch by label * @param label ChannelArch label @@ -530,7 +530,27 @@ public class ChannelFactory extends HibernateFactory { "KickstartableTree.findTreesForChannel", params); }
- + /** + * Find yum supported checksum types + * @return List of ChecksumTypes instances + */ + public static List<ChecksumType> listYumSupportedChecksums() { + return singleton.listObjectsByNamedQuery( + "ChecksumType.loadAllForYum", Collections.EMPTY_MAP); + } + + /** + * Find checksumtype by label + * @param checksum checksum label + * @return ChecksumType instance for given label + */ + public static ChecksumType findChecksumByLabel(String checksum) { + Map params = new HashMap(); + params.put("label", checksum); + return (ChecksumType) + singleton.lookupObjectByNamedQuery("ChecksumType.findByLabel", params); + } + /** * Get a list of packages ids that are in a channel * and in a list of errata. (The errata do not diff --git a/java/code/src/com/redhat/rhn/domain/channel/test/ChannelFactoryTest.java b/java/code/src/com/redhat/rhn/domain/channel/test/ChannelFactoryTest.java index a9e9f24..fe901d9 100644 --- a/java/code/src/com/redhat/rhn/domain/channel/test/ChannelFactoryTest.java +++ b/java/code/src/com/redhat/rhn/domain/channel/test/ChannelFactoryTest.java @@ -22,6 +22,7 @@ import com.redhat.rhn.domain.channel.ChannelFamily; import com.redhat.rhn.domain.channel.ChannelFamilyFactory; import com.redhat.rhn.domain.channel.ClonedChannel; import com.redhat.rhn.domain.channel.ProductName; +import com.redhat.rhn.domain.common.ChecksumType; import com.redhat.rhn.domain.org.Org; import com.redhat.rhn.domain.rhnpackage.Package; import com.redhat.rhn.domain.rhnpackage.test.PackageTest; @@ -382,7 +383,22 @@ public class ChannelFactoryTest extends RhnBaseTestCase { fileNameChild); assertNotNull(lookedUpChild); assertEquals(cp.getId(), lookedUpChild.getId()); + + } + + public void testfindChecksumByLabel() { + assertNull("Checksum found for null label", + ChannelFactory.findChecksumByLabel(null)); + assertNull("Checksum found for invalid label", + ChannelFactory.findChecksumByLabel("some-invalid_checksum"));
+ ChecksumType ct = ChannelFactory.findChecksumByLabel("sha-256"); + assertNotNull(ct); + assertEquals("sha-256", ct.getLabel());
+ ChecksumType ct2 = ChannelFactory.findChecksumByLabel("sha1"); + assertNotNull(ct2); + assertEquals("sha1", ct2.getLabel()); } + } diff --git a/java/code/src/com/redhat/rhn/domain/common/ChecksumType.hbm.xml b/java/code/src/com/redhat/rhn/domain/common/ChecksumType.hbm.xml new file mode 100644 index 0000000..dea8be7 --- /dev/null +++ b/java/code/src/com/redhat/rhn/domain/common/ChecksumType.hbm.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE hibernate-mapping +PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" +"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> +<hibernate-mapping> + <class name="com.redhat.rhn.domain.common.ChecksumType" + table="rhnChecksumType" mutable="false"> + <cache usage="read-only"/> + <id name="id" type="long" column="id"> + <meta attribute="scope-set">protected</meta> + <generator class="assigned" /> + </id> + <property name="label" type="string" column="label" /> + <property name="description" type="string" column="description" /> + <property name="created" type="date" column="created" /> + <property name="modified" type="date" column="modified" /> + </class> + + <query name="ChecksumType.loadAll"> + <![CDATA[from com.redhat.rhn.domain.common.ChecksumType]]> + </query> + <query name="ChecksumType.loadAllForYum"> + <![CDATA[from com.redhat.rhn.domain.common.ChecksumType as t + where t.label = 'sha-256' or t.label = 'sha1']]> + </query> + <query name="ChecksumType.findById"> + <![CDATA[from com.redhat.rhn.domain.common.ChecksumType as t where t.id = :id]]> + </query> + <query name="ChecksumType.findByLabel"> + <![CDATA[from com.redhat.rhn.domain.common.ChecksumType as t where t.label = :label]]> + </query> +</hibernate-mapping> diff --git a/java/code/src/com/redhat/rhn/domain/common/ChecksumType.java b/java/code/src/com/redhat/rhn/domain/common/ChecksumType.java new file mode 100644 index 0000000..3e41435 --- /dev/null +++ b/java/code/src/com/redhat/rhn/domain/common/ChecksumType.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) 2009 Red Hat, Inc. + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ +package com.redhat.rhn.domain.common; + +import com.redhat.rhn.domain.BaseDomainHelper; + +import org.apache.commons.lang.builder.ToStringBuilder; + +/** + * ArchType + * @version $Rev$ + */ +public class ChecksumType extends BaseDomainHelper { + + private Long id; + private String label; + private String description; + + /** + * @return Returns the id. + */ + public Long getId() { + return id; + } + + /** + * @param i The id to set. + */ + public void setId(Long i) { + this.id = i; + } + + /** + * @return Returns the label. + */ + public String getLabel() { + return label; + } + + /** + * @param l The label to set. + */ + public void setLabel(String l) { + this.label = l; + } + + /** + * @return Returns the description. + */ + public String getDescription() { + return description; + } + + /** + * @param n The name to set. + */ + public void setDescription(String n) { + this.description = n; + } + + /** {@inheritDoc} */ + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + ChecksumType checksumType = (ChecksumType) o; + + if (id != null ? !id.equals(checksumType.id) : checksumType.id != null) { + return false; + } + + return true; + } + + /** {@inheritDoc} */ + public int hashCode() { + return id != null ? id.hashCode() : 0; + } + + /** {@inheritDoc} */ + public String toString() { + ToStringBuilder builder = new ToStringBuilder(this); + + builder.append("id", id); + builder.append("label", label); + + return builder.toString(); + } +} diff --git a/java/code/src/com/redhat/rhn/domain/common/test/ChecksumTypeTest.java b/java/code/src/com/redhat/rhn/domain/common/test/ChecksumTypeTest.java new file mode 100644 index 0000000..a0fd478 --- /dev/null +++ b/java/code/src/com/redhat/rhn/domain/common/test/ChecksumTypeTest.java @@ -0,0 +1,42 @@ +/** + * Copyright (c) 2009 Red Hat, Inc. + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ +package com.redhat.rhn.domain.common.test; + +import com.redhat.rhn.domain.common.ChecksumType; +import com.redhat.rhn.testing.RhnBaseTestCase; +import com.redhat.rhn.testing.TestUtils; + +/** + * ArchTypeTest + * @version $Rev$ + */ +public class ChecksumTypeTest extends RhnBaseTestCase { + + public void testChecksumType() throws Exception { + + Long testid = new Long(1); + String query = "ChecksumType.findById"; + + ChecksumType at1 = (ChecksumType) TestUtils.lookupFromCacheById(testid, query); + assertNotNull(at1); + assertEquals(at1.getId(), testid); + + ChecksumType at2 = (ChecksumType) TestUtils.lookupFromCacheById(at1.getId(), query); + assertEquals(at1.getLabel(), at2.getLabel()); + + ChecksumType at3 = (ChecksumType) TestUtils.lookupFromCacheById(at1.getId(), query); + } + +} diff --git a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java index 929dfc2..09d500e 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/channel/manage/EditChannelAction.java @@ -14,6 +14,24 @@ */ package com.redhat.rhn.frontend.action.channel.manage;
+import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionErrors; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.ActionMessage; +import org.apache.struts.action.ActionMessages; +import org.apache.struts.action.DynaActionForm; + import com.redhat.rhn.common.db.datasource.DataResult; import com.redhat.rhn.common.localization.LocalizationService; import com.redhat.rhn.common.security.PermissionException; @@ -41,24 +59,6 @@ import com.redhat.rhn.manager.channel.UpdateChannelCommand; import com.redhat.rhn.manager.system.SystemManager; import com.redhat.rhn.manager.user.UserManager;
-import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.apache.struts.action.ActionMessage; -import org.apache.struts.action.ActionMessages; -import org.apache.struts.action.DynaActionForm; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -
/** * EditChannelAction @@ -158,6 +158,7 @@ public class EditChannelAction extends RhnAction implements Listable { request.setAttribute("channel_name", form.getString("name")); request.setAttribute("channel_arch", form.get("arch_name")); request.setAttribute("channel_arch_label", form.get("arch")); + request.setAttribute("checksum_label", form.get("checksum")); addErrors(request, errors); prepDropdowns(new RequestContext(request)); return getStrutsDelegate().forwardParams( @@ -197,6 +198,7 @@ public class EditChannelAction extends RhnAction implements Listable { request.setAttribute("label", form.get("label")); request.setAttribute("parent", form.get("parent")); request.setAttribute("arch", form.get("arch")); + request.setAttribute("checksum", form.get("checksum")); request.setAttribute("arch_name", form.get("arch_name")); request.setAttribute("summary", form.get("summary")); request.setAttribute("description", form.get("description")); @@ -319,6 +321,7 @@ public class EditChannelAction extends RhnAction implements Listable { // times where python would make this SOOOO much easier. UpdateChannelCommand ucc = new UpdateChannelCommand(); ucc.setArchLabel((String)form.get("arch")); + ucc.setChecksum((String)form.get("checksum")); ucc.setLabel((String)form.get("label")); ucc.setName((String)form.get("name")); ucc.setSummary((String)form.get("summary")); @@ -388,6 +391,7 @@ public class EditChannelAction extends RhnAction implements Listable { // times where python would make this SOOOO much easier. CreateChannelCommand ccc = new CreateChannelCommand(); ccc.setArchLabel((String)form.get("arch")); + ccc.setChecksum((String)form.get("checksum")); ccc.setLabel((String)form.get("label")); ccc.setName((String)form.get("name")); ccc.setSummary((String)form.get("summary")); @@ -546,6 +550,7 @@ public class EditChannelAction extends RhnAction implements Listable { form.set("maintainer_phone", c.getMaintainerPhone()); form.set("maintainer_email", c.getMaintainerEmail()); form.set("support_policy", c.getSupportPolicy()); + form.set("checksum", c.getChecksum().getLabel()); if (c.isGloballySubscribable(ctx.getLoggedInUser().getOrg())) { form.set("per_user_subscriptions", "all"); } @@ -569,6 +574,7 @@ public class EditChannelAction extends RhnAction implements Listable { request.setAttribute("channel_name", c.getName()); request.setAttribute("channel_arch", c.getChannelArch().getName()); request.setAttribute("channel_arch_label", c.getChannelArch().getLabel()); + } else { // default settings @@ -601,6 +607,10 @@ public class EditChannelAction extends RhnAction implements Listable { addOption(channelArches, arch.getName(), arch.getLabel()); } ctx.getRequest().setAttribute("channelArches", channelArches); + // set the list of yum supported checksums + ctx.getRequest().setAttribute("checksums", + ChannelFactory.listYumSupportedChecksums()); + }
/** 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 aab7a1f..af98b30 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 @@ -20940,6 +20940,21 @@ given channel.</source> <context context-type="sourcefile">/rhn/channels/manage/Edit.do</context> </context-group> </trans-unit> + <trans-unit id="channel.edit.jsp.checksum"> + <source>Yum Repository Checksum Type</source> + <context-group name="ctx"> + <context context-type="sourcefile">/rhn/channels/manage/Edit.do</context> + </context-group> + </trans-unit> + <trans-unit id="channel.edit.jsp.checksumtip"> + <source><strong> Tip:</strong> + sha1 offers the widest compatibility with clients. sha-256 offers higher security, + but is compatible only with newer clients: Fedora 11 and newer, or Enterprise Linux 6 and newer. + </source> + <context-group name="ctx"> + <context context-type="sourcefile">/rhn/channels/manage/Edit.do</context> + </context-group> + </trans-unit> <trans-unit id="channel.edit.jsp.summary"> <source>Channel Summary</source> <context-group name="ctx"> diff --git a/java/code/src/com/redhat/rhn/manager/channel/CreateChannelCommand.java b/java/code/src/com/redhat/rhn/manager/channel/CreateChannelCommand.java index 0b94bfe..a078105 100644 --- a/java/code/src/com/redhat/rhn/manager/channel/CreateChannelCommand.java +++ b/java/code/src/com/redhat/rhn/manager/channel/CreateChannelCommand.java @@ -17,6 +17,7 @@ package com.redhat.rhn.manager.channel; import com.redhat.rhn.domain.channel.Channel; import com.redhat.rhn.domain.channel.ChannelArch; import com.redhat.rhn.domain.channel.ChannelFactory; +import com.redhat.rhn.domain.common.ChecksumType; import com.redhat.rhn.domain.role.RoleFactory; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.xmlrpc.InvalidChannelLabelException; @@ -62,6 +63,9 @@ public class CreateChannelCommand { protected String gpgKeyUrl; protected String gpgKeyId; protected String gpgKeyFp; + protected String checksum; + + protected String maintainerName; protected String maintainerEmail; protected String maintainerPhone; @@ -77,6 +81,7 @@ public class CreateChannelCommand { name = null; summary = null; archLabel = null; + checksum = null; parentLabel = null; parentId = null; } @@ -103,6 +108,13 @@ public class CreateChannelCommand { }
/** + * @param checksumIn The name to set. + */ + public void setChecksum(String checksumIn) { + this.checksum = checksumIn; + } + + /** * @param parentLabelIn The parentLabel to set. */ public void setParentLabel(String parentLabelIn) { @@ -239,6 +251,9 @@ public class CreateChannelCommand { throw new IllegalArgumentException("Invalid architecture label"); }
+ ChecksumType ct = ChannelFactory.findChecksumByLabel(checksum); + + Channel c = ChannelFactory.createChannel(); c.setLabel(label); c.setName(name); @@ -247,6 +262,7 @@ public class CreateChannelCommand { c.setOrg(user.getOrg()); c.setBaseDir("/dev/null"); c.setChannelArch(ca); + c.setChecksum(ct); c.setGPGKeyId(gpgKeyId); c.setGPGKeyUrl(gpgKeyUrl); c.setGPGKeyFp(gpgKeyFp); diff --git a/java/code/src/com/redhat/rhn/manager/channel/UpdateChannelCommand.java b/java/code/src/com/redhat/rhn/manager/channel/UpdateChannelCommand.java index 576fcc9..6447deb 100644 --- a/java/code/src/com/redhat/rhn/manager/channel/UpdateChannelCommand.java +++ b/java/code/src/com/redhat/rhn/manager/channel/UpdateChannelCommand.java @@ -17,6 +17,7 @@ package com.redhat.rhn.manager.channel;
import com.redhat.rhn.domain.channel.Channel; import com.redhat.rhn.domain.channel.ChannelFactory; +import com.redhat.rhn.domain.common.ChecksumType; import com.redhat.rhn.frontend.xmlrpc.InvalidChannelLabelException; import com.redhat.rhn.frontend.xmlrpc.InvalidChannelNameException; import com.redhat.rhn.frontend.xmlrpc.InvalidParentChannelException; @@ -63,6 +64,15 @@ public class UpdateChannelCommand extends CreateChannelCommand { if (ChannelFactory.findArchByLabel(archLabel) == null) { throw new IllegalArgumentException("Invalid architecture label"); } + + ChecksumType ct = ChannelFactory.findChecksumByLabel(checksum); + + if (!ct.getLabel().equals(c.getChecksum().getLabel()) && c.getPackageCount() > 0) { + // schedule repo re generation if the checksum type changed + // and the channel has packages + ChannelManager.queueChannelChange(c.getLabel(), + "java::updateChannelCommon", null); + }
c.setName(name); c.setSummary(summary); @@ -72,6 +82,7 @@ public class UpdateChannelCommand extends CreateChannelCommand { c.setGPGKeyId(gpgKeyId); c.setGPGKeyUrl(gpgKeyUrl); c.setGPGKeyFp(gpgKeyFp); + c.setChecksum(ct); c.setAccess(access); c.setMaintainerName(maintainerName); c.setMaintainerEmail(maintainerEmail); diff --git a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepomdIndexData.java b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepomdIndexData.java index a29ff41..bbcffad 100644 --- a/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepomdIndexData.java +++ b/java/code/src/com/redhat/rhn/taskomatic/task/repomd/RepomdIndexData.java @@ -27,6 +27,7 @@ public class RepomdIndexData { private String openChecksum; private Date timestamp; private String type; +
/** * @@ -53,12 +54,7 @@ public class RepomdIndexData { * @param typeIn checksum type */ public void setType(String typeIn) { - if (typeIn == "SHA1") { - this.type = "sha"; - } - else if (typeIn == "SHA-256") { - this.type = "sha256"; - } + this.type = typeIn; }
/** 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 ab91812..37ba643 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 @@ -56,6 +56,7 @@ public class RepositoryWriter { private String pathPrefix; private String mountPoint; private String checksumtype; + private String checksumname;
/** * Constructor takes in pathprefix and mountpoint @@ -105,6 +106,9 @@ public class RepositoryWriter {
// Get compatible checksumType this.checksumtype = channel.getChecksumType(); + this.checksumname = channel.getChecksum().getDescription(); + + log.info("Checksum Type Value" + this.checksumtype);
try { primaryFile = new CompressingDigestOutputWriter( @@ -177,18 +181,28 @@ public class RepositoryWriter {
log.info("Starting updateinfo generation for '" + channel.getLabel() + '"'); + log.info("Checksum Type Value for generate updateinfo" + this.checksumtype); RepomdIndexData updateinfoData = generateUpdateinfo(channel, prefix, this.checksumtype);
RepomdIndexData groupsData = loadCompsFile(channel); - + //Set the type so yum can read and perform checksum - primaryData.setType(this.checksumtype); - filelistsData.setType(this.checksumtype); - otherData.setType(this.checksumtype); - updateinfoData.setType(this.checksumtype); - groupsData.setType(this.checksumtype); - + primaryData.setType(this.checksumname); + filelistsData.setType(this.checksumname); + otherData.setType(this.checksumname); + if (updateinfoData != null) { + updateinfoData.setType(this.checksumname); + } + + if (groupsData != null) { + groupsData.setType(this.checksumname); + } + + log.info("Primary xml's type" + primaryData.getType()); + log.info("filelists xml's type" + filelistsData.getType()); + log.info("other xml's type" + otherData.getType()); + FileWriter indexFile;
try { diff --git a/java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp b/java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp index d7c45e4..57ff58a 100644 --- a/java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp +++ b/java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp @@ -93,6 +93,19 @@ </tr> <tr> <th nowrap="nowrap"> + <bean:message key="channel.edit.jsp.checksum"/>: + </th> + <td class="small-form"> + <html:select property="checksum"> + <html:options collection="checksums" + property="label" + labelProperty="label" /> + </html:select><br/> + <span class="small-text"><bean:message key="channel.edit.jsp.checksumtip"/></span> + </td> + </tr> + <tr> + <th nowrap="nowrap"> <rhn:required-field key="channel.edit.jsp.summary"/>: </th> <td class="small-form"> diff --git a/java/code/webapp/WEB-INF/struts-config.xml b/java/code/webapp/WEB-INF/struts-config.xml index a7966a9..daa9e20 100644 --- a/java/code/webapp/WEB-INF/struts-config.xml +++ b/java/code/webapp/WEB-INF/struts-config.xml @@ -842,6 +842,7 @@ <form-property name="gpg_key_url" type="java.lang.String" /> <form-property name="gpg_key_id" type="java.lang.String" /> <form-property name="gpg_key_fingerprint" type="java.lang.String" /> + <form-property name="checksum" type="java.lang.String" /> </form-bean>
<form-bean name="channelDeleteForm" diff --git a/schema/spacewalk/rhnsat/tables/rhnChannel.sql b/schema/spacewalk/rhnsat/tables/rhnChannel.sql index 95a54dc..b4e1fab 100644 --- a/schema/spacewalk/rhnsat/tables/rhnChannel.sql +++ b/schema/spacewalk/rhnsat/tables/rhnChannel.sql @@ -49,6 +49,8 @@ rhnChannel gpg_key_id varchar2(14), gpg_key_fp varchar2(50), end_of_life date, + checksum_type_id number constraint rhn_channel_checksum_fk + references rhnChecksumType(id), receiving_updates char(1) default 'Y' constraint rhn_channel_ru_nn not null diff --git a/schema/spacewalk/rhnsat/tables/rhnChecksumType.sql b/schema/spacewalk/rhnsat/tables/rhnChecksumType.sql new file mode 100644 index 0000000..8d88905 --- /dev/null +++ b/schema/spacewalk/rhnsat/tables/rhnChecksumType.sql @@ -0,0 +1,44 @@ +create sequence rhn_checksum_id_seq; + +create table +rhnChecksumType +( + id number + constraint rhn_checksumtype_id_nn not null, + label varchar2(32) + constraint rhn_checksumtype_label_nn not null, + description varchar2(64) + constraint rhn_checksumtype_desc_nn not null, + created date default(sysdate) + constraint rhn_checksumtype_creat_nn not null, + modified date default(sysdate) + constraint rhn_checksumtype_mod_nn not null +) + enable row movement + ; + +create index rhn_checksumtype_label_id_idx + on rhnChecksumType( label, id ) + tablespace [[64k_tbs]] + ; +alter table rhnChecksumType add constraint rhn_checksumtype_id_pk + primary key ( id ); +alter table rhnChecksumType add constraint rhn_checksumtype_label_uq + unique ( label ); + +create or replace trigger +rhn_checksumtype_mod_trig +before insert or update on rhnChecksumType +for each row +begin + :new.modified := sysdate; +end; +/ +show errors + +-- +-- +-- Revision 1.1 2009/06/26 10:39:17 pkilambi +-- add schema to hold checksum types +-- + diff --git a/schema/spacewalk/rhnsat/tables/rhnChecksumType_data.sql b/schema/spacewalk/rhnsat/tables/rhnChecksumType_data.sql new file mode 100644 index 0000000..627d4ee --- /dev/null +++ b/schema/spacewalk/rhnsat/tables/rhnChecksumType_data.sql @@ -0,0 +1,37 @@ +-- +-- 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. +-- +-- +-- +-- + + +insert into rhnChecksumType (id, label, description) values + (rhn_checksum_id_seq.nextval, 'md5', 'md5sum' ); +insert into rhnChecksumType (id, label, description) values + (rhn_checksum_id_seq.nextval, 'sha1', 'sha' ); +insert into rhnChecksumType (id, label, description) values + (rhn_checksum_id_seq.nextval, 'sha-256', 'sha256' ); +insert into rhnChecksumType (id, label, description) values + (rhn_checksum_id_seq.nextval, 'sha-384', 'sha384' ); +insert into rhnChecksumType (id, label, description) values + (rhn_checksum_id_seq.nextval, 'sha-512', 'sha512' ); + +commit; + +-- +-- +-- Revision 1.1 2009/06/26 11:00:17 pkilambi +-- + diff --git a/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/125-rhnChecksumType.sql b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/125-rhnChecksumType.sql new file mode 100644 index 0000000..8d88905 --- /dev/null +++ b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/125-rhnChecksumType.sql @@ -0,0 +1,44 @@ +create sequence rhn_checksum_id_seq; + +create table +rhnChecksumType +( + id number + constraint rhn_checksumtype_id_nn not null, + label varchar2(32) + constraint rhn_checksumtype_label_nn not null, + description varchar2(64) + constraint rhn_checksumtype_desc_nn not null, + created date default(sysdate) + constraint rhn_checksumtype_creat_nn not null, + modified date default(sysdate) + constraint rhn_checksumtype_mod_nn not null +) + enable row movement + ; + +create index rhn_checksumtype_label_id_idx + on rhnChecksumType( label, id ) + tablespace [[64k_tbs]] + ; +alter table rhnChecksumType add constraint rhn_checksumtype_id_pk + primary key ( id ); +alter table rhnChecksumType add constraint rhn_checksumtype_label_uq + unique ( label ); + +create or replace trigger +rhn_checksumtype_mod_trig +before insert or update on rhnChecksumType +for each row +begin + :new.modified := sysdate; +end; +/ +show errors + +-- +-- +-- Revision 1.1 2009/06/26 10:39:17 pkilambi +-- add schema to hold checksum types +-- + diff --git a/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/126-rhnChecksumType_data.sql b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/126-rhnChecksumType_data.sql new file mode 100644 index 0000000..0977588 --- /dev/null +++ b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/126-rhnChecksumType_data.sql @@ -0,0 +1,37 @@ +-- +-- 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. +-- +-- +-- +-- + + +insert into rhnChecksumType (id, label, description) values + (rhn_checksum_id_seq.nextval, 'md5', 'md5sum' ); +insert into rhnChecksumType (id, label, description) values + (rhn_checksum_id_seq.nextval, 'sha1', 'sha1' ); +insert into rhnChecksumType (id, label, description) values + (rhn_checksum_id_seq.nextval, 'sha-256', 'sha256' ); +insert into rhnChecksumType (id, label, description) values + (rhn_checksum_id_seq.nextval, 'sha-384', 'sha384' ); +insert into rhnChecksumType (id, label, description) values + (rhn_checksum_id_seq.nextval, 'sha-512', 'sha512' ); + +commit; + +-- +-- +-- Revision 1.1 2009/06/26 11:00:17 pkilambi +-- + diff --git a/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-rhnChannel.sql b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-rhnChannel.sql new file mode 100644 index 0000000..8842689 --- /dev/null +++ b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-rhnChannel.sql @@ -0,0 +1,7 @@ +-- Add a checksum_type_id column, and fk to rhnChecksumType +ALTER TABLE rhnChannel + ADD checksum_type_id number +CONSTRAINT rhn_channel_checksum_fk + REFERENCES rhnChecksumType(id); + +show errors
commit c88ce52e8cd8761c66ac236ee415b539fa5a9a00 Author: Pradeep Kilambi pkilambi@redhat.com Date: Thu Jul 23 14:21:11 2009 -0400
513432, 513435 : Our channel family import is written such that we compare and resync the red hat channel families. But in iss case we can have provate channel family ties to a channel ebing imported that will not match whats on the slave as slaves default to org 1. This fix should only post process the channel families if its a non custom one.
diff --git a/backend/server/importlib/backend.py b/backend/server/importlib/backend.py index fdb737d..39d65f9 100644 --- a/backend/server/importlib/backend.py +++ b/backend/server/importlib/backend.py @@ -905,6 +905,11 @@ class Backend: cf_ids = [] c_ids = [] for cf in channel_families: + if 'private-channel-family' in cf['label']: + # Its a private channel family and channel family members + # will be different from server as this is most likely ISS + # sync. Don't compare and delete custom channel families. + continue for cid in cf['channel_ids']: # Look up channel families for this channel h_lookup_cfid.execute(channel_id=cid)
commit 4b2827e870092406211fa3b2d6a667c9f050775c Author: Devan Goodwin dgoodwin@redhat.com Date: Thu Jul 23 13:19:31 2009 -0300
508187 - Fix jabberd configs on x86_64.
Hardcoded /usr/lib/jabberd/ in the jabber config files we drop into place during spacewalk-setup was breaking for x86_64, which should be lib64. Added a new macro to our copy of the config files and populate it during setup.
diff --git a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/c2s.xml b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/c2s.xml index ba1aa82..8b76c1a 100644 --- a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/c2s.xml +++ b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/c2s.xml @@ -318,7 +318,7 @@ <!-- Authentication/registration database configuration --> <authreg> <!-- Dynamic authreg modules path --> - <path>/usr/lib/jabberd</path> + <path>@@jabberDOTlibdir@@</path>
<!-- Backend module to use --> <module>db</module> diff --git a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/sm.xml b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/sm.xml index 4b95480..6b9bb1f 100644 --- a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/sm.xml +++ b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/jabberd/sm.xml @@ -69,7 +69,7 @@ <!-- Storage database configuration --> <storage> <!-- Dynamic storage modules path --> - <path>/usr/lib/jabberd</path> + <path>@@jabberDOTlibdir@@</path>
<!-- By default, we use the MySQL driver for all storage --> <driver>db</driver> @@ -326,7 +326,7 @@ doing. --> <modules> <!-- Dynamic sm modules path --> - <path>/usr/lib/jabberd</path> + <path>@@jabberDOTlibdir@@</path>
<!-- sess-start. The modules in this chain are called when a session is first started (usually on request by c2s as part of the diff --git a/spacewalk/setup/bin/spacewalk-setup b/spacewalk/setup/bin/spacewalk-setup index 7a00825..7695584 100755 --- a/spacewalk/setup/bin/spacewalk-setup +++ b/spacewalk/setup/bin/spacewalk-setup @@ -947,6 +947,12 @@ sub populate_initial_configs {
my %nls_database_paramaters = Spacewalk::Setup::get_nls_database_parameters($answers);
+ # Check where jabberd's lib dir is, can vary on x86_64: + my $jabberdLibDir = "/usr/lib/jabberd/"; + if (-d "/usr/lib64/jabberd/") { + $jabberdLibDir = "/usr/lib64/jabberd"; + } + my %config_opts = ( mount_point => $answers->{'mount-point'} || '/var/satellite', @@ -968,6 +974,7 @@ sub populate_initial_configs { db_port => $answers->{'db-port'}, traceback_mail => $answers->{'admin-email'}, jabberDOTusername => 'rhn-dispatcher-sat', + jabberDOTlibdir => $jabberdLibDir, jabberDOTpassword => 'rhn-dispatcher-' . random_password(6), serverDOTsatelliteDOTca_chain => '/usr/share/rhn/RHNS-CA-CERT', serverDOTnls_lang => 'english.' . $nls_database_paramaters{NLS_CHARACTERSET},
commit 2ca6f67619b97d015b693a31c75c938902ccb71f Author: Milan Zazrivec mzazrivec@redhat.com Date: Thu Jul 23 17:14:26 2009 +0200
512457 - remove xml-commons-apis before rhel-4 upgrade
diff --git a/satellite/install/install.pl b/satellite/install/install.pl index 18b4d41..74c5b6e 100755 --- a/satellite/install/install.pl +++ b/satellite/install/install.pl @@ -535,6 +535,9 @@ sub remove_obsoleted_packages { my @pkgs = ('rhn-apache', 'rhn-modpython', 'rhn-modssl', 'rhn-modperl', 'perl-libapreq', 'bouncycastle-jdk1.4', 'quartz-oracle', 'jaf', 'jta'); + # If we're about to install xml-commons-jaxp-apis from ISO (on RHEL-4), we need to + # remove xml-commons-apis first (dependency problems). + push(@pkgs, 'xml-commons-apis') if glob('Satellite/xml-commons-jaxp-apis*'); for my $pkg (@pkgs) { if (system_debug('rpm', '-q', $pkg) == 0) { system_debug('rpm', '-ev', '--nodeps', $pkg);
commit 6b8b2c0244ca26abc28cb665b97c24da72006643 Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 16:54:28 2009 +0200
reporting: add report option for listing fields for report.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index c0aa875..48c1357 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -26,6 +26,7 @@ def systemExit(code, msgs=None): try: import os import csv + from optparse import Option, OptionParser except KeyboardInterrupt: systemExit(-1, "\nUser interrupted process.")
@@ -47,10 +48,6 @@ except KeyboardInterrupt:
def processCommandline(): """ process the commandline """ - try: - from optparse import Option, OptionParser - except KeyboardInterrupt: - systemExit(-1, "\nUser interrupted process.") optionsTable = [ Option('--db', action='store', type="string", help='alternative database string (username/password@sid);' \ @@ -67,19 +64,43 @@ def processCommandline():
return options
+def processCommandlineReport(report): + """ process the commandline options for one report """ + + optionsTable = [ + Option('--fields', action='store_true', + help='show fields of the report'), + ] + optionParserReport = OptionParser( + usage="options for report %s" % report, + option_list=optionsTable, + ) + options, args = optionParserReport.parse_args() + + return options +
if __name__ == '__main__': options = processCommandline()
try: if len(sys.argv) > 1: - initCFG('server') - rhnSQL.initDB(options.db) + report_name = sys.argv[1] + report_options = processCommandlineReport(report_name)
try: - report = reports.report(sys.argv[1]) + report = reports.report(report_name) except(reports.spacewalk_unknown_report): - systemExit(-4, 'Unknown report [%s].' % sys.argv[1]) + systemExit(-4, 'Unknown report [%s].' % report_name) + + if report_options.fields: + for c in report.columns: + print c + sys.exit(0) + + initCFG('server') + rhnSQL.initDB(options.db) + writer = csv.writer(sys.stdout)
h = rhnSQL.prepare(report.sql)
commit ef07ee5b797ffa6f038580c0a207aa4a53851cee Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 16:01:50 2009 +0200
reporting: after having parsed the common options, put the rest back to sys.argv.
Note that we use disable_interspersed_args() so that the report name and any repo-specific parameters are still unprocessed.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index 973f5f0..c0aa875 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -63,6 +63,8 @@ def processCommandline(): optionParser.disable_interspersed_args() options, args = optionParser.parse_args()
+ sys.argv[1:] = args + return options
commit 216c7bebb1f1cb2d00b210dfdda04491feda051b Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 15:59:46 2009 +0200
reporting: show error message when unknown report is specified.
diff --git a/backend/satellite_tools/reports.py b/backend/satellite_tools/reports.py index a8afd2c..b584347 100644 --- a/backend/satellite_tools/reports.py +++ b/backend/satellite_tools/reports.py @@ -15,7 +15,10 @@ class report: self._load(full_path)
def _load(self, full_path): - fd = open(full_path, 'r') + try: + fd = open(full_path, 'r') + except (IOError): + raise spacewalk_unknown_report tag = None value = '' re_comment = re.compile('^\s*#') @@ -48,6 +51,9 @@ class report: raise spacewalk_report_unknown_tag_exception(tag)
+class spacewalk_unknown_report(Exception): + pass + class spacewalk_report_unknown_tag_exception(Exception): pass
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index 80f0386..973f5f0 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -74,7 +74,10 @@ if __name__ == '__main__': initCFG('server') rhnSQL.initDB(options.db)
- report = reports.report(sys.argv[1]) + try: + report = reports.report(sys.argv[1]) + except(reports.spacewalk_unknown_report): + systemExit(-4, 'Unknown report [%s].' % sys.argv[1]) writer = csv.writer(sys.stdout)
h = rhnSQL.prepare(report.sql)
commit 792cb55228151f56d1846bffffb22ddaa83270ad Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 15:19:47 2009 +0200
reporting: change structure of the report definition file to also include column names.
This is also used to check that the report definition matches with column names returned by the query.
diff --git a/backend/satellite_tools/reports.py b/backend/satellite_tools/reports.py index b82b7ac..a8afd2c 100644 --- a/backend/satellite_tools/reports.py +++ b/backend/satellite_tools/reports.py @@ -1,5 +1,6 @@
import os +import re
REPORT_DEFINITIONS = "/usr/share/spacewalk/reports/data"
@@ -9,6 +10,44 @@ def available_reports(): class report: def __init__(self, name): full_path = os.path.join(REPORT_DEFINITIONS, name) + self.sql = None + self.columns = None + self._load(full_path) + + def _load(self, full_path): fd = open(full_path, 'r') - self.sql = fd.read() + tag = None + value = '' + re_comment = re.compile('^\s*#') + re_tag_name = re.compile('^(\S+):\s*$') + + for line in fd: + result = re_comment.match(line) + if result != None: + continue + + result = re_tag_name.match(line) + if result != None: + if tag != None: + self._set(tag, value) + tag = None + value = '' + tag = result.group(1) + else: + value += line + + if tag != None: + self._set(tag, value) + + def _set(self, tag, value): + if tag == 'columns': + self.columns = filter(lambda x: x != '', re.split('\s+', value)) + elif tag == 'sql': + self.sql = value + else: + raise spacewalk_report_unknown_tag_exception(tag) + + +class spacewalk_report_unknown_tag_exception(Exception): + pass
diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory index e3559b5..1921ccb 100755 --- a/backend/satellite_tools/reports/data/inventory +++ b/backend/satellite_tools/reports/data/inventory @@ -1,4 +1,20 @@ - + +columns: + + server_id + profile_name + hostname + ip_address + registered_by + registration_time + last_checkin_time + kernel_version + packages_out_of_date + errata_out_of_date + software_channel + +sql: + select rhnserver.id as server_id, rhnserver.name as profile_name, rhnservernetwork.hostname, trim(rhnservernetwork.ipaddr) as ip_address, ( select login from web_contact where rhnserver.creator_id = web_contact.id ) as registered_by, diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index 8b16eed..80f0386 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -79,7 +79,13 @@ if __name__ == '__main__':
h = rhnSQL.prepare(report.sql) h.execute() - writer.writerow(map(lambda x: x[0].lower(), h.description)) + + db_columns = map(lambda x: x[0].lower(), h.description) + if db_columns != report.columns: + systemExit(-3, \ + "Columns in report spec and in the database do not match:\nexpected %s\n got %s" % ( report.columns, db_columns )) + writer.writerow(report.columns) + row = h.fetchone() while row != None: writer.writerow(row)
commit 552f13cf0d75d8bb6dff2461825863291ff023c5 Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 14:55:03 2009 +0200
reporting: add channel(s) to which the server is registered.
diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory index 304a70b..e3559b5 100755 --- a/backend/satellite_tools/reports/data/inventory +++ b/backend/satellite_tools/reports/data/inventory @@ -8,7 +8,8 @@ ( select count(distinct rhnpackage.name_id) from rhnpackage, rhnserverneededpackagecache where rhnserver.id = rhnserverneededpackagecache.server_id and rhnserverneededpackagecache.package_id = rhnpackage.id ) as packages_out_of_date, - ( select count(*) from rhnServerErrataTypeView where rhnserver.id = server_id ) as errata_out_of_date + ( select count(*) from rhnServerErrataTypeView where rhnserver.id = server_id ) as errata_out_of_date, + rhnchannel.name as software_channel from rhnserver, ( select server_id, hostname, ipaddr @@ -18,7 +19,10 @@ from rhnservernetwork group by server_id ) - ) rhnservernetwork + ) rhnservernetwork, + rhnserverchannel, rhnchannel where rhnserver.id = rhnservernetwork.server_id (+) - order by server_id + and rhnserver.id = rhnserverchannel.server_id (+) + and rhnserverchannel.channel_id = rhnchannel.id (+) + order by server_id, rhnchannel.parent_channel nulls first, rhnchannel.id
commit d601eb82e67ca34a7ba8a784cfcf43f3c9cb5d93 Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 14:50:26 2009 +0200
reporting: add number of out-of-date packages and errata.
diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory index 2483419..304a70b 100755 --- a/backend/satellite_tools/reports/data/inventory +++ b/backend/satellite_tools/reports/data/inventory @@ -4,7 +4,11 @@ ( select login from web_contact where rhnserver.creator_id = web_contact.id ) as registered_by, to_char(rhnserver.created, 'YYYY-MM-DD HH24:MI:SS') as registration_time, ( select to_char(checkin, 'YYYY-MM-DD HH24:MI:SS') from rhnserverinfo where rhnserver.id = server_id ) as last_checkin_time, - running_kernel as kernel_version + running_kernel as kernel_version, + ( select count(distinct rhnpackage.name_id) from rhnpackage, rhnserverneededpackagecache + where rhnserver.id = rhnserverneededpackagecache.server_id + and rhnserverneededpackagecache.package_id = rhnpackage.id ) as packages_out_of_date, + ( select count(*) from rhnServerErrataTypeView where rhnserver.id = server_id ) as errata_out_of_date from rhnserver, ( select server_id, hostname, ipaddr
commit f80bc201023ff87ef282c723e640377ae4f8df0f Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 14:49:25 2009 +0200
reporting: add kernel version to the report.
diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory index 3d33ad5..2483419 100755 --- a/backend/satellite_tools/reports/data/inventory +++ b/backend/satellite_tools/reports/data/inventory @@ -3,7 +3,8 @@ rhnservernetwork.hostname, trim(rhnservernetwork.ipaddr) as ip_address, ( select login from web_contact where rhnserver.creator_id = web_contact.id ) as registered_by, to_char(rhnserver.created, 'YYYY-MM-DD HH24:MI:SS') as registration_time, - ( select to_char(checkin, 'YYYY-MM-DD HH24:MI:SS') from rhnserverinfo where rhnserver.id = server_id ) as last_checkin_time + ( select to_char(checkin, 'YYYY-MM-DD HH24:MI:SS') from rhnserverinfo where rhnserver.id = server_id ) as last_checkin_time, + running_kernel as kernel_version from rhnserver, ( select server_id, hostname, ipaddr
commit 0b64232669032fbe2c2682661c2a60f42dab341c Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 14:45:55 2009 +0200
reporting: when report name is not specified on the command line, show list of available reports.
diff --git a/backend/satellite_tools/reports.py b/backend/satellite_tools/reports.py index d0e7ae6..b82b7ac 100644 --- a/backend/satellite_tools/reports.py +++ b/backend/satellite_tools/reports.py @@ -3,6 +3,9 @@ import os
REPORT_DEFINITIONS = "/usr/share/spacewalk/reports/data"
+def available_reports(): + return os.listdir(REPORT_DEFINITIONS) + class report: def __init__(self, name): full_path = os.path.join(REPORT_DEFINITIONS, name) diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index 216d52a..8b16eed 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -57,7 +57,9 @@ def processCommandline(): + ' default is default_db from /etc/rhn/rhn.conf'), ]
- optionParser = OptionParser(option_list=optionsTable) + optionParser = OptionParser( \ + usage="usage: %s [options] [report_name [report_options]]" % sys.argv[0], \ + option_list=optionsTable) optionParser.disable_interspersed_args() options, args = optionParser.parse_args()
@@ -68,19 +70,23 @@ if __name__ == '__main__': options = processCommandline()
try: - initCFG('server') - rhnSQL.initDB(options.db) - - report = reports.report(sys.argv[1]) - writer = csv.writer(sys.stdout) - - h = rhnSQL.prepare(report.sql) - h.execute() - writer.writerow(map(lambda x: x[0].lower(), h.description)) - row = h.fetchone() - while row != None: - writer.writerow(row) + if len(sys.argv) > 1: + initCFG('server') + rhnSQL.initDB(options.db) + + report = reports.report(sys.argv[1]) + writer = csv.writer(sys.stdout) + + h = rhnSQL.prepare(report.sql) + h.execute() + writer.writerow(map(lambda x: x[0].lower(), h.description)) row = h.fetchone() + while row != None: + writer.writerow(row) + row = h.fetchone() + else: + for r in reports.available_reports(): + print r
except KeyboardInterrupt: systemExit(-1, "\nUser interrupted process.")
commit 8b5b5c0e4fff24c28aae8687d2d45bbaf7d9655d Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 23 14:44:18 2009 +0200
493060 - do not send email "RHN Monitoring Scout started" by default
diff --git a/monitoring/SatConfig/bootstrap/npBootstrap.pl b/monitoring/SatConfig/bootstrap/npBootstrap.pl index 3f30888..2b73df3 100755 --- a/monitoring/SatConfig/bootstrap/npBootstrap.pl +++ b/monitoring/SatConfig/bootstrap/npBootstrap.pl @@ -23,6 +23,7 @@ my $soapbox = new NOCpulse::Gritch('/var/lib/nocpulse/npBootstrap.db'); # get the scout_shared_key formt he /etc/rhn/cluster.ini file my $cluster_config = NOCpulse::Config->new('/etc/rhn/cluster.ini'); my $ssk=$cluster_config->get('', 'scoutsharedkey'); +my $notify_scout_start = $cluster_config->get('', 'notify_scout_start');
my $gritchMsg; if (!$ssk) { @@ -106,7 +107,7 @@ if ($res->is_success) { unlink($llnsFile); } # Send notification that the sat may have been rebooted. - $soapbox->gritch('RHN Monitoring Scout started', $gritchMsg); + $soapbox->gritch('RHN Monitoring Scout started', $gritchMsg) if ($notify_scout_start);
} else { # Send notification that the sat may have been rebooted. diff --git a/proxy/installer/cluster.ini b/proxy/installer/cluster.ini index 5cb0ec1..d4563e3 100644 --- a/proxy/installer/cluster.ini +++ b/proxy/installer/cluster.ini @@ -6,3 +6,4 @@ smontestaddr=${session.rhn_monitoring_parent_ip} smontestfqdn=${session.rhn_monitoring_parent} scoutsharedkey=${session.scout_shared_key} PhysNode.1.exists=1 +notify_scout_start=0 diff --git a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/cluster.ini b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/cluster.ini index 203d5ff..68376d4 100644 --- a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/cluster.ini +++ b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/cluster.ini @@ -9,3 +9,4 @@ smontestaddr=@@monitoringDOTsmonDOTtestaddr@@ smontestfqdn=@@monitoringDOTsmonDOTtestfqdn@@ scoutsharedkey=@@monitoringDOTscout_shared_key@@ PhysNode.1.exists=1 +notify_scout_start=0 diff --git a/web/html/applications/rhn-proxy/5.3/cluster.ini b/web/html/applications/rhn-proxy/5.3/cluster.ini index 5cb0ec1..d4563e3 100644 --- a/web/html/applications/rhn-proxy/5.3/cluster.ini +++ b/web/html/applications/rhn-proxy/5.3/cluster.ini @@ -6,3 +6,4 @@ smontestaddr=${session.rhn_monitoring_parent_ip} smontestfqdn=${session.rhn_monitoring_parent} scoutsharedkey=${session.scout_shared_key} PhysNode.1.exists=1 +notify_scout_start=0
commit 3541da9e12b8d29227b3540f337f478ee0bfcf21 Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 14:30:11 2009 +0200
reporting: move the SQL to definition file, to allow for multiple reports.
diff --git a/backend/Makefile.defs b/backend/Makefile.defs index 4ae90b6..ee3fe86 100644 --- a/backend/Makefile.defs +++ b/backend/Makefile.defs @@ -9,6 +9,9 @@ TOP ?= . ROOT ?= /usr/share/rhn export ROOT
+SPACEWALK_ROOT ?= /usr/share/spacewalk +export SPACEWALK_ROOT + PREFIX ?= export PREFIX
@@ -29,18 +32,25 @@ PYFILES = $(addsuffix .py,$(FILES)) PYCFILES = $(addsuffix .pyc,$(FILES)) PYOFILES = $(addsuffix .pyo,$(FILES))
+SPACEWALK_PYFILES = $(addsuffix .py,$(SPACEWALK_FILES)) +SPACEWALK_PYCFILES = $(addsuffix .pyc,$(SPACEWALK_FILES)) + # what do we need to install and where INSTALL_FILES += $(PYFILES) $(PYCFILES) INSTALL_DEST ?= $(ROOT)/$(SUBDIR)
+SPACEWALK_INSTALL_FILES += $(SPACEWALK_PYFILES) $(SPACEWALK_PYCFILES) + DIRS += $(addprefix $(PREFIX), \ - $(sort $(EXTRA_DIRS)) $(INSTALL_DEST)) + $(sort $(EXTRA_DIRS)) $(INSTALL_DEST) $(SPACEWALK_ROOT))
all :: $(INSTALL_FILES)
-install :: all $(DIRS) $(INSTALL_FILES) +install :: all $(DIRS) $(INSTALL_FILES) $(SPACEWALK_INSTALL_FILES) @$(foreach f,$(INSTALL_FILES), \ $(INSTALL_DATA) $(f) $(PREFIX)$(INSTALL_DEST)/$(f) ; ) + @$(foreach f,$(SPACEWALK_INSTALL_FILES), \ + $(INSTALL_DATA) $(f) $(PREFIX)$(SPACEWALK_ROOT)/$(f) ; )
$(DIRS): $(INSTALL_DIR) $@ diff --git a/backend/satellite_tools/Makefile b/backend/satellite_tools/Makefile index b783b27..c2c08c0 100644 --- a/backend/satellite_tools/Makefile +++ b/backend/satellite_tools/Makefile @@ -19,6 +19,12 @@ SCRIPTS = satellite-sync spacewalk-debug\ rhn-ssl-dbstore update-packages rhn-db-stats \ spacewalk-report
+SPACEWALK_SUBDIRS = reports reports/data + +SPACEWALK_FILES = reports + +SPACEWALK_REPORT_FILES = reports/data + # check if we can build man pages DOCBOOK = $(wildcard /usr/bin/docbook2man)
@@ -40,6 +46,8 @@ include $(TOP)/Makefile.defs all :: $(SCRIPTS) install :: $(SCRIPTS) $(PREFIX)/$(BINDIR) $(INSTALL_BIN) $(SCRIPTS) $(PREFIX)/$(BINDIR) + $(INSTALL_DIR) $(addprefix $(PREFIX)$(SPACEWALK_ROOT)/, $(SPACEWALK_SUBDIRS)) + $(INSTALL_DATA) $(SPACEWALK_REPORT_FILES)/* $(PREFIX)$(SPACEWALK_ROOT)/reports/data
ifneq ($(DOCBOOK),) # install man pages diff --git a/backend/satellite_tools/reports.py b/backend/satellite_tools/reports.py new file mode 100644 index 0000000..d0e7ae6 --- /dev/null +++ b/backend/satellite_tools/reports.py @@ -0,0 +1,11 @@ + +import os + +REPORT_DEFINITIONS = "/usr/share/spacewalk/reports/data" + +class report: + def __init__(self, name): + full_path = os.path.join(REPORT_DEFINITIONS, name) + fd = open(full_path, 'r') + self.sql = fd.read() + diff --git a/backend/satellite_tools/reports/data/inventory b/backend/satellite_tools/reports/data/inventory new file mode 100755 index 0000000..3d33ad5 --- /dev/null +++ b/backend/satellite_tools/reports/data/inventory @@ -0,0 +1,19 @@ + + select rhnserver.id as server_id, rhnserver.name as profile_name, + rhnservernetwork.hostname, trim(rhnservernetwork.ipaddr) as ip_address, + ( select login from web_contact where rhnserver.creator_id = web_contact.id ) as registered_by, + to_char(rhnserver.created, 'YYYY-MM-DD HH24:MI:SS') as registration_time, + ( select to_char(checkin, 'YYYY-MM-DD HH24:MI:SS') from rhnserverinfo where rhnserver.id = server_id ) as last_checkin_time + from rhnserver, + ( + select server_id, hostname, ipaddr + from rhnservernetwork + where id in ( + select min(id) + from rhnservernetwork + group by server_id + ) + ) rhnservernetwork + where rhnserver.id = rhnservernetwork.server_id (+) + order by server_id + diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index 2f7c30d..216d52a 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -35,6 +35,9 @@ _LIBPATH = "/usr/share/rhn" if _LIBPATH not in sys.path: sys.path.append(_LIBPATH)
+sys.path.append('/usr/share/spacewalk') +import reports + try: from server import rhnSQL from common import initCFG @@ -67,27 +70,11 @@ if __name__ == '__main__': try: initCFG('server') rhnSQL.initDB(options.db) + + report = reports.report(sys.argv[1]) writer = csv.writer(sys.stdout)
- h = rhnSQL.prepare(""" - select rhnserver.id as server_id, rhnserver.name as profile_name, - rhnservernetwork.hostname, trim(rhnservernetwork.ipaddr) as ip_address, - ( select login from web_contact where rhnserver.creator_id = web_contact.id ) as registered_by, - to_char(rhnserver.created, 'YYYY-MM-DD HH24:MI:SS') as registration_time, - ( select to_char(checkin, 'YYYY-MM-DD HH24:MI:SS') from rhnserverinfo where rhnserver.id = server_id ) as last_checkin_time - from rhnserver, - ( - select server_id, hostname, ipaddr - from rhnservernetwork - where id in ( - select min(id) - from rhnservernetwork - group by server_id - ) - ) rhnservernetwork - where rhnserver.id = rhnservernetwork.server_id (+) - order by server_id - """) + h = rhnSQL.prepare(report.sql) h.execute() writer.writerow(map(lambda x: x[0].lower(), h.description)) row = h.fetchone() diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec index 20a389d..bdaeca6 100644 --- a/backend/spacewalk-backend.spec +++ b/backend/spacewalk-backend.spec @@ -535,6 +535,8 @@ rm -f %{rhnconf}/rhnSecret.py* %{rhnroot}/satellite_tools/disk_dumper/iss_actions.py* %{rhnroot}/satellite_tools/disk_dumper/dumper.py* %{rhnroot}/satellite_tools/disk_dumper/string_buffer.py* +%{_prefix}/share/spacewalk/reports.py* +%{_prefix}/share/spacewalk/reports/data/* %config %attr(644,root,apache) %{rhnconf}/default/rhn_server_iss.conf %{_mandir}/man8/rhn-satellite-exporter.8* %{_mandir}/man8/rhn-charsets.8*
commit 69ad5bbfb82751750c1dcc7ad290d9036a7523ab Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 11:58:07 2009 +0200
reporting: add registration time and last check-in time.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index d59002f..2f7c30d 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -72,7 +72,9 @@ if __name__ == '__main__': h = rhnSQL.prepare(""" select rhnserver.id as server_id, rhnserver.name as profile_name, rhnservernetwork.hostname, trim(rhnservernetwork.ipaddr) as ip_address, - ( select login from web_contact where rhnserver.creator_id = web_contact.id ) as registered_by + ( select login from web_contact where rhnserver.creator_id = web_contact.id ) as registered_by, + to_char(rhnserver.created, 'YYYY-MM-DD HH24:MI:SS') as registration_time, + ( select to_char(checkin, 'YYYY-MM-DD HH24:MI:SS') from rhnserverinfo where rhnserver.id = server_id ) as last_checkin_time from rhnserver, ( select server_id, hostname, ipaddr
commit 098b65571e1dc68befea88cad6863fab44440109 Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 11:46:05 2009 +0200
reporting: add the registered by information.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index f73039c..d59002f 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -71,7 +71,8 @@ if __name__ == '__main__':
h = rhnSQL.prepare(""" select rhnserver.id as server_id, rhnserver.name as profile_name, - rhnservernetwork.hostname, trim(rhnservernetwork.ipaddr) as ip_address + rhnservernetwork.hostname, trim(rhnservernetwork.ipaddr) as ip_address, + ( select login from web_contact where rhnserver.creator_id = web_contact.id ) as registered_by from rhnserver, ( select server_id, hostname, ipaddr
commit 0ffac924319092a2e35f6951859b1f2a9227ddd4 Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 11:44:43 2009 +0200
reporting: add hostname and IP address to the report.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index af2cad4..f73039c 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -70,8 +70,19 @@ if __name__ == '__main__': writer = csv.writer(sys.stdout)
h = rhnSQL.prepare(""" - select rhnserver.id as server_id, rhnserver.name as profile_name - from rhnserver + select rhnserver.id as server_id, rhnserver.name as profile_name, + rhnservernetwork.hostname, trim(rhnservernetwork.ipaddr) as ip_address + from rhnserver, + ( + select server_id, hostname, ipaddr + from rhnservernetwork + where id in ( + select min(id) + from rhnservernetwork + group by server_id + ) + ) rhnservernetwork + where rhnserver.id = rhnservernetwork.server_id (+) order by server_id """) h.execute()
commit d3d685fbe17635102e8a0b6c57a4c6a57538306d Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 11:41:54 2009 +0200
reporting: output field names as the first row.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index 215b2bd..af2cad4 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -75,6 +75,7 @@ if __name__ == '__main__': order by server_id """) h.execute() + writer.writerow(map(lambda x: x[0].lower(), h.description)) row = h.fetchone() while row != None: writer.writerow(row)
commit 8c9ea063cd874739a2c02398d3ce8875cb07ceda Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 11:37:13 2009 +0200
reporting: output formatted as csv.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index 2a2550a..215b2bd 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -25,6 +25,7 @@ def systemExit(code, msgs=None):
try: import os + import csv except KeyboardInterrupt: systemExit(-1, "\nUser interrupted process.")
@@ -66,6 +67,7 @@ if __name__ == '__main__': try: initCFG('server') rhnSQL.initDB(options.db) + writer = csv.writer(sys.stdout)
h = rhnSQL.prepare(""" select rhnserver.id as server_id, rhnserver.name as profile_name @@ -75,7 +77,7 @@ if __name__ == '__main__': h.execute() row = h.fetchone() while row != None: - print row + writer.writerow(row) row = h.fetchone()
except KeyboardInterrupt:
commit bcda8a8e13d24aa53ceb19cdd5c27b3950cb0bec Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 23 11:28:35 2009 +0200
Automatic commit of package [perl-NOCpulse-Probe] release [1.183.9-1].
diff --git a/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec b/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec index 409d1c8..e3aff97 100644 --- a/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec +++ b/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec @@ -2,7 +2,7 @@ Name: perl-NOCpulse-Probe Summary: Probe execution framework URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... -Version: 1.183.8 +Version: 1.183.9 Release: 1%{?dist} BuildArch: noarch Group: Development/Libraries @@ -70,7 +70,7 @@ rm -rf $RPM_BUILD_ROOT %doc LICENSE
%changelog -* Thu Jul 23 2009 Miroslav Suchý msuchy@redhat.com 1.183.8-1 +* Thu Jul 23 2009 Miroslav Suchý msuchy@redhat.com 1.183.9-1 - 512749 - fix path to file during man page generation
* Wed Apr 15 2009 Devan Goodwin dgoodwin@redhat.com 1.183.7-1 diff --git a/rel-eng/packages/perl-NOCpulse-Probe b/rel-eng/packages/perl-NOCpulse-Probe index 29174f2..d3ac8ae 100644 --- a/rel-eng/packages/perl-NOCpulse-Probe +++ b/rel-eng/packages/perl-NOCpulse-Probe @@ -1 +1 @@ -1.183.8-1 monitoring/PerlModules/NP/Probe/ +1.183.9-1 monitoring/PerlModules/NP/Probe/
commit 5c2e4bdd0c83bf24f86302def755c8475c290dab Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 23 11:27:41 2009 +0200
fix path to file when generating man page
addressing Bug 512749
diff --git a/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec b/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec index 1221140..409d1c8 100644 --- a/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec +++ b/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec @@ -50,11 +50,11 @@ install -m 644 test/*.pm $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/test/ mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3 /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/ItemStatus.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::ItemStatus.3pm.gz /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/DataSource/MySQL.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::DataSource::MySQL.3pm.gz -/usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/DataSource/NetworkServiceCommands.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::DataSource::NetworkServiceCommands.3pm.gz +/usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/DataSource/NetworkServiceCommand.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::DataSource::NetworkServiceCommand.3pm.gz /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/Result.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::Result.3pm.gz /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/Shell/AbstractShell.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::Shell::AbstractShell.3pm.gz /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/Shell/SSH.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::Shell::SSH.3pm.gz -/usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/Shell/SQLPLus.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::Shell::SQLPLus.3pm.gz +/usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/Shell/SQLPlus.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::Shell::SQLPlus.3pm.gz /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/Shell/Local.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::Shell::Local.3pm.gz /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/Shell/Unix.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::Shell::Unix.3pm.gz
commit fd2ec1b9a93b76b8e2720844178f38a80b9c6b23 Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 11:25:05 2009 +0200
reporting: initial prepare, execute, and fetch loop.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report index ca7b63d..2a2550a 100755 --- a/backend/satellite_tools/spacewalk-report +++ b/backend/satellite_tools/spacewalk-report @@ -66,6 +66,18 @@ if __name__ == '__main__': try: initCFG('server') rhnSQL.initDB(options.db) + + h = rhnSQL.prepare(""" + select rhnserver.id as server_id, rhnserver.name as profile_name + from rhnserver + order by server_id + """) + h.execute() + row = h.fetchone() + while row != None: + print row + row = h.fetchone() + except KeyboardInterrupt: systemExit(-1, "\nUser interrupted process.") except (rhnSQL.SQLError, rhnSQL.SQLSchemaError, rhnSQL.SQLConnectError), e:
commit b5e172bdcfef48994e2a20b7883df34f71ffdd35 Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 23 11:23:50 2009 +0200
Automatic commit of package [perl-NOCpulse-Probe] release [1.183.8-1].
diff --git a/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec b/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec index 5116b54..1221140 100644 --- a/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec +++ b/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec @@ -2,7 +2,7 @@ Name: perl-NOCpulse-Probe Summary: Probe execution framework URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... -Version: 1.183.7 +Version: 1.183.8 Release: 1%{?dist} BuildArch: noarch Group: Development/Libraries @@ -70,6 +70,9 @@ rm -rf $RPM_BUILD_ROOT %doc LICENSE
%changelog +* Thu Jul 23 2009 Miroslav Suchý msuchy@redhat.com 1.183.8-1 +- 512749 - fix path to file during man page generation + * Wed Apr 15 2009 Devan Goodwin dgoodwin@redhat.com 1.183.7-1 - fix various perl -w warnings (msuchy@redhat.com) - Fix ownership of nocpulse directory (msuchy@redhat.com) diff --git a/rel-eng/packages/perl-NOCpulse-Probe b/rel-eng/packages/perl-NOCpulse-Probe index 0995f59..29174f2 100644 --- a/rel-eng/packages/perl-NOCpulse-Probe +++ b/rel-eng/packages/perl-NOCpulse-Probe @@ -1 +1 @@ -1.183.7-1 monitoring/PerlModules/NP/Probe/ +1.183.8-1 monitoring/PerlModules/NP/Probe/
commit c839c9748c0b780afeaeb62f6e12d15be71e75a7 Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 23 11:19:55 2009 +0200
fix path to file when generating man page
addressing Bug 512749
diff --git a/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec b/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec index 37ad8e8..5116b54 100644 --- a/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec +++ b/monitoring/PerlModules/NP/Probe/perl-NOCpulse-Probe.spec @@ -50,7 +50,7 @@ install -m 644 test/*.pm $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/test/ mkdir -p $RPM_BUILD_ROOT%{_mandir}/man3 /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/ItemStatus.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::ItemStatus.3pm.gz /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/DataSource/MySQL.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::DataSource::MySQL.3pm.gz -/usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/DataSource::NetworkServiceCommands.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::DataSource::NetworkServiceCommands.3pm.gz +/usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/DataSource/NetworkServiceCommands.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::DataSource::NetworkServiceCommands.3pm.gz /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/Result.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::Result.3pm.gz /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/Shell/AbstractShell.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::Shell::AbstractShell.3pm.gz /usr/bin/pod2man $RPM_BUILD_ROOT%{perl_vendorlib}/NOCpulse/Probe/Shell/SSH.pm |gzip > $RPM_BUILD_ROOT%{_mandir}/man3/NOCpulse::Probe::Shell::SSH.3pm.gz
commit 8549dc3f0006143c60732923fddbee3496630d73 Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 10:51:47 2009 +0200
reporting: add spacewalk-report to the rpm package.
diff --git a/backend/satellite_tools/Makefile b/backend/satellite_tools/Makefile index 9c02dce..b783b27 100644 --- a/backend/satellite_tools/Makefile +++ b/backend/satellite_tools/Makefile @@ -16,7 +16,8 @@ FILES = __init__ connection diskImportLib messages \
SCRIPTS = satellite-sync spacewalk-debug\ rhn-schema-version rhn-satellite-activate rhn-charsets \ - rhn-ssl-dbstore update-packages rhn-db-stats + rhn-ssl-dbstore update-packages rhn-db-stats \ + spacewalk-report
# check if we can build man pages DOCBOOK = $(wildcard /usr/bin/docbook2man) diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec index 4037804..20a389d 100644 --- a/backend/spacewalk-backend.spec +++ b/backend/spacewalk-backend.spec @@ -505,6 +505,7 @@ rm -f %{rhnconf}/rhnSecret.py* %attr(755,root,root) %{_bindir}/rhn-ssl-dbstore %attr(755,root,root) %{_bindir}/satellite-sync %attr(755,root,root) %{_bindir}/spacewalk-debug +%attr(755,root,root) %{_bindir}/spacewalk-report %attr(755,root,root) %{_bindir}/rhn-satellite-exporter %attr(755,root,root) %{_bindir}/update-packages %attr(755,root,root) %{_bindir}/rhn-db-stats
commit 43c47fe0c2e23058f071c5d3ee725f724904c331 Author: Jan Pazdziora jpazdziora@redhat.com Date: Thu Jul 23 10:09:41 2009 +0200
reporting: a stub for new script, spacewalk-report.
diff --git a/backend/satellite_tools/spacewalk-report b/backend/satellite_tools/spacewalk-report new file mode 100755 index 0000000..ca7b63d --- /dev/null +++ b/backend/satellite_tools/spacewalk-report @@ -0,0 +1,75 @@ +#!/usr/bin/python -u +# +# 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. +# + +import sys +def systemExit(code, msgs=None): + """ exit with message and code """ + if msgs: + if type(msgs) not in [type([]), type(())]: + msgs = (msgs, ) + for msg in msgs: + sys.stderr.write(str(msg)+'\n') + sys.exit(code) + +try: + import os +except KeyboardInterrupt: + systemExit(-1, "\nUser interrupted process.") + + +_LIBPATH = "/usr/share/rhn" +# add to the path if need be +if _LIBPATH not in sys.path: + sys.path.append(_LIBPATH) + +try: + from server import rhnSQL + from common import initCFG +except KeyboardInterrupt: + systemExit(-1, "\nUser interrupted process.") + + +def processCommandline(): + """ process the commandline """ + try: + from optparse import Option, OptionParser + except KeyboardInterrupt: + systemExit(-1, "\nUser interrupted process.") + optionsTable = [ + Option('--db', action='store', type="string", + help='alternative database string (username/password@sid);' \ + + ' default is default_db from /etc/rhn/rhn.conf'), + ] + + optionParser = OptionParser(option_list=optionsTable) + optionParser.disable_interspersed_args() + options, args = optionParser.parse_args() + + return options + + +if __name__ == '__main__': + options = processCommandline() + + try: + initCFG('server') + rhnSQL.initDB(options.db) + except KeyboardInterrupt: + systemExit(-1, "\nUser interrupted process.") + except (rhnSQL.SQLError, rhnSQL.SQLSchemaError, rhnSQL.SQLConnectError), e: + # really a stub for better exception handling in the future. + sys.stderr.write("SQL error occurred, traceback follows...\n") + raise +
commit ed4d2e425fdd58e655d31565800abfae54d8e02f Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 23 10:18:58 2009 +0200
specify login shell for useradd
diff --git a/monitoring/nocpulse-common/nocpulse-common.spec b/monitoring/nocpulse-common/nocpulse-common.spec index 7309672..15abb5b 100644 --- a/monitoring/nocpulse-common/nocpulse-common.spec +++ b/monitoring/nocpulse-common/nocpulse-common.spec @@ -79,7 +79,7 @@ if [ -d /home/nocpulse -a 0`id -u nocpulse 2> /dev/null` -ge 500 ]; then
# find lowest unused system uid to change nocpulse uid to old_uid=`id -u nocpulse` - useradd -r tempnoc + useradd -r tempnoc -s /bin/bash uid=`id -u tempnoc` userdel tempnoc usermod -u $uid nocpulse @@ -92,7 +92,7 @@ fi
getent group %{package_name} >/dev/null || groupadd -r %{package_name} getent passwd %{package_name} >/dev/null || \ -useradd -r -g %{package_name} -G apache -d %{_var}/lib/%{package_name} -c "NOCpulse user" %{package_name} +useradd -r -g %{package_name} -G apache -d %{_var}/lib/%{package_name} -s /bin/bash -c "NOCpulse user" %{package_name} /usr/bin/passwd -l %{package_name} >/dev/null
# if user already exists (rhnmd creates it too) add nocpulse to apache group
commit a692c45fef62adf9417bbe100abe9c7f463463c1 Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 23 10:14:35 2009 +0200
457011 - add warning to top of file. This file should not be edited manualy
diff --git a/monitoring/nocpulse-common/perl-API/NOCpulse/NOCpulseini.pm b/monitoring/nocpulse-common/perl-API/NOCpulse/NOCpulseini.pm index dd47273..9f9818b 100644 --- a/monitoring/nocpulse-common/perl-API/NOCpulse/NOCpulseini.pm +++ b/monitoring/nocpulse-common/perl-API/NOCpulse/NOCpulseini.pm @@ -67,7 +67,10 @@ sub save { $@ = "Couldn't open $filename: $!"; return undef; } - print $fh $data; + print $fh <<WARNING, $data; +# You should not edit this file directly. All changes will be lost after +# Monitoring restart. Please use script NOCpulse-ini. +WARNING $fh->close(); # Be sure to make the file world-readable! chmod(0644, $filename) or die "Couldn't chmod $filename: $!";
commit ef9c5abb917eae1127e0e836887f790e2d878c4b Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 23 10:10:34 2009 +0200
Automatic commit of package [SatConfig-general] release [1.216.12-1].
diff --git a/monitoring/SatConfig/general/SatConfig-general.spec b/monitoring/SatConfig/general/SatConfig-general.spec index 4f6fdcd..a4f56cc 100644 --- a/monitoring/SatConfig/general/SatConfig-general.spec +++ b/monitoring/SatConfig/general/SatConfig-general.spec @@ -2,7 +2,7 @@ %define hb_res_dir %{_sysconfdir}/ha.d/resource.d %define installed_dir %sysv_dir/installed Name: SatConfig-general -Version: 1.216.11 +Version: 1.216.12 Release: 1%{?dist} Summary: Satellite Configuration System - general setup, used by many packages URL: https://fedorahosted.org/spacewalk @@ -63,6 +63,9 @@ install -D -m 644 NOCpulse-ini.8 $RPM_BUILD_ROOT%{_mandir}/man8/NOCpulse-ini.8 rm -rf $RPM_BUILD_ROOT
%changelog +* Thu Jul 23 2009 Miroslav Suchý msuchy@redhat.com 1.216.12-1 +- 457011 - create NOCpulse-ini - tool to handle NOCpulse.ini + * Thu Jun 18 2009 Miroslav Suchý msuchy@redhat.com 1.216.11-1 - 499564 - ignore already started/stopped service for InstallSoftwareConfig
diff --git a/rel-eng/packages/SatConfig-general b/rel-eng/packages/SatConfig-general index 79a8f7c..7e8d890 100644 --- a/rel-eng/packages/SatConfig-general +++ b/rel-eng/packages/SatConfig-general @@ -1 +1 @@ -1.216.11-1 monitoring/SatConfig/general/ +1.216.12-1 monitoring/SatConfig/general/
commit 6e2a26e27f874d4870cc9e9c9d36ea0768b95cff Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 23 10:08:38 2009 +0200
457011 - add manpage and documentation
diff --git a/monitoring/SatConfig/general/NOCpulse-ini b/monitoring/SatConfig/general/NOCpulse-ini index 1a08b66..f172631 100644 --- a/monitoring/SatConfig/general/NOCpulse-ini +++ b/monitoring/SatConfig/general/NOCpulse-ini @@ -1,5 +1,20 @@ #!/usr/bin/perl use strict; +# +# Copyright (c) 2009 Red Hat, Inc. +# +# This software is licensed to you under the GNU General Public License, +# version 2 (GPLv2). There is NO WARRANTY for this software, express or +# implied, including the implied warranties of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 +# along with this software; if not, see +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. +# +# Red Hat trademarks are not licensed under GPLv2. No permission is +# granted to use or replicate Red Hat trademarks that are incorporated +# in this software or its documentation. +# + use lib '/etc/rc.d/np.d'; use NOCpulse::NOCpulseini; use PhysCluster; @@ -14,6 +29,7 @@ my @macros = (); my $set_macro = ''; my $set_param = ''; my $new_value = ''; +my $help = 0; my $save = 0;
GetOptions("all" => $all, @@ -23,8 +39,27 @@ GetOptions("all" => $all, "set-macro:s" => $set_macro, "set-param:s" => $set_param, "new-value:s" => $new_value, + "help" => $help, );
+if ($help) { + print <<HELP; +Usage: + NOCpulse-ini --all + + NOCpulse-ini --group=general --group=mail + + NOCpulse-ini --raw --group mail + + NOCpulse-ini --macro=NPVAR --raw + + NOCpulse-ini --set-macro=SMONURL --new-value='%{XPROTO}://different.url.com' + + NOCpulse-ini --group queues --set-param=polling_interval --new-value=6 +HELP + exit; +} + my $cluster = PhysCluster->newInitialized('/etc/rhn/cluster.ini'); my $localConfig = $cluster->get_LocalConfig; my $ini = NOCpulse::NOCpulseini->new; @@ -102,3 +137,79 @@ if ($save) { $ini->save; }
+ +=pod + +=head1 NAME + +NOCpulse-ini - Show content of monitoring config file NOCpulse.ini and allow you to edit it. + +=head1 SYNOPSIS + +NOCpulse-ini [OPTIONS] + +=head1 DESCRIPTION + +Monitoring main configuration file NOCpulse.ini is human readable, but should not be edited. +This file is deleted and recreated during Monitoring start, therefore all changes in this file +are lost. +Values for this configuration file are stored in database and should be edited with script +NOCpulse-ini. + +WARNING: Changing of values is not recommended, as it can lead to non functional monitoring. + +If you use --set-macro or --set-param, then both database and NOCpulse.ini are updated. + +=head1 OPTIONS + +--all + Dump out full content of NOCpulse.ini as seen by database. + +--group + Dump out content of NOCpulse.ini as seen by database. Dump only part which belongs to this group. + May be specified multiple times. + +--raw + Macros are not expanded. + +--macro + Write value of given macro. + +--set-macro + Change value of this macro. + +--set-param + Change value of parameter. + +--new-value + Set the new value for macro or parameter. + +=head1 EXAMPLES + + NOCpulse-ini --all + + NOCpulse-ini --group=general --group=mail + + NOCpulse-ini --raw --group mail + + NOCpulse-ini --macro=NPVAR --raw + + NOCpulse-ini --set-macro=SMONURL --new-value='%{XPROTO}://different.url.com' + + NOCpulse-ini --group queues --set-param=polling_interval --new-value=6 + +=head1 SEE ALSO + +NOCpulse.ini(8) + +=head1 AUTHOR + +Miroslav Suchý msuchy@redhat.com + +=head1 COPYRIGHT AND LICENSE + +Copyright (c) 2009 Red Hat, Inc. +Released under GNU General Public License, version 2 (GPLv2). + +=cut + diff --git a/monitoring/SatConfig/general/SatConfig-general.spec b/monitoring/SatConfig/general/SatConfig-general.spec index 9f857ca..4f6fdcd 100644 --- a/monitoring/SatConfig/general/SatConfig-general.spec +++ b/monitoring/SatConfig/general/SatConfig-general.spec @@ -22,7 +22,7 @@ to make a monitoring work. %setup -q
%build -#nothing to do here +pod2man --section=8 NOCpulse-ini NOCpulse-ini.8
%install rm -rf $RPM_BUILD_ROOT @@ -40,6 +40,7 @@ install -m 755 validateConfiguration $RPM_BUILD_ROOT%sysv_dir install -m 755 pip $RPM_BUILD_ROOT%sysv_dir install -m 444 SysV.ini $RPM_BUILD_ROOT%sysv_dir ln -s ../../rc.d/np.d/hbResource $RPM_BUILD_ROOT%hb_res_dir/ClusterLeader +install -D -m 644 NOCpulse-ini.8 $RPM_BUILD_ROOT%{_mandir}/man8/NOCpulse-ini.8
%files %defattr(-,root,root,-) @@ -56,6 +57,7 @@ ln -s ../../rc.d/np.d/hbResource $RPM_BUILD_ROOT%hb_res_dir/ClusterLeader %sysv_dir/SysV.ini %hb_res_dir/* %doc 1-STARTUP_SEQUENCE 2-COMMANDS_OVERVIEW 3-CONFIGURATION 4-DEVELOPMENT 5-STEPS_LEGEND +%{_mandir}/man8/NOCpulse-ini.8.*
%clean rm -rf $RPM_BUILD_ROOT
commit 4c8bfa73ccf479355c87141aa6914b2fdb716ffd Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 23 09:21:28 2009 +0200
457011 - create NOCpulse-ini - tool to handle NOCpulse.ini
diff --git a/monitoring/SatConfig/general/NOCpulse-ini b/monitoring/SatConfig/general/NOCpulse-ini new file mode 100644 index 0000000..1a08b66 --- /dev/null +++ b/monitoring/SatConfig/general/NOCpulse-ini @@ -0,0 +1,104 @@ +#!/usr/bin/perl +use strict; +use lib '/etc/rc.d/np.d'; +use NOCpulse::NOCpulseini; +use PhysCluster; +use Data::Dumper; +use Getopt::Long; + +#set the defaults +my $all = 0; +my @groups = (); +my $raw = 0; +my @macros = (); +my $set_macro = ''; +my $set_param = ''; +my $new_value = ''; +my $save = 0; + +GetOptions("all" => $all, + "group:s@" => @groups, + "raw" => $raw, + "macro:s@" => @macros, + "set-macro:s" => $set_macro, + "set-param:s" => $set_param, + "new-value:s" => $new_value, + ); + +my $cluster = PhysCluster->newInitialized('/etc/rhn/cluster.ini'); +my $localConfig = $cluster->get_LocalConfig; +my $ini = NOCpulse::NOCpulseini->new; + +if (%$localConfig) { + my $config = (values(%$localConfig))[0]; + my $dbd = $config->get_dbd; + my $dbname = $config->get_dbname; + my $username = $config->get_username; + my $password = $config->get_password; + $ini->connect($dbd, $dbname, $username, $password); + $ini->raw($raw); + $ini->fetch_nocpulseini('INTERNAL'); +} else { + print "Error: This script can be run only on monitoring backend.\n"; + exit 1; +} + +if ($all) { + print $ini->dump; +} elsif (@groups and !$set_param) { + foreach my $group (@groups) { + print $ini->dump_group($group), "\n\n"; + } +} +if (@macros) { + my $list = $ini->fetch_macros; + my %DESCRIPTION; + foreach my $macro (@$list) { + $DESCRIPTION{$macro->{'NAME'}} = $macro->{'DESCRIPTION'}; + } + foreach my $macro (@macros) { + if ($ini->macrodb->{$macro}) { + print "Macro $macro - $DESCRIPTION{$macro}\nexpands to: ", $ini->macrodb->{$macro}, "\n"; + } else { + print "Macro $macro is not defined.\n"; + } + } +} +if ($set_macro) { + my $sql = qq| + UPDATE rhn_config_macro + SET definition=? + WHERE (environment, name) = ( SELECT macro.environment, macro.name + FROM db_environment dbenv, config_macro macro + WHERE UPPER(sys_context('userenv', 'db_name')) = UPPER(dbenv.db_name) + AND DECODE(macro.environment, 'ALL', dbenv.environment, + macro.environment) = dbenv.environment + AND macro.name = ? + ) + |; + my $sth = $ini->dbh->prepare($sql); + $sth->execute($new_value, $set_macro); + print $sth->rows, " record updated.\n"; + $save = 1; +} elsif ($set_param) { + if (!@groups or scalar(@groups) != 1) { + print "Error: You have to specify exactly one group, to which parameter belongs.\n"; + exit 2; + } + my $sql = qq| + UPDATE config_parameter + SET value = ? + WHERE group_name = ? + AND name = ? + |; + my $sth = $ini->dbh->prepare($sql); + $sth->execute($new_value, $groups[0], $set_param); + print $sth->rows, " record updated.\n"; + $save = 1; +} + +if ($save) { + $ini->fetch_nocpulseini('INTERNAL'); + $ini->save; +} + diff --git a/monitoring/nocpulse-common/perl-API/NOCpulse/NOCpulseini.pm b/monitoring/nocpulse-common/perl-API/NOCpulse/NOCpulseini.pm index f7e5f2a..dd47273 100644 --- a/monitoring/nocpulse-common/perl-API/NOCpulse/NOCpulseini.pm +++ b/monitoring/nocpulse-common/perl-API/NOCpulse/NOCpulseini.pm @@ -14,6 +14,7 @@ use Class::MethodMaker filename macrodb paramdb + raw )], new_with_init => 'new', ; @@ -72,17 +73,28 @@ sub save { chmod(0644, $filename) or die "Couldn't chmod $filename: $!"; }
+# return content of NOCpulse.ini (as fetched from db). +# but only for specified group +sub dump_group { + my ($self, $group, $pdb) = @_; + $pdb = $self->paramdb() unless ($pdb); + my $result = "[$group]\n"; + $result .= "# $pdb->{$group}->{'desc'}\n"; + + foreach my $param (sort keys %{$pdb->{$group}->{'params'}}) { + $result .= join('=', $param, $pdb->{$group}->{'params'}->{$param}) . "\n"; + } + return $result; +} + +# return content of NOCpulse.ini (as fetched from db) sub dump { my $self = shift;
my $pdb = $self->paramdb(); my $str; foreach my $grp (sort keys %$pdb) { - $str .= "[$grp]\n"; - $str .= "# $pdb->{$grp}->{'desc'}\n"; - foreach my $param (sort keys %{$pdb->{$grp}->{'params'}}) { - $str .= join('=', $param, $pdb->{$grp}->{'params'}->{$param}) . "\n"; - } + $str .= $self->dump_group($grp, $pdb); $str .= "\n\n"; } return $str; @@ -110,6 +122,7 @@ sub fetch_macros { foreach my $macroname (keys %{$mdb}) { $mdb->{$macroname} = $self->expand($mdb->{$macroname}); } + return $list; }
sub fetch_params { @@ -140,6 +153,7 @@ sub fetch_params { sub expand { my $self = shift; my $value = shift; + return $value if ($self->raw or !$value);
# Store literal percents using OOB data $value =~ s/%%/\0/g;
commit e268316c3d3d0d54645fc5d1b24aa1721dc72ee9 Author: Miroslav Suchý msuchy@redhat.com Date: Wed Jul 22 13:50:37 2009 +0200
remove warning when run as perl -w
diff --git a/monitoring/SatConfig/cluster/PhysCluster.pm b/monitoring/SatConfig/cluster/PhysCluster.pm index feea4e1..3f59404 100644 --- a/monitoring/SatConfig/cluster/PhysCluster.pm +++ b/monitoring/SatConfig/cluster/PhysCluster.pm @@ -246,7 +246,7 @@ sub readFromFile
my $satnumber; my $satNameFile = $self->configValue('satNameFile'); - if (open(FILE,$satNameFile)) { + if ($satNameFile and open(FILE,$satNameFile)) { $satnumber = <FILE>; close(FILE); chomp($satnumber);
commit 953f2345c133524730bab6326754babac32c6753 Author: Mike McCune mmccune@redhat.com Date: Wed Jul 22 09:51:04 2009 -0700
checkstyle
diff --git a/java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java b/java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java index 764775e..d7872f6 100644 --- a/java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java +++ b/java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java @@ -14,7 +14,6 @@ */ package com.redhat.rhn.manager.satellite.test;
-import com.redhat.rhn.common.hibernate.HibernateFactory; import com.redhat.rhn.domain.kickstart.KickstartData; import com.redhat.rhn.domain.kickstart.KickstartFactory; import com.redhat.rhn.domain.kickstart.KickstartSession;
commit 936cf4d7144ca7c8ad9ee9877e1d7b84d4347fd0 Author: Mike McCune mmccune@redhat.com Date: Wed Jul 22 09:18:13 2009 -0700
512814 - unit test fix
diff --git a/java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java b/java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java index 4175fb5..764775e 100644 --- a/java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java +++ b/java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java @@ -14,6 +14,7 @@ */ package com.redhat.rhn.manager.satellite.test;
+import com.redhat.rhn.common.hibernate.HibernateFactory; import com.redhat.rhn.domain.kickstart.KickstartData; import com.redhat.rhn.domain.kickstart.KickstartFactory; import com.redhat.rhn.domain.kickstart.KickstartSession; @@ -52,8 +53,8 @@ public class UpgradeCommandTest extends BaseTestCaseWithUser { KickstartFactory.lookupDefaultKickstartSessionForKickstartData(ksd); assertNotNull(ksession);
- assertNull(TaskFactory.getTaskListByNameLike( - UpgradeCommand.UPGRADE_KS_PROFILES)); - + l = TaskFactory.getTaskListByNameLike( + UpgradeCommand.UPGRADE_KS_PROFILES); + assertTrue((l == null || l.isEmpty())); } }
commit cae1948bd93644f8af7e330941d018714cb1f629 Author: Devan Goodwin dgoodwin@redhat.com Date: Wed Jul 22 11:40:41 2009 -0300
Automatic commit of package [osad] release [5.9.17-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec index 7f7add2..621b971 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/%%7Bname%7D-%%7Bversion%7D.t... -Version: 5.9.16 +Version: 5.9.17 Release: 1%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -241,6 +241,9 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
# $Id$ %changelog +* Wed Jul 22 2009 Devan Goodwin dgoodwin@redhat.com 5.9.17-1 +- Disable osad selinux for Fedora 11. (dgoodwin@redhat.com) + * Mon Jul 20 2009 Devan Goodwin dgoodwin@redhat.com 5.9.16-1 - Add osad BuildRequires for python-devel. (dgoodwin@redhat.com)
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad index 20e08db..5d08fc4 100644 --- a/rel-eng/packages/osad +++ b/rel-eng/packages/osad @@ -1 +1 @@ -5.9.16-1 client/tools/osad/ +5.9.17-1 client/tools/osad/
commit 4caf9e06a6268beb6ca5bf455ca6d8d207eaa942 Author: Devan Goodwin dgoodwin@redhat.com Date: Wed Jul 22 11:39:11 2009 -0300
Disable osad selinux for Fedora 11.
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec index f4f003f..7f7add2 100644 --- a/client/tools/osad/osad.spec +++ b/client/tools/osad/osad.spec @@ -54,10 +54,14 @@ OSA dispatcher get message from Spacewalk server that some command is need to execute on client. The message is transported via jabber protocol to OSAD agent.
+%define include_selinux_package 1 + %if 0%{?rhel} && 0%{?rhel} <= 4 %define include_selinux_package 0 -%else -%define include_selinux_package 1 +%endif + +%if 0%{?fedora} == 11 +%define include_selinux_package 0 %endif
%if %{include_selinux_package}
commit 40ec040a6101e1efa1458d4623702c0dae16d28c Author: Devan Goodwin dgoodwin@redhat.com Date: Wed Jul 22 10:17:03 2009 -0300
Automatic commit of package [spacewalk] release [0.6.3-1].
diff --git a/rel-eng/packages/spacewalk b/rel-eng/packages/spacewalk index c981907..69083a6 100644 --- a/rel-eng/packages/spacewalk +++ b/rel-eng/packages/spacewalk @@ -1 +1 @@ -0.6.2-1 spacewalk/package/ +0.6.3-1 spacewalk/package/ diff --git a/spacewalk/package/spacewalk.spec b/spacewalk/package/spacewalk.spec index ca2c63a..f328895 100644 --- a/spacewalk/package/spacewalk.spec +++ b/spacewalk/package/spacewalk.spec @@ -1,6 +1,6 @@ %define release_name Alpha Name: spacewalk -Version: 0.6.2 +Version: 0.6.3 Release: 1%{?dist} Summary: Spacewalk Systems Management Application URL: https://fedorahosted.org/spacewalk @@ -95,6 +95,9 @@ rm -rf %{buildroot} /%{_sysconfdir}/spacewalk-release
%changelog +* Wed Jul 22 2009 Devan Goodwin dgoodwin@redhat.com 0.6.3-1 +- Re-enable selinux for everything but Fedora 11. (dgoodwin@redhat.com) + * Mon Jul 20 2009 Devan Goodwin dgoodwin@redhat.com 0.6.2-1 - Disabling spacewalk selinux support temporarily. (dgoodwin@redhat.com)
commit 52e3bb1c96f537c561642a9f6ebacdfa98c86298 Author: Devan Goodwin dgoodwin@redhat.com Date: Wed Jul 22 10:13:42 2009 -0300
Re-enable selinux for everything but Fedora 11.
diff --git a/spacewalk/package/spacewalk.spec b/spacewalk/package/spacewalk.spec index 895c512..ca2c63a 100644 --- a/spacewalk/package/spacewalk.spec +++ b/spacewalk/package/spacewalk.spec @@ -62,10 +62,13 @@ Requires: spacewalk-monitoring # Requires: rhn_solaris_bootstrap_5_1_0_3
# SELinux -#Requires: spacewalk-selinux -#Requires: jabberd-selinux -#Requires: osa-dispatcher-selinux -#Requires: spacewalk-monitoring-selinux +%if 0%{?fedora} == 11 +%else +Requires: spacewalk-selinux +Requires: jabberd-selinux +Requires: osa-dispatcher-selinux +Requires: spacewalk-monitoring-selinux +%endif
%description
commit 2119b1f1cb0310df61a443d7a8d2ff39ce504728 Author: John Matthews jmatthew@redhat.com Date: Wed Jul 22 08:23:05 2009 -0400
Automatic commit of package [spacewalk-backend] release [0.6.22-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec index 44d7dd6..4037804 100644 --- a/backend/spacewalk-backend.spec +++ b/backend/spacewalk-backend.spec @@ -7,7 +7,7 @@ Name: spacewalk-backend Summary: Common programs needed to be installed on the Spacewalk servers/proxies Group: Applications/Internet License: GPLv2 -Version: 0.6.21 +Version: 0.6.22 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -568,6 +568,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$ %changelog +* Wed Jul 22 2009 John Matthews jmatthew@redhat.com 0.6.22-1 +- 511283 - Package compare between db and cache should see if the db is newer + than cache and only then import the content. (pkilambi@redhat.com) + * Tue Jul 21 2009 John Matthews jmatthew@redhat.com 0.6.21-1 - 512936 - Changing the custom channel rule to always defalt to org 1 for custom channels unless --org option is used. This will avoid the confusion of diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend index 7f82b55..b232b7a 100644 --- a/rel-eng/packages/spacewalk-backend +++ b/rel-eng/packages/spacewalk-backend @@ -1 +1 @@ -0.6.21-1 backend/ +0.6.22-1 backend/
commit 13afa1173f92e893a8a9390fc2e3116293bb7598 Author: John Matthews jmatthew@redhat.com Date: Wed Jul 22 08:22:46 2009 -0400
Automatic commit of package [spacewalk-java] release [0.6.34-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec index 933a515..6aba9bc 100644 --- a/java/spacewalk-java.spec +++ b/java/spacewalk-java.spec @@ -12,7 +12,7 @@ Name: spacewalk-java Summary: Spacewalk Java site packages Group: Applications/Internet License: GPLv2 -Version: 0.6.33 +Version: 0.6.34 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -250,6 +250,10 @@ fi %attr(644, root, root) %{_datadir}/rhn/lib/rhn.jar
%changelog +* Wed Jul 22 2009 John Matthews jmatthew@redhat.com 0.6.34-1 +- 512814 - adding spot to add 'upgrade' logic to our startup of tomact. + (mmccune@redhat.com) + * Tue Jul 21 2009 John Matthews jmatthew@redhat.com 0.6.33-1 - 512679 - Fix to guess a sensible default virt path for Xen/KVM virt type (paji@redhat.com) diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java index 31f2495..20a093c 100644 --- a/rel-eng/packages/spacewalk-java +++ b/rel-eng/packages/spacewalk-java @@ -1 +1 @@ -0.6.33-1 java/ +0.6.34-1 java/
commit 20af6df15ded643a047ed28c255d20ffa69c39f0 Author: John Matthews jmatthew@redhat.com Date: Wed Jul 22 08:22:21 2009 -0400
Automatic commit of package [spacewalk-schema] release [0.6.14-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema index 4b9b8f3..5f359ca 100644 --- a/rel-eng/packages/spacewalk-schema +++ b/rel-eng/packages/spacewalk-schema @@ -1 +1 @@ -0.6.13-1 schema/spacewalk/ +0.6.14-1 schema/spacewalk/ diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec index eac9ac9..e9ce945 100644 --- a/schema/spacewalk/spacewalk-schema.spec +++ b/schema/spacewalk/spacewalk-schema.spec @@ -2,7 +2,7 @@ Name: spacewalk-schema Group: Applications/Internet Summary: Oracle SQL schema for Spacewalk server
-Version: 0.6.13 +Version: 0.6.14 Release: 1%{?dist} Source0: %{name}-%{version}.tar.gz
@@ -52,6 +52,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/spacewalk-schema-upgrade*
%changelog +* Wed Jul 22 2009 John Matthews jmatthew@redhat.com 0.6.14-1 +- 512814 - tickle the upgrade logic (mmccune@redhat.com) + * Thu Jul 16 2009 Miroslav Suchy msuchy@redhat.com 0.6.13-1 - 512104 - add sshbannerignore parametr to existing probes which use ssh
commit 94020be75311d7cf481e1dc5d9fe72f1e23ed172 Author: Pradeep Kilambi pkilambi@redhat.com Date: Tue Jul 21 20:21:20 2009 -0400
511283 - Package compare between db and cache should see if the db is newer than cache and only then import the content.
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py index 601d131..40458ad 100644 --- a/backend/satellite_tools/satsync.py +++ b/backend/satellite_tools/satsync.py @@ -1004,7 +1004,7 @@ Please contact your RHN representative""" % (generation, sat_cert.generation)) # file is modified too; re-download m_fs_packages.append((package_id, final_path))
- if (l_timestamp == db_timestamp and md5sum == db_md5sum and + if (l_timestamp <= db_timestamp and md5sum == db_md5sum and package_size == db_package_size and final_path == db_path): # Same package return
commit 43aff0b73ba4d7d0187aedd2be16c1ee79af4ebf Author: Mike McCune mmccune@redhat.com Date: Tue Jul 21 14:31:51 2009 -0700
512814 - tickle the upgrade logic
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-upgrade_kickstart_profiles.sql b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-upgrade_kickstart_profiles.sql new file mode 100644 index 0000000..4a0a510 --- /dev/null +++ b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/191-upgrade_kickstart_profiles.sql @@ -0,0 +1,20 @@ +-- +-- 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. +-- +-- +-- +-- + +INSERT INTO rhnTaskQueue (org_id, task_name, task_data) +VALUES (1, 'upgrade_satellite_kickstart_profiles', 0);
commit 8f94b49ce1dd35671f627bd4161e6355631d00f1 Author: Mike McCune mmccune@redhat.com Date: Tue Jul 21 14:22:17 2009 -0700
512814 - adding spot to add 'upgrade' logic to our startup of tomact.
Now coders can add an entry to rhnTaskQueue to indicate to our Java code that we want to run a set of business logic during an upgrade.
diff --git a/java/code/src/com/redhat/rhn/domain/task/Task.hbm.xml b/java/code/src/com/redhat/rhn/domain/task/Task.hbm.xml index 4b32495..276b5e8 100644 --- a/java/code/src/com/redhat/rhn/domain/task/Task.hbm.xml +++ b/java/code/src/com/redhat/rhn/domain/task/Task.hbm.xml @@ -33,4 +33,13 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" and task_data = :data and earliest = :earliest]]> </query>
+ <sql-query name="Task.lookupByNameLike"> + <![CDATA[SELECT {t.*} + FROM rhnTaskQueue {t} + WHERE t.task_name like :namelike + ]]> + <return alias="t" class="com.redhat.rhn.domain.task.Task" /> + </sql-query> + + </hibernate-mapping> diff --git a/java/code/src/com/redhat/rhn/domain/task/TaskFactory.java b/java/code/src/com/redhat/rhn/domain/task/TaskFactory.java index 70c71f1..50149eb 100644 --- a/java/code/src/com/redhat/rhn/domain/task/TaskFactory.java +++ b/java/code/src/com/redhat/rhn/domain/task/TaskFactory.java @@ -74,6 +74,16 @@ public class TaskFactory extends HibernateFactory { }
/** + * Remove a completed Task from the queue. + * + * @param taskIn to remove + */ + public static void remove(Task taskIn) { + singleton.removeObject(taskIn); + } + + + /** * Lookups up a task. * @param org The org containing the task * @param name The name of the task @@ -126,4 +136,15 @@ public class TaskFactory extends HibernateFactory {
return c.list(); } + + /** + * Lookup a list of Tasks who's name start with passed in param + * @param nameIn to lookup + * @return List of Tasks or null if not found. + */ + public static List getTaskListByNameLike(String nameIn) { + return HibernateFactory.getSession().getNamedQuery("Task.lookupByNameLike") + .setString("namelike", nameIn + "%") + .list(); + } } diff --git a/java/code/src/com/redhat/rhn/domain/task/test/TaskTest.java b/java/code/src/com/redhat/rhn/domain/task/test/TaskTest.java index 2d9333f..c4559d1 100644 --- a/java/code/src/com/redhat/rhn/domain/task/test/TaskTest.java +++ b/java/code/src/com/redhat/rhn/domain/task/test/TaskTest.java @@ -24,6 +24,8 @@ import com.redhat.rhn.testing.UserTestUtils;
import org.hibernate.Session;
+import java.util.List; + /** * TaskTest * @version $Rev$ @@ -61,4 +63,17 @@ public class TaskTest extends RhnBaseTestCase { t3.setName("foo"); assertFalse("t2 should not be equal to t3", t2.equals(t3)); } + + public void testLookupNameLike() throws Exception { + Org org = UserTestUtils.findNewOrg("testOrg"); + String testname = "task_object_unit_test_" + TestUtils.randomString(); + Long testdata = new Long(42); + Task t = TaskFactory.createTask(org, testname, testdata); + + List lookedup = TaskFactory.getTaskListByNameLike("task_object_unit_test_"); + assertNotNull(lookedup); + assertTrue(lookedup.size() > 0); + assertTrue(lookedup.get(0) != null); + assertTrue(lookedup.get(0) instanceof Task); + } } diff --git a/java/code/src/com/redhat/rhn/manager/BaseTransactionCommand.java b/java/code/src/com/redhat/rhn/manager/BaseTransactionCommand.java new file mode 100644 index 0000000..1f47b46 --- /dev/null +++ b/java/code/src/com/redhat/rhn/manager/BaseTransactionCommand.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) 2009 Red Hat, Inc. + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ +package com.redhat.rhn.manager; + +import com.redhat.rhn.common.hibernate.HibernateFactory; + +import org.apache.log4j.Logger; +import org.hibernate.HibernateException; + +/** + * BaseTransactionCommand - simple baseclass to hold logic for handling tx + * + * @version $Rev$ + */ +public class BaseTransactionCommand { + + private Logger log; + + /** + * Constructor + * @param logIn to use. + */ + public BaseTransactionCommand(Logger logIn) { + log = logIn; + } + + protected void handleTransaction() { + boolean committed = false; + + try { + HibernateFactory.commitTransaction(); + committed = true; + + if (log.isDebugEnabled()) { + log.debug("Transaction committed"); + } + } + catch (HibernateException e) { + log.error("Rolling back transaction", e); + } + finally { + try { + if (!committed) { + try { + if (log.isDebugEnabled()) { + log.debug("Rolling back transaction"); + } + HibernateFactory.rollbackTransaction(); + } + catch (HibernateException e) { + final String msg = "Additional error during rollback"; + log.warn(msg, e); + } + } + } + finally { + // cleanup the session + HibernateFactory.closeSession(); + } + } + } + +} diff --git a/java/code/src/com/redhat/rhn/manager/errata/cache/UpdateErrataCacheCommand.java b/java/code/src/com/redhat/rhn/manager/errata/cache/UpdateErrataCacheCommand.java index fdff195..547b78b 100644 --- a/java/code/src/com/redhat/rhn/manager/errata/cache/UpdateErrataCacheCommand.java +++ b/java/code/src/com/redhat/rhn/manager/errata/cache/UpdateErrataCacheCommand.java @@ -25,12 +25,12 @@ import com.redhat.rhn.domain.org.Org; import com.redhat.rhn.domain.org.OrgFactory; import com.redhat.rhn.domain.server.Server; import com.redhat.rhn.frontend.dto.ErrataCacheDto; +import com.redhat.rhn.manager.BaseTransactionCommand; import com.redhat.rhn.manager.action.ActionManager; import com.redhat.rhn.manager.errata.ErrataManager; import com.redhat.rhn.manager.system.SystemManager;
import org.apache.log4j.Logger; -import org.hibernate.HibernateException;
import java.util.ArrayList; import java.util.HashMap; @@ -43,7 +43,7 @@ import java.util.Map; * UpdateErrataCacheCommand * @version $Rev$ */ -public class UpdateErrataCacheCommand { +public class UpdateErrataCacheCommand extends BaseTransactionCommand { private static Logger log = Logger .getLogger(UpdateErrataCacheCommand.class);
@@ -51,6 +51,7 @@ public class UpdateErrataCacheCommand { * Default constructor */ public UpdateErrataCacheCommand() { + super(log); }
/** @@ -280,42 +281,6 @@ public class UpdateErrataCacheCommand { return retval;
} - - protected void handleTransaction() { - boolean committed = false; - - try { - HibernateFactory.commitTransaction(); - committed = true; - - if (log.isDebugEnabled()) { - log.debug("Transaction committed"); - } - } - catch (HibernateException e) { - log.error("Rolling back transaction", e); - } - finally { - try { - if (!committed) { - try { - if (log.isDebugEnabled()) { - log.debug("Rolling back transaction"); - } - HibernateFactory.rollbackTransaction(); - } - catch (HibernateException e) { - final String msg = "Additional error during rollback"; - log.warn(msg, e); - } - } - } - finally { - // cleanup the session - HibernateFactory.closeSession(); - } - } - }
private void processServer(Long serverId, Org org) { Server server = SystemManager.lookupByIdAndOrg(serverId, org); diff --git a/java/code/src/com/redhat/rhn/manager/satellite/UpgradeCommand.java b/java/code/src/com/redhat/rhn/manager/satellite/UpgradeCommand.java new file mode 100644 index 0000000..f2fd91f --- /dev/null +++ b/java/code/src/com/redhat/rhn/manager/satellite/UpgradeCommand.java @@ -0,0 +1,105 @@ +/** + * Copyright (c) 2009 Red Hat, Inc. + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ +package com.redhat.rhn.manager.satellite; + +import com.redhat.rhn.common.hibernate.HibernateFactory; +import com.redhat.rhn.domain.kickstart.KickstartData; +import com.redhat.rhn.domain.kickstart.KickstartFactory; +import com.redhat.rhn.domain.kickstart.KickstartSession; +import com.redhat.rhn.domain.task.Task; +import com.redhat.rhn.domain.task.TaskFactory; +import com.redhat.rhn.manager.BaseTransactionCommand; +import com.redhat.rhn.manager.kickstart.KickstartSessionCreateCommand; + +import org.apache.log4j.Logger; + +import java.util.List; + + +/** + * Class responsible for executing one-time upgrade logic + * + * @version $Rev$ + */ +public class UpgradeCommand extends BaseTransactionCommand { + + /** + * Logger for this class + */ + private static Logger log = Logger.getLogger(UpgradeCommand.class); + + public static final String UPGRADE_TASK_NAME = "upgrade_satellite_"; + public static final String UPGRADE_KS_PROFILES = + UPGRADE_TASK_NAME + "kickstart_profiles"; + + /** + * Constructor + */ + public UpgradeCommand() { + super(log); + } + + + /** + * Excute the upgrade step + */ + public void store() { + try { + HibernateFactory.getSession().beginTransaction(); + List upgradeTasks = TaskFactory.getTaskListByNameLike(UPGRADE_TASK_NAME); + // Loop over upgrade tasks and execute the steps. + for (int i = 0; i < upgradeTasks.size(); i++) { + Task t = (Task) upgradeTasks.get(i); + // Use WARN because we want this logged. + if (t != null) { + log.warn("got upgrade task: " + t.getName()); + if (t.getName().equals(UPGRADE_KS_PROFILES)) { + processKickstartProfiles(); + TaskFactory.remove(t); + } + } + } + } + catch (Exception e) { + log.error("Problem upgrading!", e); + HibernateFactory.rollbackTransaction(); + + } + finally { + handleTransaction(); + } + } + + private void processKickstartProfiles() { + // Use WARN here because we want this operation logged. + log.warn("Processing ks profiles."); + List allKickstarts = KickstartFactory.listAllKickstartData(); + for (int i = 0; i < allKickstarts.size(); i++) { + KickstartData ksdata = (KickstartData) allKickstarts.get(i); + KickstartSession ksession = + KickstartFactory.lookupDefaultKickstartSessionForKickstartData(ksdata); + if (ksession == null) { + log.warn("Kickstart does not have a session: id: " + ksdata.getId() + + " label: " + ksdata.getLabel()); + KickstartSessionCreateCommand kcmd = new KickstartSessionCreateCommand( + ksdata.getOrg(), ksdata); + kcmd.store(); + log.warn("Created kickstart session and key"); + } + + } + } + +} diff --git a/java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java b/java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java new file mode 100644 index 0000000..4175fb5 --- /dev/null +++ b/java/code/src/com/redhat/rhn/manager/satellite/test/UpgradeCommandTest.java @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2009 Red Hat, Inc. + * + * This software is licensed to you under the GNU General Public License, + * version 2 (GPLv2). There is NO WARRANTY for this software, express or + * implied, including the implied warranties of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 + * along with this software; if not, see + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. + * + * Red Hat trademarks are not licensed under GPLv2. No permission is + * granted to use or replicate Red Hat trademarks that are incorporated + * in this software or its documentation. + */ +package com.redhat.rhn.manager.satellite.test; + +import com.redhat.rhn.domain.kickstart.KickstartData; +import com.redhat.rhn.domain.kickstart.KickstartFactory; +import com.redhat.rhn.domain.kickstart.KickstartSession; +import com.redhat.rhn.domain.task.Task; +import com.redhat.rhn.domain.task.TaskFactory; +import com.redhat.rhn.frontend.action.kickstart.test.KickstartTestHelper; +import com.redhat.rhn.manager.satellite.UpgradeCommand; +import com.redhat.rhn.testing.BaseTestCaseWithUser; + +import java.util.List; + + +public class UpgradeCommandTest extends BaseTestCaseWithUser { + + public void testUpgradeProfiles() throws Exception { + KickstartData ksd = KickstartTestHelper.createTestKickStart(user); + + KickstartSession ksession = + KickstartFactory.lookupDefaultKickstartSessionForKickstartData(ksd); + assertNull(ksession); + TaskFactory.createTask(user.getOrg(), + UpgradeCommand.UPGRADE_KS_PROFILES, new Long(0)); + + List l = TaskFactory.getTaskListByNameLike( + UpgradeCommand.UPGRADE_KS_PROFILES); + assertTrue(l.get(0) instanceof Task); + + // UpgradeCommand its its own transaction so we gotta commit. + commitAndCloseSession(); + + UpgradeCommand cmd = new UpgradeCommand(); + cmd.store(); + + // Check to see if the upgrade command created the default profile. + ksession = + KickstartFactory.lookupDefaultKickstartSessionForKickstartData(ksd); + assertNotNull(ksession); + + assertNull(TaskFactory.getTaskListByNameLike( + UpgradeCommand.UPGRADE_KS_PROFILES)); + + } +} diff --git a/java/code/src/com/redhat/rhn/webapp/RhnServletListener.java b/java/code/src/com/redhat/rhn/webapp/RhnServletListener.java index 94a7925..c81ebeb 100644 --- a/java/code/src/com/redhat/rhn/webapp/RhnServletListener.java +++ b/java/code/src/com/redhat/rhn/webapp/RhnServletListener.java @@ -16,6 +16,7 @@ package com.redhat.rhn.webapp;
import com.redhat.rhn.common.hibernate.HibernateFactory; import com.redhat.rhn.common.messaging.MessageQueue; +import com.redhat.rhn.manager.satellite.UpgradeCommand;
import org.apache.log4j.LogManager; import org.apache.log4j.Logger; @@ -109,6 +110,17 @@ public class RhnServletListener implements ServletContextListener {
startHibernate(); logStart("Hibernate"); + + log.debug("Starting upgrade check"); + executeUpgradeStep(); + } + + private void executeUpgradeStep() { + log.debug("calling UpgradeCommand."); + UpgradeCommand cmd = new UpgradeCommand(); + cmd.store(); + log.debug("UpgradeCommand done."); + }
/** {@inheritDoc} */
commit 7338082f8e853226f5d42fdfa6aabf2609f99722 Author: John Matthews jmatthew@redhat.com Date: Tue Jul 21 14:01:57 2009 -0400
Automatic commit of package [spacewalk-proxy] release [0.6.8-1].
diff --git a/proxy/proxy/spacewalk-proxy.spec b/proxy/proxy/spacewalk-proxy.spec index 86d3850..a986f07 100644 --- a/proxy/proxy/spacewalk-proxy.spec +++ b/proxy/proxy/spacewalk-proxy.spec @@ -4,7 +4,7 @@ Group: Applications/Internet License: GPLv2 URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... -Version: 0.6.7 +Version: 0.6.8 Release: 1%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python @@ -289,6 +289,10 @@ fi
%changelog +* Tue Jul 21 2009 John Matthews jmatthew@redhat.com 0.6.8-1 +- 503187 - rewrite old config during upgrade, old file will be saved as + .rpmorig (msuchy@redhat.com) + * Mon Jul 06 2009 John Matthews jmatthew@redhat.com 0.6.7-1 - 509522 - remove conflicts and put provides to spacewalk-proxy-management (msuchy@redhat.com) diff --git a/rel-eng/packages/spacewalk-proxy b/rel-eng/packages/spacewalk-proxy index 4ed2eea..d7096c3 100644 --- a/rel-eng/packages/spacewalk-proxy +++ b/rel-eng/packages/spacewalk-proxy @@ -1 +1 @@ -0.6.7-1 proxy/proxy/ +0.6.8-1 proxy/proxy/
commit 9a6871836be490be02f969b8f2c5d18481c57647 Author: John Matthews jmatthew@redhat.com Date: Tue Jul 21 14:01:22 2009 -0400
Automatic commit of package [spacewalk-backend] release [0.6.21-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec index 905cb5e..44d7dd6 100644 --- a/backend/spacewalk-backend.spec +++ b/backend/spacewalk-backend.spec @@ -7,7 +7,7 @@ Name: spacewalk-backend Summary: Common programs needed to be installed on the Spacewalk servers/proxies Group: Applications/Internet License: GPLv2 -Version: 0.6.20 +Version: 0.6.21 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -568,6 +568,11 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$ %changelog +* Tue Jul 21 2009 John Matthews jmatthew@redhat.com 0.6.21-1 +- 512936 - Changing the custom channel rule to always defalt to org 1 for + custom channels unless --org option is used. This will avoid the confusion of + putting the channel is some random org on slaves. (pkilambi@redhat.com) + * Tue Jul 21 2009 Devan Goodwin dgoodwin@redhat.com 0.6.20-1 - 512960 - check for the proper attr name on rpm for header reading (jbowes@redhat.com) diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend index 5c729b3..7f82b55 100644 --- a/rel-eng/packages/spacewalk-backend +++ b/rel-eng/packages/spacewalk-backend @@ -1 +1 @@ -0.6.20-1 backend/ +0.6.21-1 backend/
commit fe84db417bc4b5a94b7d7f05cbc6f6c5277f4d66 Author: John Matthews jmatthew@redhat.com Date: Tue Jul 21 13:40:03 2009 -0400
Automatic commit of package [spacewalk-koan] release [0.1.17-1].
diff --git a/client/tools/spacewalk-koan/spacewalk-koan.spec b/client/tools/spacewalk-koan/spacewalk-koan.spec index 8d97d6e..3ff0d02 100644 --- a/client/tools/spacewalk-koan/spacewalk-koan.spec +++ b/client/tools/spacewalk-koan/spacewalk-koan.spec @@ -3,7 +3,7 @@ Name: spacewalk-koan Group: System Environment/Kernel License: GPLv2 Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... -Version: 0.1.16 +Version: 0.1.17 Release: 1%{?dist} BuildArch : noarch URL: https://fedorahosted.org/spacewalk @@ -49,6 +49,10 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/rhn/actions/
%changelog +* Tue Jul 21 2009 John Matthews jmatthew@redhat.com 0.1.17-1 +- 510299 - static ks fix. (paji@redhat.com) +- 510299 - Big commit to get static networking to work (paji@redhat.com) + * Mon Jul 06 2009 John Matthews jmatthew@redhat.com 0.1.16-1 - 508956 - fixing file preservation to actually use updated initrd.img (mmccune@gibson.pdx.redhat.com) diff --git a/rel-eng/packages/spacewalk-koan b/rel-eng/packages/spacewalk-koan index c41cff2..9b859c5 100644 --- a/rel-eng/packages/spacewalk-koan +++ b/rel-eng/packages/spacewalk-koan @@ -1 +1 @@ -0.1.16-1 client/tools/spacewalk-koan/ +0.1.17-1 client/tools/spacewalk-koan/
commit b874c7be726bb0a43216de974beb84eec8f2d279 Author: John Matthews jmatthew@redhat.com Date: Tue Jul 21 13:38:41 2009 -0400
Automatic commit of package [rhnsd] release [4.5.11-1].
diff --git a/client/rhel/rhnsd/rhnsd.spec b/client/rhel/rhnsd/rhnsd.spec index 71f28e7..997dced 100644 --- a/client/rhel/rhnsd/rhnsd.spec +++ b/client/rhel/rhnsd/rhnsd.spec @@ -4,7 +4,7 @@ Group: System Environment/Base Source0: %{name}-%{version}.tar.gz Url: http://rhn.redhat.com Name: rhnsd -Version: 4.5.10 +Version: 4.5.11 Release: 1%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -58,6 +58,9 @@ rm -fr $RPM_BUILD_ROOT %{_mandir}/man8/rhnsd.8*
%changelog +* Tue Jul 21 2009 John Matthews jmatthew@redhat.com 4.5.11-1 +- #503719 - fix for postun scriptlet error (pkilambi@redhat.com) + * Tue Jul 7 2009 Pradeep Kilambi pkilambi@redhat.com - Resolves: #503719 - fix for postun scriptlet error
diff --git a/rel-eng/packages/rhnsd b/rel-eng/packages/rhnsd index 9e96a69..db4400d 100644 --- a/rel-eng/packages/rhnsd +++ b/rel-eng/packages/rhnsd @@ -1 +1 @@ -4.5.10-1 client/rhel/rhnsd/ +4.5.11-1 client/rhel/rhnsd/
commit 4b79346074624b419bef590ee17a22029f86b954 Author: Pradeep Kilambi pkilambi@redhat.com Date: Tue Jul 21 13:34:28 2009 -0400
512936 - Changing the custom channel rule to always defalt to org 1 for custom channels unless --org option is used. This will avoid the confusion of putting the channel is some random org on slaves.
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py index bf3cb63..601d131 100644 --- a/backend/satellite_tools/satsync.py +++ b/backend/satellite_tools/satsync.py @@ -65,6 +65,7 @@ import sync_handlers
_DEFAULT_SYSTEMID_PATH = '/etc/sysconfig/rhn/systemid' _DEFAULT_RHN_ENTITLEMENT_CERT_BACKUP = '/etc/sysconfig/rhn/rhn-entitlement-cert.xml' +DEFAULT_ORG = 1
# the option object is used everywhere in this module... make it a # global so we don't have to pass it to everyone. @@ -874,10 +875,9 @@ Please contact your RHN representative""" % (generation, sat_cert.generation)) for t in nvrea_keys: nevra[t] = package[t] or ""
- if OPTIONS.orgid is not None and \ - package['org_id'] is not None: - nevra['org_id'] = OPTIONS.orgid - package['org_id'] = OPTIONS.orgid + 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']
@@ -959,8 +959,8 @@ Please contact your RHN representative""" % (generation, sat_cert.generation)) md5sum = package['md5sum'] package_size = package['package_size']
- if OPTIONS.orgid is not None: - orgid = OPTIONS.orgid + if package['org_id'] is not None: + orgid = OPTIONS.orgid or DEFAULT_ORG else: orgid = package['org_id']
@@ -1443,9 +1443,9 @@ Please contact your RHN representative""" % (generation, sat_cert.generation)) for ks, timestamp in missing_kickstarts: ksobj = coll.get_item(ks, timestamp=timestamp) assert ksobj is not None - if OPTIONS.orgid is not None and \ - ksobj['org_id'] is not None: - ksobj['org_id'] = OPTIONS.orgid + + if ksobj['org_id'] is not None: + ksobj['org_id'] = OPTIONS.orgid or DEFAULT_ORG batch.append(ksobj)
importer = sync_handlers.import_kickstarts(batch) @@ -1692,6 +1692,8 @@ Please contact your RHN representative""" % (generation, sat_cert.generation)) uq_packages[pid] = package
uq_pkg_data = uq_packages.values() + # check to make sure the orgs exported are valid + _validate_package_org(uq_pkg_data) try: if OPTIONS.mount_point: importer = sync_handlers.link_channel_packages(uq_pkg_data, strict=0) @@ -1781,9 +1783,8 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
erratum['packages'] = packages
- if OPTIONS.orgid is not None and \ - erratum['org_id'] is not None: - erratum['org_id'] = OPTIONS.orgid + if erratum['org_id'] is not None: + erratum['org_id'] = OPTIONS.orgid or DEFAULT_ORG
# Now fix channels # Associate errata to only channels that are being synced @@ -2030,9 +2031,9 @@ def _validate_package_org(batch): elif orgid: # if options.orgid specified use it pkg['org_id'] = orgid - elif pkg['org_id'] not in orgs: + else: # org from server is not valid - pkg['org_id'] = 1 + pkg['org_id'] = DEFAULT_ORG
def _getImportedChannels(): "Retrieves the channels already imported in the satellite's database" diff --git a/backend/satellite_tools/sync_handlers.py b/backend/satellite_tools/sync_handlers.py index 567f8ee..48645ef 100644 --- a/backend/satellite_tools/sync_handlers.py +++ b/backend/satellite_tools/sync_handlers.py @@ -27,6 +27,8 @@ import xmlSource import syncCache import syncLib
+DEFAULT_ORG = 1 + class NoFreeEntitlementsError(Exception): "No free entitlements available to activate this satellite"
@@ -198,11 +200,9 @@ def import_channels(channels, orgid=None): # finally if the orgs differ so we might wanna use # requested org's channel-family. # TODO: Move these checks somewhere more appropriate - if not orgid and c_obj['org_id'] is not None and \ - c_obj['org_id'] not in orgs: + if not orgid and c_obj['org_id'] is not None: #If the src org is not present default to org 1 - orgid = 1 - + orgid = DEFAULT_ORG if orgid is not None and c_obj['org_id'] is not None and \ c_obj['org_id'] != orgid: #Only set the channel family if its a custom channel @@ -211,6 +211,7 @@ def import_channels(channels, orgid=None): family['label'] = 'private-channel-family-' + \ str(c_obj['org_id'])
+ syncLib.log(1, "Syncing Channel to Org %s " % c_obj['org_id']) batch.append(c_obj)
importer = channelImport.ChannelImport(batch, diskImportLib.get_backend())
commit 8db5db224231ec636c78d08ca974b5f977328693 Author: Devan Goodwin dgoodwin@redhat.com Date: Tue Jul 21 13:29:57 2009 -0300
Automatic commit of package [spacewalk-backend] release [0.6.20-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec index 8a7f5a4..905cb5e 100644 --- a/backend/spacewalk-backend.spec +++ b/backend/spacewalk-backend.spec @@ -7,7 +7,7 @@ Name: spacewalk-backend Summary: Common programs needed to be installed on the Spacewalk servers/proxies Group: Applications/Internet License: GPLv2 -Version: 0.6.19 +Version: 0.6.20 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -568,6 +568,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$ %changelog +* Tue Jul 21 2009 Devan Goodwin dgoodwin@redhat.com 0.6.20-1 +- 512960 - check for the proper attr name on rpm for header reading + (jbowes@redhat.com) + * Thu Jul 16 2009 Pradeep Kilambi pkilambi@redhat.com 0.6.19-1 - 512236 - the org id checks were defaulting to None in custom channel cases instead of 1. Also the metadata sting frommaster is a string None so we need diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend index 3ded2a7..5c729b3 100644 --- a/rel-eng/packages/spacewalk-backend +++ b/rel-eng/packages/spacewalk-backend @@ -1 +1 @@ -0.6.19-1 backend/ +0.6.20-1 backend/
commit ef3bece2f536e2ea86456e872f53fa47b18dfc6d Author: James Bowes jbowes@redhat.com Date: Tue Jul 21 11:07:47 2009 -0400
512960 - check for the proper attr name on rpm for header reading
diff --git a/backend/common/rhn_rpm.py b/backend/common/rhn_rpm.py index 3d0efcc..e1b275e 100644 --- a/backend/common/rhn_rpm.py +++ b/backend/common/rhn_rpm.py @@ -268,7 +268,7 @@ def get_package_header(filename=None, file=None, fd=None): if hdr is None: raise InvalidPackageError else: - if hasattr(rpm, 'rpmHeaderFromFD'): + if hasattr(rpm, 'readHeaderFromFD'): header_start, header_end = \ get_header_byte_range(os.fdopen(os.dup(file_desc))) os.lseek(file_desc, header_start, 0)
commit 2ac921f1405577ed1bfa7f8ac2cc2a7ea8d4fefd Author: John Matthews jmatthew@redhat.com Date: Tue Jul 21 11:57:36 2009 -0400
Automatic commit of package [spacewalk-selinux] release [0.6.13-1].
diff --git a/rel-eng/packages/spacewalk-selinux b/rel-eng/packages/spacewalk-selinux index 7492603..322ef83 100644 --- a/rel-eng/packages/spacewalk-selinux +++ b/rel-eng/packages/spacewalk-selinux @@ -1 +1 @@ -0.6.12-1 selinux/spacewalk-selinux/ +0.6.13-1 selinux/spacewalk-selinux/ diff --git a/selinux/spacewalk-selinux/spacewalk-selinux.spec b/selinux/spacewalk-selinux/spacewalk-selinux.spec index 3673275..7ce33b0 100644 --- a/selinux/spacewalk-selinux/spacewalk-selinux.spec +++ b/selinux/spacewalk-selinux/spacewalk-selinux.spec @@ -7,7 +7,7 @@ %define modulename spacewalk
Name: spacewalk-selinux -Version: 0.6.12 +Version: 0.6.13 Release: 1%{?dist} Summary: SELinux policy module supporting Spacewalk Server
@@ -115,6 +115,10 @@ fi %attr(0755,root,root) %{_sbindir}/%{name}-enable
%changelog +* Tue Jul 21 2009 John Matthews jmatthew@redhat.com 0.6.13-1 +- Disabling requires on spacewalk-monitoring-selinux. (temporary) + (dgoodwin@redhat.com) + * Thu Jul 2 2009 Miroslav Suchy msuchy@redhat.com 0.6.12-1 - 509369 - run restorecon for /var/www/html/pub since its content is not owned by any package
commit 24d279e5b44186f695f9471065b05e3a3f7230d3 Author: John Matthews jmatthew@redhat.com Date: Tue Jul 21 11:47:11 2009 -0400
Automatic commit of package [spacewalk-branding] release [0.6.8-1].
diff --git a/branding/spacewalk-branding.spec b/branding/spacewalk-branding.spec index eb017b7..aade6ce 100644 --- a/branding/spacewalk-branding.spec +++ b/branding/spacewalk-branding.spec @@ -1,5 +1,5 @@ Name: spacewalk-branding -Version: 0.6.7 +Version: 0.6.8 Release: 1%{?dist} Summary: Spacewalk branding data
@@ -68,6 +68,10 @@ rm -rf %{buildroot}
%changelog +* Tue Jul 21 2009 John Matthews jmatthew@redhat.com 0.6.8-1 +- 510146 - Update copyright years from 2002-08 to 2002-09. + (dgoodwin@redhat.com) + * Tue Jun 30 2009 Miroslav Suchy msuchy@redhat.com 0.6.7-1 - 508710 - make bar on top of page wider, so we do not get empty space on wider displays
diff --git a/rel-eng/packages/spacewalk-branding b/rel-eng/packages/spacewalk-branding index 660ed0e..105a0b1 100644 --- a/rel-eng/packages/spacewalk-branding +++ b/rel-eng/packages/spacewalk-branding @@ -1 +1 @@ -0.6.7-1 branding/ +0.6.8-1 branding/
commit f40dbc02e1d7dfefcf2063f516e0fbf70b4bdc64 Author: John Matthews jmatthew@redhat.com Date: Tue Jul 21 11:39:21 2009 -0400
Automatic commit of package [spacewalk-config] release [0.6.9-1].
diff --git a/rel-eng/packages/spacewalk-config b/rel-eng/packages/spacewalk-config index e483978..5b41879 100644 --- a/rel-eng/packages/spacewalk-config +++ b/rel-eng/packages/spacewalk-config @@ -1 +1 @@ -0.6.8-1 spacewalk/config/ +0.6.9-1 spacewalk/config/ diff --git a/spacewalk/config/spacewalk-config.spec b/spacewalk/config/spacewalk-config.spec index d40cbd6..5e34453 100644 --- a/spacewalk/config/spacewalk-config.spec +++ b/spacewalk/config/spacewalk-config.spec @@ -2,7 +2,7 @@
Name: spacewalk-config Summary: Spacewalk Configuration -Version: 0.6.8 +Version: 0.6.9 Release: 1%{?dist} URL: http://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -114,6 +114,10 @@ fi
%changelog +* Tue Jul 21 2009 John Matthews jmatthew@redhat.com 0.6.9-1 +- adding disable_iss flag to rhn.conf (pkilambi@redhat.com) +- 511100 - Fixed upgrade scripts to include cobbler.host (paji@redhat.com) + * Thu Jun 25 2009 John Matthews jmatthew@redhat.com 0.6.8-1 - Fix mod_jk failure to load. (dgoodwin@redhat.com)
commit c551802f548df261f47ee81dc273e4bcc1260cc5 Author: Miroslav Suchý msuchy@redhat.com Date: Tue Jul 21 17:30:26 2009 +0200
Automatic commit of package [spacewalk-web] release [0.6.13-1].
diff --git a/rel-eng/packages/spacewalk-web b/rel-eng/packages/spacewalk-web index 2db4d0d..c744c02 100644 --- a/rel-eng/packages/spacewalk-web +++ b/rel-eng/packages/spacewalk-web @@ -1 +1 @@ -0.6.12-1 web/ +0.6.13-1 web/ diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec index a5b5842..2650f72 100644 --- a/web/spacewalk-web.spec +++ b/web/spacewalk-web.spec @@ -2,7 +2,7 @@ Name: spacewalk-web Summary: Spacewalk Web site packages Group: Applications/Internet License: GPLv2 -Version: 0.6.12 +Version: 0.6.13 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -317,7 +317,7 @@ rm -rf $RPM_BUILD_ROOT
# $Id$ %changelog -* Tue Jul 21 2009 Miroslav Suchy msuchy@redhat.com 0.6.12-1 +* Tue Jul 21 2009 Miroslav Suchy msuchy@redhat.com 0.6.13-1 - 512440 - add cobbler-proxy.conf to older rhn proxy installer
* Thu Jul 09 2009 John Matthews jmatthew@redhat.com 0.6.11-1
commit 4e8f17f62810935d77e70707ade57dcf4732891f Author: Miroslav Suchý msuchy@redhat.com Date: Tue Jul 21 17:29:01 2009 +0200
512440 - load cobbler-proxy.conf in httpd.conf and load proxy module
diff --git a/web/html/applications/rhn-proxy/4.0/httpd/httpd.conf b/web/html/applications/rhn-proxy/4.0/httpd/httpd.conf index a065c7c..7cc80a1 100644 --- a/web/html/applications/rhn-proxy/4.0/httpd/httpd.conf +++ b/web/html/applications/rhn-proxy/4.0/httpd/httpd.conf @@ -240,7 +240,7 @@ LoadModule anon_auth_module modules/mod_auth_anon.so #LoadModule mysql_auth_module modules/mod_auth_mysql.so #LoadModule auth_pgsql_module modules/mod_auth_pgsql.so #LoadModule digest_module modules/mod_digest.so -#LoadModule proxy_module modules/libproxy.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 @@ -318,7 +318,7 @@ AddModule mod_auth_anon.c #AddModule mod_auth_mysql.c #AddModule mod_auth_pgsql.c #AddModule mod_digest.c -#AddModule mod_proxy.c +AddModule mod_proxy.c #AddModule mod_cern_meta.c AddModule mod_expires.c AddModule mod_headers.c @@ -1459,3 +1459,4 @@ CustomLog logs/ssl_request_log \ </IfDefine>
Include conf/rhn_proxy.conf +Include conf/cobbler-proxy.conf diff --git a/web/html/applications/rhn-proxy/4.1/httpd/httpd.conf b/web/html/applications/rhn-proxy/4.1/httpd/httpd.conf index a065c7c..7cc80a1 100644 --- a/web/html/applications/rhn-proxy/4.1/httpd/httpd.conf +++ b/web/html/applications/rhn-proxy/4.1/httpd/httpd.conf @@ -240,7 +240,7 @@ LoadModule anon_auth_module modules/mod_auth_anon.so #LoadModule mysql_auth_module modules/mod_auth_mysql.so #LoadModule auth_pgsql_module modules/mod_auth_pgsql.so #LoadModule digest_module modules/mod_digest.so -#LoadModule proxy_module modules/libproxy.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 @@ -318,7 +318,7 @@ AddModule mod_auth_anon.c #AddModule mod_auth_mysql.c #AddModule mod_auth_pgsql.c #AddModule mod_digest.c -#AddModule mod_proxy.c +AddModule mod_proxy.c #AddModule mod_cern_meta.c AddModule mod_expires.c AddModule mod_headers.c @@ -1459,3 +1459,4 @@ CustomLog logs/ssl_request_log \ </IfDefine>
Include conf/rhn_proxy.conf +Include conf/cobbler-proxy.conf diff --git a/web/html/applications/rhn-proxy/4.2/httpd/httpd.conf b/web/html/applications/rhn-proxy/4.2/httpd/httpd.conf index a065c7c..7cc80a1 100644 --- a/web/html/applications/rhn-proxy/4.2/httpd/httpd.conf +++ b/web/html/applications/rhn-proxy/4.2/httpd/httpd.conf @@ -240,7 +240,7 @@ LoadModule anon_auth_module modules/mod_auth_anon.so #LoadModule mysql_auth_module modules/mod_auth_mysql.so #LoadModule auth_pgsql_module modules/mod_auth_pgsql.so #LoadModule digest_module modules/mod_digest.so -#LoadModule proxy_module modules/libproxy.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 @@ -318,7 +318,7 @@ AddModule mod_auth_anon.c #AddModule mod_auth_mysql.c #AddModule mod_auth_pgsql.c #AddModule mod_digest.c -#AddModule mod_proxy.c +AddModule mod_proxy.c #AddModule mod_cern_meta.c AddModule mod_expires.c AddModule mod_headers.c @@ -1459,3 +1459,4 @@ CustomLog logs/ssl_request_log \ </IfDefine>
Include conf/rhn_proxy.conf +Include conf/cobbler-proxy.conf diff --git a/web/html/applications/rhn-proxy/5.0/httpd/httpd.conf b/web/html/applications/rhn-proxy/5.0/httpd/httpd.conf index a065c7c..7cc80a1 100644 --- a/web/html/applications/rhn-proxy/5.0/httpd/httpd.conf +++ b/web/html/applications/rhn-proxy/5.0/httpd/httpd.conf @@ -240,7 +240,7 @@ LoadModule anon_auth_module modules/mod_auth_anon.so #LoadModule mysql_auth_module modules/mod_auth_mysql.so #LoadModule auth_pgsql_module modules/mod_auth_pgsql.so #LoadModule digest_module modules/mod_digest.so -#LoadModule proxy_module modules/libproxy.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 @@ -318,7 +318,7 @@ AddModule mod_auth_anon.c #AddModule mod_auth_mysql.c #AddModule mod_auth_pgsql.c #AddModule mod_digest.c -#AddModule mod_proxy.c +AddModule mod_proxy.c #AddModule mod_cern_meta.c AddModule mod_expires.c AddModule mod_headers.c @@ -1459,3 +1459,4 @@ CustomLog logs/ssl_request_log \ </IfDefine>
Include conf/rhn_proxy.conf +Include conf/cobbler-proxy.conf
commit 71858e2aecce64910ee25a348ebe2d20dea3c989 Author: John Matthews jmatthew@redhat.com Date: Tue Jul 21 11:14:48 2009 -0400
Automatic commit of package [spacewalk-java] release [0.6.33-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec index 8d41d86..933a515 100644 --- a/java/spacewalk-java.spec +++ b/java/spacewalk-java.spec @@ -12,7 +12,7 @@ Name: spacewalk-java Summary: Spacewalk Java site packages Group: Applications/Internet License: GPLv2 -Version: 0.6.32 +Version: 0.6.33 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -250,6 +250,38 @@ fi %attr(644, root, root) %{_datadir}/rhn/lib/rhn.jar
%changelog +* Tue Jul 21 2009 John Matthews jmatthew@redhat.com 0.6.33-1 +- 512679 - Fix to guess a sensible default virt path for Xen/KVM virt type + (paji@redhat.com) +- 510785 - Removed the 'valid' column from the ks profiles list + (paji@redhat.com) +- 512396 - Cobbler's KS meta can store ints while our code was expecting them + to be all strings (paji@redhat.com) +- Fixed unit tests (paji@redhat.com) +- 510785 - Handled an edge case where there are NO valid trees available in KS + raw mode.. (paji@redhat.com) +- 510785 - Major commit to deal with KS/Distro upgrade scenarios + (paji@redhat.com) +- 509409 - rewrote package file naming when pushed from proxy + (shughes@redhat.com) +- 510785 - modifying query to now show profiles on provisioning schedule pages + if the profiles cobbler id is null (jsherril@redhat.com) +- 512224 - improving handling of invalid network interfaces when adding them to + cobbler (jsherril@redhat.com) +- 510785 - updating cobbler sync tasks to ignore kickstarts and trees when the + tree is not able to be synced to cobbler (jsherril@redhat.com) +- 511963 - fixing issue where changing distro from non-para virt to paravirt + would not update cobbler objects correctly (or vice-versa) + (jsherril@redhat.com) +- 510785 - Initial stab on the Invalid KS Distro Base Path issue. + (paji@redhat.com) +- 508331 - sha256 checksum support for yum repo generation stuff through + taskomatic. (pkilambi@redhat.com) +- 510329 - Fix SSM package operations UI timeout. (dgoodwin@redhat.com) +- 509589 - fix for org counts (shughes@redhat.com) +- 510299 - Big commit to get static networking to work (paji@redhat.com) +- 509409 - correct package display for rhn_package_manager (shughes@redhat.com) + * Thu Jul 09 2009 John Matthews jmatthew@redhat.com 0.6.32-1 - 510122 - ErrataSearch now filters results so it won't display errata from a non-sharing Org (jmatthew@redhat.com) diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java index 440fb75..31f2495 100644 --- a/rel-eng/packages/spacewalk-java +++ b/rel-eng/packages/spacewalk-java @@ -1 +1 @@ -0.6.32-1 java/ +0.6.33-1 java/
commit bacd7ecb9e0c10b315f3f097279528aa9ce7bf62 Author: John Matthews jmatthew@redhat.com Date: Tue Jul 21 11:11:54 2009 -0400
Automatic commit of package [spacewalk-setup] release [0.6.10-1].
diff --git a/rel-eng/packages/spacewalk-setup b/rel-eng/packages/spacewalk-setup index 87a7464..85d7245 100644 --- a/rel-eng/packages/spacewalk-setup +++ b/rel-eng/packages/spacewalk-setup @@ -1 +1 @@ -0.6.9-1 spacewalk/setup/ +0.6.10-1 spacewalk/setup/ diff --git a/spacewalk/setup/spacewalk-setup.spec b/spacewalk/setup/spacewalk-setup.spec index a7cf6c2..8bb58cd 100644 --- a/spacewalk/setup/spacewalk-setup.spec +++ b/spacewalk/setup/spacewalk-setup.spec @@ -1,5 +1,5 @@ Name: spacewalk-setup -Version: 0.6.9 +Version: 0.6.10 Release: 1%{?dist} Summary: Initial setup tools for Red Hat Spacewalk
@@ -100,6 +100,11 @@ rm -rf %{buildroot} %dir %{_sysconfdir}/pki/spacewalk/jabberd
%changelog +* Tue Jul 21 2009 John Matthews jmatthew@redhat.com 0.6.10-1 +- rhn-load-config.pl - remove accidental 's' (bbuckingham@redhat.com) +- 511100 - Fixed upgrade scripts to include cobbler.host (paji@redhat.com) +- 511052 - script to fix rhn_sat_node, rhn_sat_cluster (mzazrivec@redhat.com) + * Thu Jun 25 2009 Milan Zazrivec mzazrivec@redhat.com 0.6.9-1 - no in-place editing of /etc/oratab under oracle user (mzazrivec@redhat.com) - remove extraneous backslash characters (mzazrivec@redhat.com)
commit 9ce80f1cdeed1f08b85f53d5a27dd189dce0ce55 Author: Miroslav Suchý msuchy@redhat.com Date: Tue Jul 21 16:30:06 2009 +0200
Automatic commit of package [spacewalk-web] release [0.6.12-1].
diff --git a/rel-eng/packages/spacewalk-web b/rel-eng/packages/spacewalk-web index d33060f..2db4d0d 100644 --- a/rel-eng/packages/spacewalk-web +++ b/rel-eng/packages/spacewalk-web @@ -1 +1 @@ -0.6.11-1 web/ +0.6.12-1 web/ diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec index 9de9163..a5b5842 100644 --- a/web/spacewalk-web.spec +++ b/web/spacewalk-web.spec @@ -2,7 +2,7 @@ Name: spacewalk-web Summary: Spacewalk Web site packages Group: Applications/Internet License: GPLv2 -Version: 0.6.11 +Version: 0.6.12 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -317,6 +317,9 @@ rm -rf $RPM_BUILD_ROOT
# $Id$ %changelog +* Tue Jul 21 2009 Miroslav Suchy msuchy@redhat.com 0.6.12-1 +- 512440 - add cobbler-proxy.conf to older rhn proxy installer + * Thu Jul 09 2009 John Matthews jmatthew@redhat.com 0.6.11-1 - 510146 - Update copyright years from 2002-08 to 2002-09. (dgoodwin@redhat.com)
commit 5d183fb9f770eed516b21bc9841e71ebb6bcacaf Author: Miroslav Suchý msuchy@redhat.com Date: Tue Jul 21 16:26:37 2009 +0200
512440 - add cobbler-proxy.conf to 5.1, 5.0, 4.2, 4.1, 4.0 rhn proxy installer
diff --git a/web/html/applications/rhn-proxy/4.0/httpd/cobbler-proxy.conf b/web/html/applications/rhn-proxy/4.0/httpd/cobbler-proxy.conf new file mode 100644 index 0000000..79fb06d --- /dev/null +++ b/web/html/applications/rhn-proxy/4.0/httpd/cobbler-proxy.conf @@ -0,0 +1,9 @@ +ProxyPass /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api +ProxyPassReverse /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api + +ProxyPass /cblr https://$%7Bsession.rhn_parent%7D/cblr +ProxyPassReverse /cblr https://$%7Bsession.rhn_parent%7D/cblr + +ProxyPass /cobbler https://$%7Bsession.rhn_parent%7D/cobbler +ProxyPassReverse /cobbler https://$%7Bsession.rhn_parent%7D/cobbler + diff --git a/web/html/applications/rhn-proxy/4.0/install-rhn-proxy.xml b/web/html/applications/rhn-proxy/4.0/install-rhn-proxy.xml index 5f405b9..a0e0b20 100644 --- a/web/html/applications/rhn-proxy/4.0/install-rhn-proxy.xml +++ b/web/html/applications/rhn-proxy/4.0/install-rhn-proxy.xml @@ -535,6 +535,11 @@ Would you like to enable Monitoring Proxy functionality on this system? template="httpd/rhn_proxy.conf" mode="640" username="root" groupname="apache"/> </activity>
+ <activity description="Generate /etc/httpd/conf/cobbler-proxy.conf config file"> + <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/httpd/conf/cobbler-proxy.conf" + template="httpd/cobbler-proxy.conf" mode="640" username="root" groupname="apache"/> + </activity> + <activity description="Generate /etc/jabberd/c2s.xml config file" acl="global_config(ssl_available);session_data_true(enable_osad)"> <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/jabberd/c2s.xml" @@ -589,6 +594,7 @@ fi <configfile>/etc/squid/squid.conf</configfile> <configfile>/etc/httpd/conf/httpd.conf</configfile> <configfile>/etc/httpd/conf/rhn_proxy.conf</configfile> + <configfile>/etc/httpd/conf/cobbler-proxy.conf</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.crt/server.crt</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.csr/server.csr</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.key/server.key</configfile> diff --git a/web/html/applications/rhn-proxy/4.1/httpd/cobbler-proxy.conf b/web/html/applications/rhn-proxy/4.1/httpd/cobbler-proxy.conf new file mode 100644 index 0000000..79fb06d --- /dev/null +++ b/web/html/applications/rhn-proxy/4.1/httpd/cobbler-proxy.conf @@ -0,0 +1,9 @@ +ProxyPass /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api +ProxyPassReverse /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api + +ProxyPass /cblr https://$%7Bsession.rhn_parent%7D/cblr +ProxyPassReverse /cblr https://$%7Bsession.rhn_parent%7D/cblr + +ProxyPass /cobbler https://$%7Bsession.rhn_parent%7D/cobbler +ProxyPassReverse /cobbler https://$%7Bsession.rhn_parent%7D/cobbler + diff --git a/web/html/applications/rhn-proxy/4.1/install-rhn-proxy.xml b/web/html/applications/rhn-proxy/4.1/install-rhn-proxy.xml index aa918fd..e89333f 100644 --- a/web/html/applications/rhn-proxy/4.1/install-rhn-proxy.xml +++ b/web/html/applications/rhn-proxy/4.1/install-rhn-proxy.xml @@ -535,6 +535,11 @@ Would you like to enable Monitoring Proxy functionality on this system? template="httpd/rhn_proxy.conf" mode="640" username="root" groupname="apache"/> </activity>
+ <activity description="Generate /etc/httpd/conf/cobbler-proxy.conf config file"> + <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/httpd/conf/cobbler-proxy.conf" + template="httpd/cobbler-proxy.conf" mode="640" username="root" groupname="apache"/> + </activity> + <activity description="Generate /etc/jabberd/c2s.xml config file" acl="global_config(ssl_available);session_data_true(enable_osad)"> <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/jabberd/c2s.xml" @@ -589,6 +594,7 @@ fi <configfile>/etc/squid/squid.conf</configfile> <configfile>/etc/httpd/conf/httpd.conf</configfile> <configfile>/etc/httpd/conf/rhn_proxy.conf</configfile> + <configfile>/etc/httpd/conf/cobbler-proxy.conf</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.crt/server.crt</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.csr/server.csr</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.key/server.key</configfile> diff --git a/web/html/applications/rhn-proxy/4.2/httpd/cobbler-proxy.conf b/web/html/applications/rhn-proxy/4.2/httpd/cobbler-proxy.conf new file mode 100644 index 0000000..79fb06d --- /dev/null +++ b/web/html/applications/rhn-proxy/4.2/httpd/cobbler-proxy.conf @@ -0,0 +1,9 @@ +ProxyPass /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api +ProxyPassReverse /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api + +ProxyPass /cblr https://$%7Bsession.rhn_parent%7D/cblr +ProxyPassReverse /cblr https://$%7Bsession.rhn_parent%7D/cblr + +ProxyPass /cobbler https://$%7Bsession.rhn_parent%7D/cobbler +ProxyPassReverse /cobbler https://$%7Bsession.rhn_parent%7D/cobbler + diff --git a/web/html/applications/rhn-proxy/4.2/install-rhn-proxy.xml b/web/html/applications/rhn-proxy/4.2/install-rhn-proxy.xml index 66ded03..7b0c91e 100644 --- a/web/html/applications/rhn-proxy/4.2/install-rhn-proxy.xml +++ b/web/html/applications/rhn-proxy/4.2/install-rhn-proxy.xml @@ -552,6 +552,11 @@ Would you like to enable Monitoring Proxy functionality on this system? template="httpd/rhn_proxy.conf" mode="640" username="root" groupname="apache"/> </activity>
+ <activity description="Generate /etc/httpd/conf/cobbler-proxy.conf config file"> + <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/httpd/conf/cobbler-proxy.conf" + template="httpd/cobbler-proxy.conf" mode="640" username="root" groupname="apache"/> + </activity> + <activity description="Generate /etc/jabberd/c2s.xml config file" acl="global_config(ssl_available);session_data_true(enable_osad)"> <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/jabberd/c2s.xml" @@ -606,6 +611,7 @@ fi <configfile>/etc/squid/squid.conf</configfile> <configfile>/etc/httpd/conf/httpd.conf</configfile> <configfile>/etc/httpd/conf/rhn_proxy.conf</configfile> + <configfile>/etc/httpd/conf/cobbler-proxy.conf</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.crt/server.crt</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.csr/server.csr</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.key/server.key</configfile> diff --git a/web/html/applications/rhn-proxy/5.0/httpd/cobbler-proxy.conf b/web/html/applications/rhn-proxy/5.0/httpd/cobbler-proxy.conf new file mode 100644 index 0000000..79fb06d --- /dev/null +++ b/web/html/applications/rhn-proxy/5.0/httpd/cobbler-proxy.conf @@ -0,0 +1,9 @@ +ProxyPass /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api +ProxyPassReverse /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api + +ProxyPass /cblr https://$%7Bsession.rhn_parent%7D/cblr +ProxyPassReverse /cblr https://$%7Bsession.rhn_parent%7D/cblr + +ProxyPass /cobbler https://$%7Bsession.rhn_parent%7D/cobbler +ProxyPassReverse /cobbler https://$%7Bsession.rhn_parent%7D/cobbler + diff --git a/web/html/applications/rhn-proxy/5.0/install-rhn-proxy.xml b/web/html/applications/rhn-proxy/5.0/install-rhn-proxy.xml index cec006a..a3e2e45 100644 --- a/web/html/applications/rhn-proxy/5.0/install-rhn-proxy.xml +++ b/web/html/applications/rhn-proxy/5.0/install-rhn-proxy.xml @@ -552,6 +552,11 @@ Would you like to enable Monitoring Proxy functionality on this system? template="httpd/rhn_proxy.conf" mode="640" username="root" groupname="apache"/> </activity>
+ <activity description="Generate /etc/httpd/conf/cobbler-proxy.conf config file"> + <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/httpd/conf/cobbler-proxy.conf" + template="httpd/cobbler-proxy.conf" mode="640" username="root" groupname="apache"/> + </activity> + <activity description="Generate /etc/jabberd/c2s.xml config file" acl="global_config(ssl_available);session_data_true(enable_osad)"> <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/jabberd/c2s.xml" @@ -606,6 +611,7 @@ fi <configfile>/etc/squid/squid.conf</configfile> <configfile>/etc/httpd/conf/httpd.conf</configfile> <configfile>/etc/httpd/conf/rhn_proxy.conf</configfile> + <configfile>/etc/httpd/conf/cobbler-proxy.conf</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.crt/server.crt</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.csr/server.csr</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.key/server.key</configfile> diff --git a/web/html/applications/rhn-proxy/5.1/httpd/cobbler-proxy.conf b/web/html/applications/rhn-proxy/5.1/httpd/cobbler-proxy.conf new file mode 100644 index 0000000..79fb06d --- /dev/null +++ b/web/html/applications/rhn-proxy/5.1/httpd/cobbler-proxy.conf @@ -0,0 +1,9 @@ +ProxyPass /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api +ProxyPassReverse /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api + +ProxyPass /cblr https://$%7Bsession.rhn_parent%7D/cblr +ProxyPassReverse /cblr https://$%7Bsession.rhn_parent%7D/cblr + +ProxyPass /cobbler https://$%7Bsession.rhn_parent%7D/cobbler +ProxyPassReverse /cobbler https://$%7Bsession.rhn_parent%7D/cobbler + diff --git a/web/html/applications/rhn-proxy/5.1/install-rhn-proxy.xml b/web/html/applications/rhn-proxy/5.1/install-rhn-proxy.xml index f1ab7ac..69d8bb3 100644 --- a/web/html/applications/rhn-proxy/5.1/install-rhn-proxy.xml +++ b/web/html/applications/rhn-proxy/5.1/install-rhn-proxy.xml @@ -547,6 +547,11 @@ Would you like to enable Monitoring Proxy functionality on this system? template="httpd/rhn_proxy.conf" mode="640" username="root" groupname="apache"/> </activity>
+ <activity description="Generate /etc/httpd/conf.d/cobbler-proxy.conf config file"> + <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/httpd/conf.d/cobbler-proxy.conf" + template="httpd/cobbler-proxy.conf" mode="640" username="root" groupname="apache"/> + </activity> + <activity description="Generate /etc/jabberd/c2s.xml config file" acl="global_config(ssl_available);session_data_true(enable_osad)"> <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/jabberd/c2s.xml" @@ -599,6 +604,7 @@ fi <configfile>/etc/rhn/rhn.conf</configfile> <configfile acl="session_data_true(enable_monitoring)">/etc/rhn/cluster.ini</configfile> <configfile>/etc/squid/squid.conf</configfile> + <configfile>/etc/httpd/conf.d/cobbler-proxy.conf</configfile> <configfile>/etc/httpd/conf.d/rhn_proxy.conf</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.crt/server.crt</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.csr/server.csr</configfile>
commit b24912a165aaa6537fdff63c2776a2424039a766 Author: Miroslav Suchý msuchy@redhat.com Date: Tue Jul 21 15:26:36 2009 +0200
512440 - add cobbler-proxy.conf to 5.2 rhn proxy installer
diff --git a/web/html/applications/rhn-proxy/5.2/httpd/cobbler-proxy.conf b/web/html/applications/rhn-proxy/5.2/httpd/cobbler-proxy.conf new file mode 100644 index 0000000..79fb06d --- /dev/null +++ b/web/html/applications/rhn-proxy/5.2/httpd/cobbler-proxy.conf @@ -0,0 +1,9 @@ +ProxyPass /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api +ProxyPassReverse /cobbler_api https://$%7Bsession.rhn_parent%7D/cobbler_api + +ProxyPass /cblr https://$%7Bsession.rhn_parent%7D/cblr +ProxyPassReverse /cblr https://$%7Bsession.rhn_parent%7D/cblr + +ProxyPass /cobbler https://$%7Bsession.rhn_parent%7D/cobbler +ProxyPassReverse /cobbler https://$%7Bsession.rhn_parent%7D/cobbler + diff --git a/web/html/applications/rhn-proxy/5.2/install-rhn-proxy.xml b/web/html/applications/rhn-proxy/5.2/install-rhn-proxy.xml index 3bec25b..d5cd402 100644 --- a/web/html/applications/rhn-proxy/5.2/install-rhn-proxy.xml +++ b/web/html/applications/rhn-proxy/5.2/install-rhn-proxy.xml @@ -547,6 +547,11 @@ Would you like to enable Monitoring Proxy functionality on this system? template="httpd/rhn_proxy.conf" mode="640" username="root" groupname="apache"/> </activity>
+ <activity description="Generate /etc/httpd/conf.d/cobbler-proxy.conf config file"> + <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/httpd/conf.d/cobbler-proxy.conf" + template="httpd/cobbler-proxy.conf" mode="640" username="root" groupname="apache"/> + </activity> + <activity description="Generate /etc/httpd/conf.d/ssl.conf config file"> <generate-config-file target-config-channel="rhn_proxy_config_${system.id}" path="/etc/httpd/conf.d/ssl.conf" template="httpd/ssl.conf" mode="644" username="root" groupname="root"/> @@ -605,6 +610,7 @@ fi <configfile acl="session_data_true(enable_monitoring)">/etc/rhn/cluster.ini</configfile> <configfile>/etc/squid/squid.conf</configfile> <configfile>/etc/httpd/conf.d/rhn_proxy.conf</configfile> + <configfile>/etc/httpd/conf.d/cobbler-proxy.conf</configfile> <configfile>/etc/httpd/conf.d/ssl.conf</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.crt/server.crt</configfile> <configfile acl="global_config(ssl_available) or not global_config(satellite)">/etc/httpd/conf/ssl.csr/server.csr</configfile>
commit 7f7c675c5c0c47d7a3315b73ad5b095be5c7e097 Author: Devan Goodwin dgoodwin@redhat.com Date: Tue Jul 21 10:36:06 2009 -0300
Remove accidentally committed change.
diff --git a/selinux/spacewalk-selinux/spacewalk-selinux.spec b/selinux/spacewalk-selinux/spacewalk-selinux.spec index 3772b0a..3673275 100644 --- a/selinux/spacewalk-selinux/spacewalk-selinux.spec +++ b/selinux/spacewalk-selinux/spacewalk-selinux.spec @@ -39,7 +39,6 @@ Requires: spacewalk-backend-server Requires: spacewalk-certs-tools Requires: oracle-instantclient-selinux Requires: oracle-instantclient-sqlplus-selinux -Requires: spacewalk-monitoring-selinux
%description SELinux policy module supporting Spacewalk Server.
commit 222c4ff455f864e0e7536385c621d0bab68b3037 Author: Devan Goodwin dgoodwin@redhat.com Date: Tue Jul 21 10:35:20 2009 -0300
Automatic commit of package [spacewalk-monitoring] release [0.6.6-1].
diff --git a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec index fff174b..fed7e34 100644 --- a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec +++ b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec @@ -14,7 +14,7 @@ Summary: Spacewalk monitoring Name: spacewalk-monitoring Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... -Version: 0.6.5 +Version: 0.6.6 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk License: GPLv2 @@ -123,7 +123,7 @@ rm -rf $RPM_BUILD_ROOT %doc LICENSE
%changelog -* Tue Jul 21 2009 Devan Goodwin dgoodwin@redhat.com 0.6.5-1 +* Tue Jul 21 2009 Devan Goodwin dgoodwin@redhat.com 0.6.6-1 - Disabling requires on spacewalk-monitoring-selinux. (temporary) (dgoodwin@redhat.com)
diff --git a/rel-eng/packages/spacewalk-monitoring b/rel-eng/packages/spacewalk-monitoring index a77d490..d414f1c 100644 --- a/rel-eng/packages/spacewalk-monitoring +++ b/rel-eng/packages/spacewalk-monitoring @@ -1 +1 @@ -0.6.5-1 monitoring/spacewalk-monitoring/ +0.6.6-1 monitoring/spacewalk-monitoring/
commit 582b37a212858fbdd02a86e30087ace3bec52229 Author: Devan Goodwin dgoodwin@redhat.com Date: Tue Jul 21 10:32:33 2009 -0300
No requires for monitoring selinux package on Fedora 11. (yet)
diff --git a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec index 8a4ffc0..fff174b 100644 --- a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec +++ b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec @@ -1,3 +1,16 @@ +%define require_selinux 1 + +# No Selinux for RHEL 4: +%if 0%{?rhel} == 4 +%define require_selinux 0 +%endif + +# No seliux for Fedora 11 (yet): +%if 0%{?fedora} == 11 +%define require_selinux 0 +%endif + + Summary: Spacewalk monitoring Name: spacewalk-monitoring Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -47,11 +60,10 @@ Requires: SputLite-server Requires: ssl_bridge Requires: status_log_acceptor Requires: tsdb -#%if 0%{?rhel} == 4 -#for rhel4 we have no selinux policy, everything else should have -#%else -#Requires: spacewalk-monitoring-selinux -#%endif + +%if %{require_selinux} +Requires: spacewalk-monitoring-selinux +%endif
Requires(post): chkconfig Requires(preun): chkconfig
commit fbe41f868a3d731d8a0abd343ff0873b53aec2b9 Author: Devan Goodwin dgoodwin@redhat.com Date: Tue Jul 21 09:57:54 2009 -0300
Automatic commit of package [spacewalk-monitoring] release [0.6.5-1].
diff --git a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec index df71450..8a4ffc0 100644 --- a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec +++ b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec @@ -1,7 +1,7 @@ Summary: Spacewalk monitoring Name: spacewalk-monitoring Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... -Version: 0.6.4 +Version: 0.6.5 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk License: GPLv2 @@ -111,6 +111,10 @@ rm -rf $RPM_BUILD_ROOT %doc LICENSE
%changelog +* Tue Jul 21 2009 Devan Goodwin dgoodwin@redhat.com 0.6.5-1 +- Disabling requires on spacewalk-monitoring-selinux. (temporary) + (dgoodwin@redhat.com) + * Mon May 11 2009 Jan Pazdziora 0.6.4-1 - Move Req of oracle-instantclient-selinux to spacewalk-monitoring-selinux
diff --git a/rel-eng/packages/spacewalk-monitoring b/rel-eng/packages/spacewalk-monitoring index fa4a675..a77d490 100644 --- a/rel-eng/packages/spacewalk-monitoring +++ b/rel-eng/packages/spacewalk-monitoring @@ -1 +1 @@ -0.6.4-1 monitoring/spacewalk-monitoring/ +0.6.5-1 monitoring/spacewalk-monitoring/
commit db366bb19df902e4a207b4331aec455e58edad48 Author: Devan Goodwin dgoodwin@redhat.com Date: Tue Jul 21 09:56:09 2009 -0300
Disabling requires on spacewalk-monitoring-selinux. (temporary)
diff --git a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec index 29c2d47..df71450 100644 --- a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec +++ b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec @@ -47,11 +47,11 @@ Requires: SputLite-server Requires: ssl_bridge Requires: status_log_acceptor Requires: tsdb -%if 0%{?rhel} == 4 +#%if 0%{?rhel} == 4 #for rhel4 we have no selinux policy, everything else should have -%else -Requires: spacewalk-monitoring-selinux -%endif +#%else +#Requires: spacewalk-monitoring-selinux +#%endif
Requires(post): chkconfig Requires(preun): chkconfig diff --git a/selinux/spacewalk-selinux/spacewalk-selinux.spec b/selinux/spacewalk-selinux/spacewalk-selinux.spec index 3673275..3772b0a 100644 --- a/selinux/spacewalk-selinux/spacewalk-selinux.spec +++ b/selinux/spacewalk-selinux/spacewalk-selinux.spec @@ -39,6 +39,7 @@ Requires: spacewalk-backend-server Requires: spacewalk-certs-tools Requires: oracle-instantclient-selinux Requires: oracle-instantclient-sqlplus-selinux +Requires: spacewalk-monitoring-selinux
%description SELinux policy module supporting Spacewalk Server.
commit d7951318895277bc197a9b14b8c0e03664c1bf69 Author: Milan Zazrivec mzazrivec@redhat.com Date: Tue Jul 21 14:05:29 2009 +0200
don't remove xml-commons-apis during upgrade
diff --git a/satellite/install/install.pl b/satellite/install/install.pl index f91f7dc..18b4d41 100755 --- a/satellite/install/install.pl +++ b/satellite/install/install.pl @@ -534,7 +534,7 @@ sub remove_obsoleted_packages { print "* Purging conflicting packages.\n"; my @pkgs = ('rhn-apache', 'rhn-modpython', 'rhn-modssl', 'rhn-modperl', 'perl-libapreq', 'bouncycastle-jdk1.4', - 'xml-commons-apis', 'quartz-oracle', 'jaf', 'jta'); + 'quartz-oracle', 'jaf', 'jta'); for my $pkg (@pkgs) { if (system_debug('rpm', '-q', $pkg) == 0) { system_debug('rpm', '-ev', '--nodeps', $pkg);
commit 692ae7d04a17cfe598557ae732e3ca42535c7d5f Author: Partha Aji paji@redhat.com Date: Mon Jul 20 16:54:47 2009 -0400
512679 - Fix to guess a sensible default virt path for Xen/KVM virt type
diff --git a/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java b/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java index 895a0c1..d1e5065 100644 --- a/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java +++ b/java/code/src/com/redhat/rhn/common/conf/ConfigDefaults.java @@ -135,8 +135,10 @@ public class ConfigDefaults { public static final String COBBLER_SNIPPETS_DIR = "cobbler.snippets.dir"; private static final String DEFAULT_COBBLER_SNIPPET_DIR = "/var/lib/cobbler/snippets";
- public static final String VIRT_PATH_DIR = "kickstart.virt_storage_path"; - private static final String DEFAULT_VIRT_PATH = "/var/lib/libvirt/images"; + public static final String KVM_VIRT_PATH_DIR = "kickstart.virt_storage_path_kvm"; + public static final String XEN_VIRT_PATH_DIR = "kickstart.virt_storage_path_xen"; + private static final String DEFAULT_XEN_VIRT_PATH = "/var/lib/xen/images"; + private static final String DEFAULT_KVM_VIRT_PATH = "/var/lib/libvirt/images"; public static final String VIRT_BRIDGE = "kickstart.virt_bridge"; public static final String VIRT_MEM = "kickstart.virt_mem_size_mb"; public static final String VIRT_CPU = "kickstart.virt_cpus"; @@ -246,10 +248,13 @@ public class ConfigDefaults { /** * Returns the base directory where the virt artifacts will be stored. * This information is used while setting up system records and so on.. + * @param xen true if the virt path required is for a xen virt type. * @return the virt path.. */ - public File getVirtPath() { - return new File(Config.get().getString(VIRT_PATH_DIR, DEFAULT_VIRT_PATH)); + public File getVirtPath(boolean xen) { + String virtPath = xen ? XEN_VIRT_PATH_DIR : KVM_VIRT_PATH_DIR; + String defaultVirtPath = xen ? DEFAULT_XEN_VIRT_PATH : DEFAULT_KVM_VIRT_PATH; + return new File(Config.get().getString(virtPath, defaultVirtPath)); }
/** diff --git a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java index 3e5ad9d..3744a7e 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/systems/virtualization/ProvisionVirtualizationWizardAction.java @@ -52,7 +52,7 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard public static final String VIRTUAL_BRIDGE = "virtBridge"; public static final String VIRTUAL_FILE_PATH = "diskPath"; public static final String LOCAL_STORAGE_MB = "localStorageMegabytes"; - public static final String PROFILE = "profile"; + public static final String PROFILE = "cobbler_profile";
public static final String GUEST_NAME = "guestName"; public static final int MIN_NAME_SIZE = 4; @@ -97,10 +97,14 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard //saveMessages(ctx.getRequest(), errors); return runFirst(mapping, form, ctx, response, step); } + ActionForward forward = super.runSecond(mapping, form, ctx, response, step); + Profile pf = getCobblerProfile(ctx); + KickstartData ksdata = ctx.lookupAndBindKickstartData(); if (StringUtils.isEmpty(form.getString(VIRTUAL_FILE_PATH))) { form.set(VIRTUAL_FILE_PATH, ProvisionVirtualInstanceCommand. - makeDefaultVirtPath(form.getString(GUEST_NAME))); + makeDefaultVirtPath(form.getString(GUEST_NAME), + ksdata.getKickstartDefaults().getVirtualizationType())); } if (StringUtils.isEmpty(form.getString(MEMORY_ALLOCATION))) { form.set(MEMORY_ALLOCATION, String.valueOf(pf.getVirtRam())); @@ -122,7 +126,7 @@ public class ProvisionVirtualizationWizardAction extends ScheduleKickstartWizard form.set(TARGET_PROFILE_TYPE, KickstartScheduleCommand.TARGET_PROFILE_TYPE_NONE); } - return super.runSecond(mapping, form, ctx, response, step); + return forward; }
/** diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/ProvisionVirtualInstanceCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/ProvisionVirtualInstanceCommand.java index 0737a65..77ce4dd 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/ProvisionVirtualInstanceCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/ProvisionVirtualInstanceCommand.java @@ -25,6 +25,7 @@ import com.redhat.rhn.domain.action.kickstart.KickstartGuestAction; import com.redhat.rhn.domain.kickstart.KickstartData; import com.redhat.rhn.domain.kickstart.KickstartFactory; import com.redhat.rhn.domain.kickstart.KickstartSession; +import com.redhat.rhn.domain.kickstart.KickstartVirtualizationType; import com.redhat.rhn.domain.server.Server; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.dto.kickstart.KickstartDto; @@ -304,7 +305,8 @@ public class ProvisionVirtualInstanceCommand extends KickstartScheduleCommand { public void setFilePath(String filePathIn) { this.filePath = filePathIn; if (StringUtils.isBlank(filePath)) { - filePath = makeDefaultVirtPath(getGuestName()); + filePath = makeDefaultVirtPath(getGuestName(), + getKsdata().getKickstartDefaults().getVirtualizationType()); } }
@@ -327,11 +329,16 @@ public class ProvisionVirtualInstanceCommand extends KickstartScheduleCommand { /** * Method to set up the default virt path where the guset will be stored * based on the guest name. - * @param name the name of the guest + * @param name the name of the guest + * @param type virtualization type to determine the virt paths + * its different for xen/kvm * @return the virt path. */ - public static String makeDefaultVirtPath(String name) { - File virtPathDir = ConfigDefaults.get().getVirtPath(); + public static String makeDefaultVirtPath(String name, + KickstartVirtualizationType type) { + File virtPathDir = ConfigDefaults.get().getVirtPath( + KickstartVirtualizationType.xenPV().equals(type) || + KickstartVirtualizationType.xenFV().equals(type)); File virtPath = new File(virtPathDir, name.replace(' ', '-')); return virtPath.getAbsolutePath(); }
commit d6e2e13a13343a823cb905ea80fdfd396c134b7e Author: Devan Goodwin dgoodwin@redhat.com Date: Mon Jul 20 15:18:54 2009 -0300
Automatic commit of package [spacewalk] release [0.6.2-1].
diff --git a/rel-eng/packages/spacewalk b/rel-eng/packages/spacewalk index f689992..c981907 100644 --- a/rel-eng/packages/spacewalk +++ b/rel-eng/packages/spacewalk @@ -1 +1 @@ -0.6.1-1 spacewalk/package/ +0.6.2-1 spacewalk/package/ diff --git a/spacewalk/package/spacewalk.spec b/spacewalk/package/spacewalk.spec index 41ea5e5..895c512 100644 --- a/spacewalk/package/spacewalk.spec +++ b/spacewalk/package/spacewalk.spec @@ -1,6 +1,6 @@ %define release_name Alpha Name: spacewalk -Version: 0.6.1 +Version: 0.6.2 Release: 1%{?dist} Summary: Spacewalk Systems Management Application URL: https://fedorahosted.org/spacewalk @@ -92,6 +92,9 @@ rm -rf %{buildroot} /%{_sysconfdir}/spacewalk-release
%changelog +* Mon Jul 20 2009 Devan Goodwin dgoodwin@redhat.com 0.6.2-1 +- Disabling spacewalk selinux support temporarily. (dgoodwin@redhat.com) + * Fri Apr 17 2009 Devan Goodwin dgoodwin@redhat.com 0.6.1-1 - bump Versions to 0.6.0 (jesusr@redhat.com)
commit efc2880b6a3b7814f4a236b1e55455c427edde62 Author: Devan Goodwin dgoodwin@redhat.com Date: Mon Jul 20 15:16:06 2009 -0300
tito: Fix md5 issues for el5.
Related somehow to new stronger hashes introduced in Fedora 11. While we only really want this for el5, the defines are harmless for other builds.
diff --git a/rel-eng/lib/spacewalk/releng/builder.py b/rel-eng/lib/spacewalk/releng/builder.py index 52e0101..8fe6e39 100644 --- a/rel-eng/lib/spacewalk/releng/builder.py +++ b/rel-eng/lib/spacewalk/releng/builder.py @@ -182,7 +182,7 @@ class Builder(object): elif dist: define_dist = "--define 'dist %s'" % dist
- cmd = "rpmbuild %s %s --nodeps -bs %s" % \ + cmd = 'rpmbuild --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" %s %s --nodeps -bs %s' % \ (self._get_rpmbuild_dir_options(), define_dist, self.spec_file) output = run_command(cmd) print(output) @@ -200,7 +200,7 @@ class Builder(object): define_dist = "" if self.dist: define_dist = "--define 'dist %s'" % self.dist - cmd = "rpmbuild %s %s --clean -ba %s" % \ + cmd = 'rpmbuild --define "_source_filedigest_algorithm md5" --define "_binary_filedigest_algorithm md5" %s %s --clean -ba %s' % \ (self._get_rpmbuild_dir_options(), define_dist, self.spec_file) output = run_command(cmd) print output
commit 34124fc9516ad179c88d504c4554af169a9c388d Author: Devan Goodwin dgoodwin@redhat.com Date: Mon Jul 20 15:14:28 2009 -0300
Disabling spacewalk selinux support temporarily.
Some of these packages are not buildable on Fedora 11, and selinux is blocking httpd on EL5 as well.
diff --git a/spacewalk/package/spacewalk.spec b/spacewalk/package/spacewalk.spec index 9a34fa9..41ea5e5 100644 --- a/spacewalk/package/spacewalk.spec +++ b/spacewalk/package/spacewalk.spec @@ -62,10 +62,10 @@ Requires: spacewalk-monitoring # Requires: rhn_solaris_bootstrap_5_1_0_3
# SELinux -Requires: spacewalk-selinux -Requires: jabberd-selinux -Requires: osa-dispatcher-selinux -Requires: spacewalk-monitoring-selinux +#Requires: spacewalk-selinux +#Requires: jabberd-selinux +#Requires: osa-dispatcher-selinux +#Requires: spacewalk-monitoring-selinux
%description
commit 64b21392f5c9f2243c68a36fe6c680a85b274567 Author: Partha Aji paji@redhat.com Date: Mon Jul 20 14:11:00 2009 -0400
510785 - Removed the 'valid' column from the ks profiles list
This is a useless column since the issue is with Distros not being valid and not profiles. So the Distros list will show invalid distros
diff --git a/java/code/src/com/redhat/rhn/frontend/dto/kickstart/KickstartDto.java b/java/code/src/com/redhat/rhn/frontend/dto/kickstart/KickstartDto.java index 5d3bb30..c7e9819 100644 --- a/java/code/src/com/redhat/rhn/frontend/dto/kickstart/KickstartDto.java +++ b/java/code/src/com/redhat/rhn/frontend/dto/kickstart/KickstartDto.java @@ -25,7 +25,6 @@ import org.apache.commons.lang.StringUtils; * @version $Rev: 50942 $ */ public class KickstartDto extends BaseDto { - private boolean valid; private Long id; private Long orgId; private Long kstreeId; @@ -258,26 +257,4 @@ public class KickstartDto extends BaseDto { public void setVirtBridge(String virtBridgeIn) { this.virtBridge = virtBridgeIn; } - - /** - * Checks if the profile is valid - * @return true if it is valid.. - */ - public boolean isValid() { - if (isCobbler()) { - return true; - } - if (StringUtils.isBlank(cobblerId)) { - return false; - } - return valid; - } - - /** - * true if the profile is valid - * @param isValid if the profile is valid - */ - public void setValid(boolean isValid) { - valid = isValid; - } } diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartLister.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartLister.java index d12b01d..39c9523 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartLister.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartLister.java @@ -29,6 +29,7 @@ import com.redhat.rhn.frontend.listview.PageControl; import com.redhat.rhn.manager.BaseManager; import com.redhat.rhn.manager.kickstart.cobbler.CobblerXMLRPCHelper;
+import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.cobbler.CobblerConnection; import org.cobbler.Distro; @@ -95,16 +96,6 @@ public class KickstartLister extends BaseManager { logger.debug("kickstartsInOrg(Org, PageControl) - end - return value=" + returnDataResult); } - - Set<Long> ids = new HashSet<Long>(); - List<KickstartableTree> trees = KickstartManager.getInstance(). - removeInvalid(KickstartFactory.lookupAccessibleTreesByOrg(orgIn)); - for (KickstartableTree tree : trees) { - ids.add(tree.getId()); - } - for (KickstartDto dto : returnDataResult) { - dto.setValid(ids.contains(dto.getKstreeId())); - } return returnDataResult; }
@@ -437,9 +428,34 @@ public class KickstartLister extends BaseManager { public List <KickstartDto> listProfilesForSsm(User user) { List <KickstartDto> ret = new LinkedList<KickstartDto>(); ret.addAll(kickstartsInOrg(user.getOrg(), null)); + pruneInvalid(user, ret); ret.addAll(listCobblerProfiles(user)); setKickstartUrls(ret, user); return ret; } - + + /** + * Given a list of Kickstart DTOs + * the code below removes all the profiles + * that are associated to an invalid distro. + * or not synced to spacewalk. Mainly used in schedule* pages + * @param user the user to get org info. + * @param profiles the kickstart dto list to be pruned + */ + public void pruneInvalid(User user, List<KickstartDto> profiles) { + Set<Long> ids = new HashSet<Long>(); + List<KickstartableTree> trees = KickstartManager.getInstance(). + removeInvalid(KickstartFactory. + lookupAccessibleTreesByOrg(user.getOrg())); + for (KickstartableTree tree : trees) { + ids.add(tree.getId()); + } + for (Iterator<KickstartDto> itr = profiles.iterator(); itr.hasNext();) { + KickstartDto dto = itr.next(); + if (StringUtils.isBlank(dto.getCobblerId()) || + !ids.contains(dto.getKstreeId())) { + itr.remove(); + } + } + } } diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java index 717683e..ff57259 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java @@ -404,6 +404,8 @@ public class KickstartScheduleCommand extends BaseSystemOperation { log.debug("got back from DB: " + retval); } KickstartLister.getInstance().setKickstartUrls(retval, user); + KickstartLister.getInstance().pruneInvalid(user, retval); + retval.setTotalSize(retval.size()); } }
diff --git a/java/code/webapp/WEB-INF/pages/kickstart/kickstarts.jsp b/java/code/webapp/WEB-INF/pages/kickstart/kickstarts.jsp index de3f3f0..fc8969b 100644 --- a/java/code/webapp/WEB-INF/pages/kickstart/kickstarts.jsp +++ b/java/code/webapp/WEB-INF/pages/kickstart/kickstarts.jsp @@ -61,7 +61,7 @@ <rl:column headerkey="kickstart.distro.label.jsp" sortattr="treeLabel"> <c:out value="${current.treeLabel}"/> </rl:column> - <rl:column headerkey="kickstart.distro.sw_managed.jsp" sortattr="cobbler"> + <rl:column headerkey="kickstart.distro.sw_managed.jsp" sortattr="cobbler" styleclass="last-column"> <c:choose> <c:when test="${current.cobbler}"> <img src="/img/rhn-listicon-error.gif"> @@ -71,17 +71,7 @@ </c:otherwise> </c:choose> </rl:column> - <rl:column headertext="${rhn:localize('kickstart.distro.is-valid.jsp')}?***" sortattr="valid" styleclass="last-column"> - <c:choose> - <c:when test="${current.valid}"> - <img src="/img/rhn-listicon-checked.gif"> - </c:when> - <c:otherwise> - <img src="/img/rhn-listicon-error.gif"> - </c:otherwise> - </c:choose> - </rl:column> - </rl:list> + </rl:list>
</rl:listset> </div> @@ -89,8 +79,6 @@ <c:if test="${not empty requestScope.orgDefaultExists}"> <p>rhn:tooltip** - <bean:message key="kickstart.list.jsp.orgdefault"/></rhn:tooltip></p> </c:if> - <p>rhn:tooltip***-<bean:message key="kickstarts.profile.is-valid.tooltip"/></rhn:tooltip></p> - </body> </html:html>
commit db1c74f458810578ee7f7ad73c5df233f29a9362 Author: Devan Goodwin dgoodwin@redhat.com Date: Mon Jul 20 14:47:01 2009 -0300
Automatic commit of package [perl-NOCpulse-OracleDB] release [1.28.16-1].
diff --git a/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec b/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec index d7def1f..770c756 100644 --- a/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec +++ b/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec @@ -1,5 +1,5 @@ Name: perl-NOCpulse-OracleDB -Version: 1.28.14 +Version: 1.28.16 Release: 1%{?dist} Summary: Perl modules for NOCpulse Oracle database access URL: https://fedorahosted.org/spacewalk @@ -47,7 +47,7 @@ rm -rf $RPM_BUILD_ROOT %{perl_vendorlib}/NOCpulse/*
%changelog -* Mon Jul 20 2009 Devan Goodwin dgoodwin@redhat.com 1.28.14-1 +* Mon Jul 20 2009 Devan Goodwin dgoodwin@redhat.com 1.28.16-1 - Dropping unecessary perl-NOCpulse-OracleDB build requires. (dgoodwin@redhat.com)
diff --git a/rel-eng/packages/perl-NOCpulse-OracleDB b/rel-eng/packages/perl-NOCpulse-OracleDB index dc11b35..db5e264 100644 --- a/rel-eng/packages/perl-NOCpulse-OracleDB +++ b/rel-eng/packages/perl-NOCpulse-OracleDB @@ -1 +1 @@ -1.28.14-1 monitoring/PerlModules/NP/OracleDB/ +1.28.16-1 monitoring/PerlModules/NP/OracleDB/
commit a31165f2094de1f76f86f76bdaa6b21ed44d72dd Author: Devan Goodwin dgoodwin@redhat.com Date: Mon Jul 20 12:18:15 2009 -0300
Automatic commit of package [osad] release [5.9.16-1].
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec index af7f203..f4f003f 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/%%7Bname%7D-%%7Bversion%7D.t... -Version: 5.9.15 +Version: 5.9.16 Release: 1%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -237,6 +237,9 @@ rpm -ql osa-dispatcher | xargs -n 1 /sbin/restorecon -rvvi {}
# $Id$ %changelog +* Mon Jul 20 2009 Devan Goodwin dgoodwin@redhat.com 5.9.16-1 +- Add osad BuildRequires for python-devel. (dgoodwin@redhat.com) + * Thu Jun 25 2009 John Matthews jmatthew@redhat.com 5.9.15-1 - 508064 - fix osad installation errors on client (mzazrivec@redhat.com)
diff --git a/rel-eng/packages/osad b/rel-eng/packages/osad index 98af1c7..20e08db 100644 --- a/rel-eng/packages/osad +++ b/rel-eng/packages/osad @@ -1 +1 @@ -5.9.15-1 client/tools/osad/ +5.9.16-1 client/tools/osad/
commit ef01909370c088d045fbd1b48c68f4ac1c15ceba Author: Devan Goodwin dgoodwin@redhat.com Date: Mon Jul 20 12:17:44 2009 -0300
Add osad BuildRequires for python-devel.
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec index e165bda..af7f203 100644 --- a/client/tools/osad/osad.spec +++ b/client/tools/osad/osad.spec @@ -13,6 +13,7 @@ Version: 5.9.15 Release: 1%{?dist} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch +BuildRequires: python-devel Requires: python Requires: rhnlib >= 1.8-3 Requires: jabberpy
commit 0d7db2b9c20dc7aa4efac1eca2b17aff15804cb9 Author: Partha Aji paji@redhat.com Date: Mon Jul 20 10:59:37 2009 -0400
512396 - Cobbler's KS meta can store ints while our code was expecting them to be all strings
diff --git a/java/code/src/com/redhat/rhn/common/util/StringUtil.java b/java/code/src/com/redhat/rhn/common/util/StringUtil.java index d09206a..5f7d246 100644 --- a/java/code/src/com/redhat/rhn/common/util/StringUtil.java +++ b/java/code/src/com/redhat/rhn/common/util/StringUtil.java @@ -747,7 +747,7 @@ public class StringUtil { * @param seperator the seperator to seperate the pairs with * @return the formatted string */ - public static String convertMapToString(Map<String, String> map, String seperator) { + public static String convertMapToString(Map<String, Object> map, String seperator) {
StringBuilder string = new StringBuilder(); for (Object key : map.keySet()) { 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 cc08b0a..cb90be6 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 @@ -4062,7 +4062,7 @@ public class SystemHandler extends BaseHandler { String hostName = (String)data.get("hostname"); String command = KickstartFormatter.makeStaticNetworkCommand(device, ip, gateway, nameservers.get(0), netmask, hostName); - Map<String, String> meta = rec.getKsMeta(); + Map<String, Object> meta = rec.getKsMeta(); meta.put(KickstartFormatter.STATIC_NETWORK_VAR, command); rec.setKsMeta(meta); rec.save(); diff --git a/java/code/src/org/cobbler/CobblerObject.java b/java/code/src/org/cobbler/CobblerObject.java index 2e18e28..57e0299 100644 --- a/java/code/src/org/cobbler/CobblerObject.java +++ b/java/code/src/org/cobbler/CobblerObject.java @@ -389,15 +389,15 @@ public abstract class CobblerObject { /** * @return the kernelMeta */ - public Map<String, String> getKsMeta() { - return (Map<String, String>)dataMap.get(KS_META); + public Map<String, Object> getKsMeta() { + return (Map<String, Object>)dataMap.get(KS_META); }
/** * @param kernelMetaIn the kernelMeta to set */ - public void setKsMeta(Map<String, String> kernelMetaIn) { + public void setKsMeta(Map<String, ? extends Object> kernelMetaIn) { modify(SET_KS_META, kernelMetaIn); }
commit a03d8c37a431623d61ed44597e1a1559bb2d76ee Author: Devan Goodwin dgoodwin@redhat.com Date: Mon Jul 20 10:18:09 2009 -0300
Automatic commit of package [perl-NOCpulse-OracleDB] release [1.28.14-1].
diff --git a/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec b/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec index 2504593..d7def1f 100644 --- a/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec +++ b/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec @@ -1,5 +1,5 @@ Name: perl-NOCpulse-OracleDB -Version: 1.28.13 +Version: 1.28.14 Release: 1%{?dist} Summary: Perl modules for NOCpulse Oracle database access URL: https://fedorahosted.org/spacewalk @@ -47,6 +47,10 @@ rm -rf $RPM_BUILD_ROOT %{perl_vendorlib}/NOCpulse/*
%changelog +* Mon Jul 20 2009 Devan Goodwin dgoodwin@redhat.com 1.28.14-1 +- Dropping unecessary perl-NOCpulse-OracleDB build requires. + (dgoodwin@redhat.com) + * Mon May 11 2009 Miroslav Suchý msuchy@redhat.com 1.28.13-1 - 499568 - allow LoadOneFrom to accept binded params
diff --git a/rel-eng/packages/perl-NOCpulse-OracleDB b/rel-eng/packages/perl-NOCpulse-OracleDB index 9c7926c..dc11b35 100644 --- a/rel-eng/packages/perl-NOCpulse-OracleDB +++ b/rel-eng/packages/perl-NOCpulse-OracleDB @@ -1 +1 @@ -1.28.13-1 monitoring/PerlModules/NP/OracleDB/ +1.28.14-1 monitoring/PerlModules/NP/OracleDB/
commit 7eb28115a2fc33d3ff3408ba8f9b5a65fe42b7ac Author: Devan Goodwin dgoodwin@redhat.com Date: Mon Jul 20 10:16:47 2009 -0300
Dropping unecessary perl-NOCpulse-OracleDB build requires.
diff --git a/monitoring/PerlModules/NP/OracleDB/OracleDB.pm b/monitoring/PerlModules/NP/OracleDB/OracleDB.pm index b41bab7..8236df3 100644 --- a/monitoring/PerlModules/NP/OracleDB/OracleDB.pm +++ b/monitoring/PerlModules/NP/OracleDB/OracleDB.pm @@ -7,7 +7,6 @@ $VERSION = (split(/\s+/, q$Id: OracleDB.pm,v 1.3 2005-07-06 20:51:40 nhansen Exp
use strict; use DBI; -use DBD::Oracle; use NOCpulse::Debug; use NOCpulse::Config;
diff --git a/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec b/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec index 680777c..2504593 100644 --- a/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec +++ b/monitoring/PerlModules/NP/OracleDB/perl-NOCpulse-OracleDB.spec @@ -7,7 +7,7 @@ Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D BuildArch: noarch Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) BuildRequires: perl(NOCpulse::Debug) perl(NOCpulse::Config) perl(NOCpulse::Utils::XML) perl(NOCpulse::Object) -BuildRequires: perl(DBD::Oracle) perl(DBI) perl(ExtUtils::MakeMaker) +BuildRequires: perl(DBI) perl(ExtUtils::MakeMaker) Group: Development/Libraries License: GPLv2 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
commit fac0c83fd924e901aa5cac32be6bf125806046c1 Author: Miroslav Suchý msuchy@redhat.com Date: Mon Jul 20 13:31:04 2009 +0200
Automatic commit of package [spacewalk-proxy-installer] release [0.6.20-1].
diff --git a/proxy/installer/spacewalk-proxy-installer.spec b/proxy/installer/spacewalk-proxy-installer.spec index b6d49e6..0f99b78 100644 --- a/proxy/installer/spacewalk-proxy-installer.spec +++ b/proxy/installer/spacewalk-proxy-installer.spec @@ -2,7 +2,7 @@ Name: spacewalk-proxy-installer Summary: Spacewalk Proxy Server Installer Group: Applications/Internet License: GPLv2 -Version: 0.6.19 +Version: 0.6.20 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -87,6 +87,9 @@ rm -rf $RPM_BUILD_ROOT %doc LICENSE answers.txt
%changelog +* Mon Jul 20 2009 Miroslav Suchy msuchy@redhat.com 0.6.20-1 +- 496615 - take up 1 as yes + * Mon Jul 13 2009 Miroslav Suchy msuchy@redhat.com 0.6.19-1 - 509450 - install our jabberd ssl cert during proxy installation
diff --git a/rel-eng/packages/spacewalk-proxy-installer b/rel-eng/packages/spacewalk-proxy-installer index fcf9bbd..ff91d33 100644 --- a/rel-eng/packages/spacewalk-proxy-installer +++ b/rel-eng/packages/spacewalk-proxy-installer @@ -1 +1 @@ -0.6.19-1 proxy/installer/ +0.6.20-1 proxy/installer/
commit b08e741d965535d9d67cb61abbd0200d6fa936e9 Author: Miroslav Suchý msuchy@redhat.com Date: Mon Jul 20 13:30:10 2009 +0200
496615 - take up 1 as yes
diff --git a/proxy/installer/configure-proxy.sh b/proxy/installer/configure-proxy.sh index e45daee..7c5563b 100755 --- a/proxy/installer/configure-proxy.sh +++ b/proxy/installer/configure-proxy.sh @@ -141,7 +141,7 @@ default_or_input () {
yes_no() { case "$1" in - Y|y|Y/n|n/Y) + Y|y|Y/n|n/Y|1) echo 1 ;; *)
commit d718d285910a197e289204651d83c6058d562c3f Author: Partha Aji paji@redhat.com Date: Sat Jul 18 01:52:39 2009 -0400
Fixed unit tests
diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/test/KickstartDataTest.java b/java/code/src/com/redhat/rhn/domain/kickstart/test/KickstartDataTest.java index e46b6ca..a3a5d08 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/test/KickstartDataTest.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/test/KickstartDataTest.java @@ -69,7 +69,6 @@ import org.cobbler.test.MockConnection; import org.hibernate.Session;
import java.io.File; -import java.io.IOException; import java.util.Collection; import java.util.Date; import java.util.HashSet; @@ -86,12 +85,20 @@ public class KickstartDataTest extends BaseTestCaseWithUser { private static final String STATIC_DEV = "dhcp:eth0"; private static final String KERNEL_PARAMS = "ide0=ata66";
- public static void setupTestConfiguration() throws IOException { + + public static void setupTestConfiguration() throws Exception { Config.get().setString(CobblerXMLRPCHelper.class.getName(), MockXMLRPCInvoker.class.getName()); Config.get().setString(ConfigDefaults.KICKSTART_COBBLER_DIR, "/tmp/kickstart/"); Config.get().setString(ConfigDefaults.COBBLER_SNIPPETS_DIR, "/tmp/kickstart/snippets"); + Config.get().setString(ConfigDefaults.MOUNT_POINT, "/tmp/kickstart/mount_point"); + createDirIfNotExists(new File("/tmp/kickstart/mount_point")); + + Config.get().setString(ConfigDefaults.KICKSTART_MOUNT_POINT, + "/tmp/kickstart/kickstart_mount_point"); + createDirIfNotExists(new File("/tmp/kickstart/kickstart_mount_point")); + Config.get().setString(CobblerConnection.class.getName(), MockConnection.class.getName()); createKickstartDirs(); @@ -99,31 +106,15 @@ public class KickstartDataTest extends BaseTestCaseWithUser {
}
- public static void createKickstartDirs() throws IOException { + public static void createKickstartDirs() throws Exception { createDirIfNotExists(new File(ConfigDefaults.get().getKickstartConfigDir() + "/" + KickstartData.WIZARD_DIR)); createDirIfNotExists(new File(ConfigDefaults.get().getKickstartConfigDir() + "/" + KickstartData.RAW_DIR)); createDirIfNotExists(CobblerSnippet.getSpacewalkSnippetsDir()); + KickstartableTreeTest.createKickstartTreeItems(); }
- private static void createDirIfNotExists(File dir) throws IOException { - String error = - "Could not create the following directory:[" + dir.getPath() + - "] . Please create that directory before proceeding with the tests"; - if (dir.exists() && !dir.isDirectory()) { - if (!dir.renameTo(new File(dir.getPath() + ".bak")) && - !dir.delete()) { - throw new RuntimeException(error); - } - } - - if (!dir.exists() && !dir.mkdirs()) { - throw new RuntimeException(error); - } - } - - public static void createCobblerObjects(KickstartData k) { Distro d = Distro.lookupById(CobblerXMLRPCHelper.getConnection("test"), k.getKickstartDefaults().getKstree().getCobblerId()); diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/test/KickstartableTreeTest.java b/java/code/src/com/redhat/rhn/domain/kickstart/test/KickstartableTreeTest.java index 579d63d..8608daf 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/test/KickstartableTreeTest.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/test/KickstartableTreeTest.java @@ -15,6 +15,7 @@ package com.redhat.rhn.domain.kickstart.test;
import com.redhat.rhn.common.hibernate.HibernateFactory; +import com.redhat.rhn.common.util.FileUtils; import com.redhat.rhn.domain.channel.Channel; import com.redhat.rhn.domain.channel.test.ChannelFactoryTest; import com.redhat.rhn.domain.kickstart.KickstartData; @@ -24,15 +25,18 @@ import com.redhat.rhn.domain.kickstart.KickstartTreeType; import com.redhat.rhn.domain.kickstart.KickstartableTree; import com.redhat.rhn.domain.org.Org; import com.redhat.rhn.domain.org.OrgFactory; +import com.redhat.rhn.domain.user.User; import com.redhat.rhn.manager.kickstart.cobbler.CobblerXMLRPCHelper; import com.redhat.rhn.testing.BaseTestCaseWithUser; import com.redhat.rhn.testing.ChannelTestUtils; import com.redhat.rhn.testing.TestUtils; +import com.redhat.rhn.testing.UserTestUtils;
import org.apache.commons.lang.RandomStringUtils; import org.cobbler.Distro; import org.hibernate.Session;
+import java.io.File; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -44,6 +48,36 @@ import java.util.List; public class KickstartableTreeTest extends BaseTestCaseWithUser {
public static final String TEST_BOOT_PATH = "test-boot-image-i186"; + public static final File KICKSTART_TREE_PATH = new File("/tmp/kickstart/images"); + + public static void createKickstartTreeItems() throws Exception { + createKickstartTreeItems(KICKSTART_TREE_PATH); + } + + public static void createKickstartTreeItems(File basePath) throws Exception { + //Alright setup things we need for trees + createDirIfNotExists(basePath); + KickstartableTree tree = new KickstartableTree(); + User user = UserTestUtils.findNewUser("testUser", "testOrg"); + tree.setChannel(ChannelTestUtils.createBaseChannel(user)); + tree.setBasePath(basePath.getAbsolutePath()); + tree.setOrg(user.getOrg()); + createKickstartTreeItems(tree); + } + + public static void createKickstartTreeItems(KickstartableTree tree) throws Exception { + createDirIfNotExists(new File(tree.getKernelPath()).getParentFile()); + createDirIfNotExists(new File(tree.getKernelXenPath()).getParentFile()); + + FileUtils.writeStringToFile("kernel", tree.getKernelPath()); + FileUtils.writeStringToFile("kernel-xen", tree.getKernelXenPath()); + + createDirIfNotExists(new File(tree.getInitrdPath()).getParentFile()); + createDirIfNotExists(new File(tree.getInitrdXenPath()).getParentFile()); + + FileUtils.writeStringToFile("initrd", tree.getInitrdPath()); + FileUtils.writeStringToFile("initrd-xen", tree.getInitrdXenPath()); + }
public void testKickstartableTree() throws Exception { KickstartableTree k = createTestKickstartableTree(); @@ -137,8 +171,6 @@ public class KickstartableTreeTest extends BaseTestCaseWithUser { */ public static KickstartableTree createTestKickstartableTree(Channel treeChannel) throws Exception { - - Date created = new Date(); Date modified = new Date(); Date lastmodified = new Date(); @@ -156,7 +188,7 @@ public class KickstartableTreeTest extends BaseTestCaseWithUser { k.setLabel("ks-" + treeChannel.getLabel() + RandomStringUtils.randomAlphanumeric(5));
- k.setBasePath("rhn/kickstart/" + k.getLabel()); + k.setBasePath(KICKSTART_TREE_PATH.getAbsolutePath()); k.setCreated(created); k.setModified(modified); k.setOrg(treeChannel.getOrg()); @@ -165,6 +197,8 @@ public class KickstartableTreeTest extends BaseTestCaseWithUser { k.setTreeType(treetype); k.setChannel(treeChannel);
+ createKickstartTreeItems(k); + Distro d = Distro.create(CobblerXMLRPCHelper.getConnection("test"), k.getLabel(), k.getKernelPath(), k.getInitrdPath(), new HashMap()); Distro xend = Distro.create(CobblerXMLRPCHelper.getConnection("test"), diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/tree/test/TreeActionTest.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/tree/test/TreeActionTest.java index 8cc5984..7ab9fa8 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/tree/test/TreeActionTest.java +++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/tree/test/TreeActionTest.java @@ -45,8 +45,6 @@ import java.util.List; */ public class TreeActionTest extends RhnMockStrutsTestCase {
- private static final String BASE_PATH = "http://rhn.redhat.com/somepath"; - public void testCreateNonSubmit() throws Exception { UserTestUtils.addUserRole(user, RoleFactory.CONFIG_ADMIN); UserTestUtils.addProvisioning(user.getOrg()); @@ -93,7 +91,8 @@ public class TreeActionTest extends RhnMockStrutsTestCase { // Set fields on the form to verify values are saved after a refresh: String ksDistLabel = "somelabel" + TestUtils.randomString(); addRequestParameter(TreeCreateAction.LABEL, ksDistLabel); - addRequestParameter(TreeCreateAction.BASE_PATH, BASE_PATH); + addRequestParameter(TreeCreateAction.BASE_PATH, + KickstartableTreeTest.KICKSTART_TREE_PATH.getAbsolutePath());
// Choose the RHEL 5 base channel so we can verify the package list is updated: addRequestParameter(TreeCreateAction.CHANNEL_ID, rhel5BaseChan.getId().toString()); @@ -102,7 +101,8 @@ public class TreeActionTest extends RhnMockStrutsTestCase {
// Verify that things are as they should be after a refresh: verifyFormValue(TreeCreateAction.LABEL, ksDistLabel); - verifyFormValue(TreeCreateAction.BASE_PATH, BASE_PATH); + verifyFormValue(TreeCreateAction.BASE_PATH, + KickstartableTreeTest.KICKSTART_TREE_PATH.getAbsolutePath()); verifyFormValue(TreeCreateAction.CHANNEL_ID, rhel5BaseChan.getId());
} @@ -203,7 +203,8 @@ public class TreeActionTest extends RhnMockStrutsTestCase {
addRequestParameter(RhnAction.SUBMITTED, Boolean.TRUE.toString()); setRequestPathInfo(path); - addRequestParameter(TreeCreateAction.BASE_PATH, BASE_PATH); + addRequestParameter(TreeCreateAction.BASE_PATH, + KickstartableTreeTest.KICKSTART_TREE_PATH.getAbsolutePath()); addRequestParameter(TreeCreateAction.CHANNEL_ID, c.getId().toString()); addRequestParameter(TreeCreateAction.LABEL, newLabel); diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/tree/test/KickstartTreeHandlerTest.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/tree/test/KickstartTreeHandlerTest.java index 6672255..09ba2f8 100644 --- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/tree/test/KickstartTreeHandlerTest.java +++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/tree/test/KickstartTreeHandlerTest.java @@ -27,6 +27,7 @@ import com.redhat.rhn.frontend.xmlrpc.kickstart.tree.KickstartTreeHandler; import com.redhat.rhn.frontend.xmlrpc.test.BaseHandlerTestCase; import com.redhat.rhn.testing.TestUtils;
+import java.io.File; import java.util.List;
/** @@ -67,7 +68,7 @@ public class KickstartTreeHandlerTest extends BaseHandlerTestCase { } Channel baseChan = ChannelFactoryTest.createTestChannel(admin); handler.create(adminKey, label, - "http://localhost/ks", + KickstartableTreeTest.KICKSTART_TREE_PATH.getAbsolutePath(), baseChan.getLabel(), KickstartInstallType.RHEL_5); assertTrue(origCount + 1 == KickstartFactory. lookupAccessibleTreesByOrg(admin.getOrg()).size()); @@ -77,9 +78,9 @@ public class KickstartTreeHandlerTest extends BaseHandlerTestCase { Channel baseChan = ChannelFactoryTest.createTestChannel(admin); KickstartableTree testTree = KickstartableTreeTest. createTestKickstartableTree(baseChan); - String newBase = "/tmp/new-base-path"; + String newBase = "/tmp/kickstart/new-base-path"; + KickstartableTreeTest.createKickstartTreeItems(new File(newBase)); Channel newChan = ChannelFactoryTest.createTestChannel(admin); - handler.update(adminKey, testTree.getLabel(), newBase, newChan.getLabel(), testTree.getInstallType().getLabel()); diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/test/KickstartWizardCommandTest.java b/java/code/src/com/redhat/rhn/manager/kickstart/test/KickstartWizardCommandTest.java index d158af0..e074ac1 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/test/KickstartWizardCommandTest.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/test/KickstartWizardCommandTest.java @@ -39,10 +39,10 @@ public class KickstartWizardCommandTest extends BaseTestCaseWithUser {
public void testWizTrees() throws Exception {
- Channel c = ChannelFactoryTest.createTestChannel(user); + Channel c = ChannelFactoryTest.createBaseChannel(user); assertNull(c.getParentChannel()); + assertNull(c.getOrg()); KickstartableTree tree = KickstartableTreeTest.createTestKickstartableTree(c); - tree.setOrg(null); tree.setChannel(c); TestUtils.saveAndFlush(tree); TestUtils.saveAndFlush(c); diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/tree/test/TreeEditOperationTest.java b/java/code/src/com/redhat/rhn/manager/kickstart/tree/test/TreeEditOperationTest.java index f10890c..284987a 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/tree/test/TreeEditOperationTest.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/tree/test/TreeEditOperationTest.java @@ -43,7 +43,7 @@ public class TreeEditOperationTest extends BaseTestCaseWithUser { KickstartableTree tree = KickstartableTreeTest. createTestKickstartableTree(ChannelFactoryTest.createTestChannel(user)); TreeEditOperation cmd = new TreeEditOperation(tree.getId(), user); - cmd.setBasePath("http://somepath.redhat.com/"); + cmd.setBasePath(KickstartableTreeTest.KICKSTART_TREE_PATH.getAbsolutePath()); assertNotNull(cmd.getTree()); String nlabel = "newlabel" + TestUtils.randomString(); cmd.setLabel(nlabel); @@ -58,7 +58,7 @@ public class TreeEditOperationTest extends BaseTestCaseWithUser { createTestKickstartableTree(ChannelFactoryTest.createTestChannel(user)); Long tid = tree.getId(); TreeEditOperation cmd = new TreeEditOperation(tid, user); - cmd.setBasePath("http://somepath.redhat.com/"); + cmd.setBasePath(KickstartableTreeTest.KICKSTART_TREE_PATH.getAbsolutePath()); assertNull(cmd.store()); flushAndEvict(cmd.getTree());
@@ -105,7 +105,7 @@ public class TreeEditOperationTest extends BaseTestCaseWithUser { private void setTreeParamsAndStore(BaseTreeEditOperation cmd) throws Exception { cmd.setInstallType(KickstartFactory. lookupKickstartInstallTypeByLabel("rhel_4")); - cmd.setBasePath("http://rhn.redhat.com/sometree"); + cmd.setBasePath(KickstartableTreeTest.KICKSTART_TREE_PATH.getAbsolutePath()); cmd.setChannel(ChannelFactoryTest.createTestChannel(user)); cmd.setLabel("some_label" + TestUtils.randomString()); assertNotNull(cmd.getUser()); diff --git a/java/code/src/com/redhat/rhn/testing/RhnBaseTestCase.java b/java/code/src/com/redhat/rhn/testing/RhnBaseTestCase.java index 42c7c8d..f4068b6 100644 --- a/java/code/src/com/redhat/rhn/testing/RhnBaseTestCase.java +++ b/java/code/src/com/redhat/rhn/testing/RhnBaseTestCase.java @@ -26,6 +26,8 @@ import org.apache.log4j.Logger; import org.hibernate.HibernateException; import org.hibernate.Session;
+import java.io.File; +import java.io.IOException; import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.text.DateFormat; @@ -266,5 +268,19 @@ public abstract class RhnBaseTestCase extends TestCase { log.setLevel(Level.ERROR); }
- + protected static void createDirIfNotExists(File dir) throws IOException { + String error = + "Could not create the following directory:[" + dir.getPath() + + "] . Please create that directory before proceeding with the tests"; + if (dir.exists() && !dir.isDirectory()) { + if (!dir.renameTo(new File(dir.getPath() + ".bak")) && + !dir.delete()) { + throw new RuntimeException(error); + } + } + + if (!dir.exists() && !dir.mkdirs()) { + throw new RuntimeException(error); + } + } }
commit e07bd38acd7742300cdbce9c49a77273bcbf6310 Author: Partha Aji paji@redhat.com Date: Sat Jul 18 00:42:59 2009 -0400
510785 - Handled an edge case where there are NO valid trees available in KS raw mode..
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/advanced/details.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/advanced/details.jspf index f813202..2c6f61c 100644 --- a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/advanced/details.jspf +++ b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/advanced/details.jspf @@ -122,7 +122,7 @@ <th><rhn:required-field key="kickstart.jsp.create.wizard.kstree.label"/>:</th> <td> <c:choose> - <c:when test="${notrees == null}"> + <c:when test="${empty notrees}"> <html:select property="kstreeId"> <html:optionsCollection property="kstrees" label="label" value="id" /> </html:select> @@ -133,15 +133,19 @@ </c:choose> </td> </tr> + </table> + <c:if test="${empty notrees}"> <div align="right"> - </table> - <hr /> + <hr /> + <html:submit property="dispatch"> <bean:message key="${param.action_key}"/> </html:submit> + </div> rhn:submitted/ <input type="hidden" name="ksid" value="${param.ksid}"/> + </c:if> </html:form> </c:when> </c:choose>
commit 5b88e84ef9c2101700433cbbf81e99383e855fa9 Author: Partha Aji paji@redhat.com Date: Fri Jul 17 23:49:39 2009 -0400
510785 - Major commit to deal with KS/Distro upgrade scenarios
This commit has a bunch of important changes 1) Concept of a "valid" Distro, implying one that has the right values for the initrd and kernel path. An example here will be cases where an external distro was specified but accidentally got deleted. So the UI and the cobbler records point to a non existent location.. This fix will put a X in the distros list marking the distro as invalid. All the profiles using this distro will also be marked invalid until the distro is either fixed or the profile's distro is changed.
2) Adds ability to neatly deal with profiles that have not yet been synced to cobbler. This is typically the be the upgrade scenario where the user might have the wrong paths on the distro so they never got created in cobbler and without a distro no profile can be created which implies the profiles didn;t themselves sync either. So in this case the UI will basically mark the profiles as invalid, No one will be able to schedule a KS off these profiles. In addition they will not be able to change any of the properties of a profile until the distro issue is resolved. Changes were made in the UI in both the Wizard and the Raw pages to reflect that.
Also removed several unused old methods...
diff --git a/java/code/src/com/redhat/rhn/common/security/acl/KickstartAclHandler.java b/java/code/src/com/redhat/rhn/common/security/acl/KickstartAclHandler.java index b1df18e..eebdf20 100644 --- a/java/code/src/com/redhat/rhn/common/security/acl/KickstartAclHandler.java +++ b/java/code/src/com/redhat/rhn/common/security/acl/KickstartAclHandler.java @@ -16,7 +16,11 @@ package com.redhat.rhn.common.security.acl;
import com.redhat.rhn.domain.kickstart.KickstartData; import com.redhat.rhn.domain.kickstart.KickstartFactory; +import com.redhat.rhn.domain.kickstart.KickstartableTree; import com.redhat.rhn.domain.user.User; +import com.redhat.rhn.frontend.struts.RequestContext; + +import org.apache.commons.lang.StringUtils;
import java.util.HashMap;
@@ -26,17 +30,8 @@ import java.util.HashMap; * @version $Rev$ */ public class KickstartAclHandler extends BaseHandler { - - public static final String USER = "user"; - public static final String KSID = "ksid"; - - - /* - * Sometimes we have a context where key "cid" is the cid-string (nav-xml) - * Sometimes, "cid" is an array of strings of len-1 where the -entry- is the - * cid-str (rhn:require) Sigh. - */ - protected KickstartData getKickstart(User usr, String[] params) { + private static final String USER = "user"; + private KickstartData getKickstart(User usr, String[] params) { String ksStr = params[0]; Long id = null; try { @@ -45,7 +40,7 @@ public class KickstartAclHandler extends BaseHandler { catch (NumberFormatException nfe) { return null; } - + if (id != null) { KickstartData ks = KickstartFactory.lookupKickstartDataByIdAndOrg( usr.getOrg(), id); @@ -55,7 +50,7 @@ public class KickstartAclHandler extends BaseHandler { return null; } } - + /** * Is the user allowed to administer the specified channel? * @param ctx request context (user,cid) @@ -90,7 +85,44 @@ public class KickstartAclHandler extends BaseHandler { return !ks.isRawData(); }
- - - + /** + * Returns true if the kickstart tree + * is synced to cobbler + * @param ctx request context (user,kstid) + * @param params check parameters + * @return true if the kickstart tree is synced + * to cobbler + */ + public boolean aclTreeIsSynced(Object ctx, String[] params) { + HashMap ctxMap = (HashMap)ctx; + User usr = (User)ctxMap.get(USER); + Long id = getAsLong(ctxMap.get(RequestContext.KSTREE_ID)); + if (id == null) { + return false; + } + KickstartableTree ks = KickstartFactory. + lookupKickstartTreeByIdAndOrg(id, usr.getOrg()); + return !StringUtils.isBlank(ks.getCobblerId()); + } + + /** + * Returns true if the kickstart profile + * is synced to cobbler and if the profile + * has a valid distribution + * @param ctx request context (user,kstid) + * @param params check parameters + * @return true if the kickstart profile is valid + * to cobbler + */ + public boolean aclProfileIsValid(Object ctx, String[] params) { + HashMap ctxMap = (HashMap)ctx; + User usr = (User)ctxMap.get(USER); + Long id = getAsLong(ctxMap.get(RequestContext.KICKSTART_ID)); + if (id == null) { + return false; + } + KickstartData ks = KickstartFactory. + lookupKickstartDataByIdAndOrg(usr.getOrg(), id); + return !StringUtils.isBlank(ks.getCobblerId()) && ks.getTree().isValid(); + } } diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartData.java b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartData.java index 61956b5..3324e5c 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartData.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartData.java @@ -1503,4 +1503,14 @@ public class KickstartData { } return Profile.lookupById(con, getCobblerId()); } + + /** + * Method to determine if the profile + * is valid or if it needs to be corrected. + * @return true if the profile is synced to cobbler + * and the distro it hosts is valid. + */ + public boolean isValid() { + return !StringUtils.isBlank(getCobblerId()) && getTree().isValid(); + } } diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java index 6d1019e..ae19e78 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java @@ -567,8 +567,9 @@ public class KickstartFactory extends HibernateFactory { setLong("org_id", org.getId().longValue()). list(); return retval; - } - + } + + /** * Fetch all trees for an org, these include * trees where org_id is null or org_id = org.id @@ -578,7 +579,7 @@ public class KickstartFactory extends HibernateFactory { public static List <KickstartableTree> lookupAccessibleTreesByOrg(Org org) { Session session = null; List retval = null; - String query = "KickstartableTree.findAccesibleToOrg"; + String query = "KickstartableTree.findAccessibleToOrg"; session = HibernateFactory.getSession(); retval = session.getNamedQuery(query). setLong("org_id", org.getId().longValue()) diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/AdvancedModeDetailsAction.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/AdvancedModeDetailsAction.java index 52a3b91..821eb6c 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/AdvancedModeDetailsAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/AdvancedModeDetailsAction.java @@ -18,6 +18,7 @@ package com.redhat.rhn.frontend.action.kickstart; import com.redhat.rhn.common.util.StringUtil; import com.redhat.rhn.common.validator.ValidatorException; import com.redhat.rhn.common.validator.ValidatorResult; +import com.redhat.rhn.domain.kickstart.KickstartData; import com.redhat.rhn.domain.kickstart.KickstartFactory; import com.redhat.rhn.domain.kickstart.KickstartRawData; import com.redhat.rhn.domain.kickstart.KickstartVirtualizationType; @@ -94,13 +95,44 @@ public class AdvancedModeDetailsAction extends RhnAction { if (!context.isSubmitted()) { setup(context, form); } + else if (!isCreateMode(request) && !getKsData(context).isValid()) { + return submitInvalid(context, form, mapping); + } else { return submit(context, form, mapping); }
return mapping.findForward(RhnHelper.DEFAULT_FORWARD); } - + private ActionForward submitInvalid(RequestContext context, + DynaActionForm form, ActionMapping mapping) { + try { + KickstartData data = getKsData(context); + User user = context.getLoggedInUser(); + KickstartBuilder builder = new KickstartBuilder(user); + KickstartWizardHelper cmd = new KickstartWizardHelper(user); + KickstartableTree tree = cmd.getKickstartableTree( + (Long)form.get(KSTREE_ID_PARAM)); + builder.update(data, data.getLabel(), tree, + data.getKickstartDefaults().getVirtualizationType().getLabel()); + return getStrutsDelegate().forwardParam(mapping.findForward("success"), + RequestContext.KICKSTART_ID, data.getId().toString()); + } + catch (ValidatorException ve) { + RhnValidationHelper.setFailedValidation(context.getRequest()); + getStrutsDelegate().saveMessages(context.getRequest(), ve.getResult()); + setup(context, form); + if (!isCreateMode(context.getRequest())) { + KickstartRawData ks = getKsData(context); + return getStrutsDelegate().forwardParam(mapping. + findForward(RhnHelper.DEFAULT_FORWARD), + RequestContext.KICKSTART_ID, + ks.getId().toString()); + } + return mapping.findForward(RhnHelper.DEFAULT_FORWARD); + } + } + private ActionForward submit(RequestContext context, DynaActionForm form, ActionMapping mapping) { try { @@ -156,6 +188,11 @@ public class AdvancedModeDetailsAction extends RhnAction { loadVirtualizationTypes(cmd, form, context); if (!isCreateMode(context.getRequest())) { KickstartRawData data = getKsData(context); + if (!data.isValid()) { + context.getRequest().setAttribute(KickstartDetailsEditAction.INVALID, + Boolean.TRUE); + return; + } form.set(KICKSTART_LABEL_PARAM, data.getLabel()); form.set(CONTENTS, data.getData()); KickstartFileDownloadCommand dcmd = new KickstartFileDownloadCommand( @@ -222,7 +259,7 @@ public class AdvancedModeDetailsAction extends RhnAction { return Boolean.TRUE.equals(request.getAttribute(CREATE_MODE)); }
- private void validateInput(DynaActionForm form, + private void validateInput(DynaActionForm form, RequestContext context) { String label = form.getString(KICKSTART_LABEL_PARAM); KickstartBuilder builder = new KickstartBuilder(context.getLoggedInUser()); diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java index fe3660e..d5783f7 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartDetailsEditAction.java @@ -77,7 +77,7 @@ public class KickstartDetailsEditAction extends BaseKickstartEditAction { public static final String VIRT_BRIDGE = "virt_bridge"; public static final String VIRT_PATH = "virt_disk_path";
- + public static final String INVALID = "invalid";
/** {@inheritDoc} */ public ActionForward execute(ActionMapping mapping, @@ -86,7 +86,6 @@ public class KickstartDetailsEditAction extends BaseKickstartEditAction { HttpServletResponse response) { RequestContext context = new RequestContext(request); KickstartData data = context.lookupAndBindKickstartData(); -
if (data.isRawData()) { return getStrutsDelegate().forwardParam( @@ -104,6 +103,11 @@ public class KickstartDetailsEditAction extends BaseKickstartEditAction { DynaActionForm form, BaseKickstartCommand cmdIn) { KickstartEditCommand cmd = (KickstartEditCommand) cmdIn; form.set(LABEL, cmd.getLabel()); + if (!cmdIn.getKickstartData().isValid()) { + ctx.getRequest().setAttribute(INVALID, Boolean.TRUE); + return; + } + form.set(COMMENTS, cmd.getComments()); form.set(ACTIVE, cmd.getActive()); form.set(ORG_DEFAULT, cmd.getKickstartData().isOrgDefault()); @@ -325,6 +329,5 @@ public class KickstartDetailsEditAction extends BaseKickstartEditAction { RhnValidationHelper.setFailedValidation(context.getRequest()); strutsDelegate.saveMessages(context.getRequest(), ve.getResult()); } - - } + } } diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/tree/TreeEditAction.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/tree/TreeEditAction.java index 9317622..e3ebe52 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/tree/TreeEditAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/tree/TreeEditAction.java @@ -14,15 +14,18 @@ */ package com.redhat.rhn.frontend.action.kickstart.tree;
+import com.redhat.rhn.common.validator.ValidatorException; +import com.redhat.rhn.common.validator.ValidatorResult; import com.redhat.rhn.frontend.struts.RequestContext; import com.redhat.rhn.manager.PersistOperation; -import com.redhat.rhn.manager.kickstart.cobbler.CobblerXMLRPCHelper; import com.redhat.rhn.manager.kickstart.tree.BaseTreeEditOperation; import com.redhat.rhn.manager.kickstart.tree.TreeEditOperation;
import org.apache.struts.action.DynaActionForm; import org.cobbler.Distro;
+import javax.servlet.http.HttpServletRequest; + /** * TreeEditAction * @version $Rev$ @@ -35,8 +38,10 @@ public class TreeEditAction extends BaseTreeAction { protected void processRequestAttributes(RequestContext rctx, PersistOperation opr) { BaseTreeEditOperation bte = (BaseTreeEditOperation) opr; rctx.getRequest().setAttribute(RequestContext.KSTREE, bte.getTree()); - super.processRequestAttributes(rctx, opr); + if (!rctx.isSubmitted()) { + checkDistroValidity(rctx.getRequest(), bte); + } }
/** @@ -69,13 +74,25 @@ public class TreeEditAction extends BaseTreeAction { form.set(CHANNEL_ID, bte.getTree().getChannel().getId()); form.set(LABEL, bte.getTree().getLabel()); form.set(INSTALL_TYPE, bte.getTree().getInstallType().getLabel()); - - - Distro distro = Distro.lookupById(CobblerXMLRPCHelper.getConnection( - bte.getUser()), bte.getTree().getCobblerId()); - form.set(KERNEL_OPTS, distro.getKernelOptionsString()); - form.set(POST_KERNEL_OPTS, distro.getKernelPostOptionsString()); - + Distro distro = bte.getTree().getCobblerObject(bte.getUser()); + if (distro != null) { + form.set(KERNEL_OPTS, distro.getKernelOptionsString()); + form.set(POST_KERNEL_OPTS, distro.getKernelPostOptionsString()); + } }
+ private void checkDistroValidity(HttpServletRequest request, + BaseTreeEditOperation bte) { + try { + bte.validateBasePath(); + if (!bte.getTree().isValid()) { + ValidatorResult result = new ValidatorResult(); + result.addError("tree.edit.invalid_tree"); + getStrutsDelegate().saveMessages(request, result); + } + } + catch (ValidatorException ve) { + getStrutsDelegate().saveMessages(request, ve.getResult()); + } + } } diff --git a/java/code/src/com/redhat/rhn/frontend/dto/kickstart/KickstartDto.java b/java/code/src/com/redhat/rhn/frontend/dto/kickstart/KickstartDto.java index 4c813ef..5d3bb30 100644 --- a/java/code/src/com/redhat/rhn/frontend/dto/kickstart/KickstartDto.java +++ b/java/code/src/com/redhat/rhn/frontend/dto/kickstart/KickstartDto.java @@ -25,7 +25,7 @@ import org.apache.commons.lang.StringUtils; * @version $Rev: 50942 $ */ public class KickstartDto extends BaseDto { - + private boolean valid; private Long id; private Long orgId; private Long kstreeId; @@ -258,4 +258,26 @@ public class KickstartDto extends BaseDto { public void setVirtBridge(String virtBridgeIn) { this.virtBridge = virtBridgeIn; } + + /** + * Checks if the profile is valid + * @return true if it is valid.. + */ + public boolean isValid() { + if (isCobbler()) { + return true; + } + if (StringUtils.isBlank(cobblerId)) { + return false; + } + return valid; + } + + /** + * true if the profile is valid + * @param isValid if the profile is valid + */ + public void setValid(boolean isValid) { + valid = isValid; + } } 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 e1e959c..a8952f6 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 @@ -6266,7 +6266,13 @@ Follow this url to see the full list of inactive systems: <context-group name="ctx"> <context context-type="sourcefile">/rhn/kickstart/Troubleshooting.do</context> </context-group> - </trans-unit> + </trans-unit> + <trans-unit id="tree.edit.invalid_tree"> + <source>Kickstart distributions is invalid due wrong or non existent base path to the kernel or initrd image. To make your custom distribution valid please select the distribution and modify its base path appropriately.</source> + <context-group name="ctx"> + <context context-type="sourcefile">/rhn/kickstart/TreeEdit.do</context> + </context-group> + </trans-unit>
<trans-unit id="kickstart.troubleshooting.validation.kernelparams.too_long"> <source>Extra kernel parameters can be no longer than 128 characters.</source> 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 ac272cd..aab7a1f 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 @@ -3038,7 +3038,6 @@ button below, and <b>will be unable to log back in</b>.</source> <context context-type="sourcefile">/rhn/schedule/PackageList</context> </context-group> </trans-unit> - schedu <trans-unit id="packagelist.jsp.nopackages"> <source>No packages.</source> <context-group name="ctx"> @@ -9863,6 +9862,33 @@ Please note that some manual configuration of these scripts may still be require <context context-type="sourcefile">/rhn/kickstart/KickstartDetailsEdit</context> </context-group> </trans-unit> + + <trans-unit id="kickstartdetails.invalid.jsp.summary"> + <source>The distribution associated to this kickstart profile is invalid. </source> + <context-group name="ctx"> + <context context-type="sourcefile">/rhn/kickstart/KickstartDetailsEdit</context> + </context-group> + </trans-unit> + + <trans-unit id="kickstartdetails.invalid.jsp.summary-option1"> + <source>To enable operations available to this kickstart profile, you may correct the distribution(<strong>{0}</strong>) by visiting the <a href = "{1}">Kickstart Distribution Details</a> page.</source> + <context-group name="ctx"> + <context context-type="sourcefile">/rhn/kickstart/KickstartDetailsEdit</context> + </context-group> + </trans-unit> + +<trans-unit id="kickstartdetails.invalid.jsp.summary-option2"> + <source> Alternatively you may associate a different distribution to this kickstart profile by visiting the <a href = "{0}">Kickstart Operating System Details</a> page.</source> + <context-group name="ctx"> + <context context-type="sourcefile">/rhn/kickstart/KickstartDetailsEdit</context> + </context-group> + </trans-unit> +<trans-unit id="kickstartdetails.advanced.invalid.jsp.summary-option2"> + <source> Alternatively you may associate a different distribution to this kickstart profile by selecting a distribution and choosing '{0}'.</source> + <context-group name="ctx"> + <context context-type="sourcefile">/rhn/kickstart/KickstartDetailsEdit</context> + </context-group> + </trans-unit> <trans-unit id="kickstartoptions.jsp.updatekickstart"> <source>Update Kickstart</source> <context-group name="ctx"> @@ -16455,16 +16481,22 @@ the <a href="/rhn/kickstart/ActivationKeysList.do?ksid={0}">Acti <trans-unit id="kickstart.distro.sw_managed.jsp"> <source>@@PRODUCT_NAME@@ Managed?*</source> <context-group name="ctx"> - <context context-type="sourcefile">/rhn/systems/details/kickstart/ScheduleWizard.do</context> + <context context-type="sourcefile">/rhn/kickstart/Kickstarts.do</context> </context-group> - </trans-unit> + </trans-unit> <trans-unit id="kickstart.distro.label.jsp"> <source>Distribution</source> <context-group name="ctx"> - <context context-type="sourcefile">/rhn/systems/details/kickstart/ScheduleWizard.do</context> + <context context-type="sourcefile">/rhn/kickstart/Kickstarts.do</context> </context-group> </trans-unit>
+ <trans-unit id="kickstarts.profile.is-valid.tooltip"> + <source>Kickstart profiles may be associated to an invalid kickstart distribution. To make a kickstart profile valid please select the profile and modify its distribution appropriately.</source> + <context-group name="ctx"> + <context context-type="sourcefile">/rhn/kickstart/Kickstarts.do</context> + </context-group> + </trans-unit> <!--KS schedule pages --> <group> <context-group name="ctx"> @@ -16796,7 +16828,7 @@ the <a href="/rhn/kickstart/ActivationKeysList.do?ksid={0}">Acti <source>Kickstart distributions may be invalid due wrong or non existent base path to the kernel or initrd image. To make your custom distribution valid please select the distribution and modify its base path appropriately.</source> </trans-unit> <trans-unit id="kickstart.distro.is-valid.jsp"> - <source>Valid?*</source> + <source>Valid</source> </trans-unit> </group>
@@ -20363,23 +20395,33 @@ given channel.</source> </trans-unit> <trans-unit id="docsearch.content"> <source>Content</source> + <context-group name="ctx"> <context context-type="sourcefile">/rhn/help/Search</context> + </context-group> </trans-unit> <trans-unit id="docsearch.free_form"> <source>Free Form</source> + <context-group name="ctx"> <context context-type="sourcefile">/rhn/help/Search</context> + </context-group> </trans-unit> <trans-unit id="docsearch.content_title"> <source>Content & Title</source> + <context-group name="ctx"> <context context-type="sourcefile">/rhn/help/Search</context> + </context-group> </trans-unit> <trans-unit id="docsearch.title"> <source>Title</source> + <context-group name="ctx"> <context context-type="sourcefile">/rhn/help/Search</context> + </context-group> </trans-unit> <trans-unit id="docsearch.jsp.summary"> <source>Summary</source> + <context-group name="ctx"> <context context-type="sourcefile">/rhn/help/Search</context> + </context-group> </trans-unit> <trans-unit id="docsearch.jsp.imgAlt"> <source>search</source> diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartDeleteCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartDeleteCommand.java index 07fd95f..58a4f08 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartDeleteCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartDeleteCommand.java @@ -19,6 +19,8 @@ import com.redhat.rhn.domain.kickstart.KickstartFactory; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.manager.kickstart.cobbler.CobblerProfileDeleteCommand;
+import org.apache.commons.lang.StringUtils; + /** * BaseKickstartDeleteCommand * @version $Rev$ @@ -43,12 +45,12 @@ public class KickstartDeleteCommand extends KickstartEditCommand { if (deleted == 0) { return new ValidatorError("kickstart.delete.error"); } - else { + else if (!StringUtils.isBlank(getKickstartData().getCobblerId())) { CobblerProfileDeleteCommand cmd = new CobblerProfileDeleteCommand(getKickstartData(), this.getUser()); cmd.store(); - return null; } + return null; }
} diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartEditCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartEditCommand.java index a695bb4..a0a45f5 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartEditCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartEditCommand.java @@ -288,8 +288,8 @@ public class KickstartEditCommand extends BaseKickstartCommand { * @return list of KickstartableTree instances */ public List getTrees(Long channelId, Org org) { - return KickstartFactory.lookupKickstartableTrees(channelId, - org); + return KickstartManager.getInstance(). + removeInvalid(KickstartFactory.lookupKickstartableTrees(channelId, org)); }
/** diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartLister.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartLister.java index 854956a..d12b01d 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartLister.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartLister.java @@ -18,6 +18,7 @@ import com.redhat.rhn.common.db.datasource.DataResult; import com.redhat.rhn.common.db.datasource.ModeFactory; import com.redhat.rhn.common.db.datasource.SelectMode; import com.redhat.rhn.domain.kickstart.KickstartFactory; +import com.redhat.rhn.domain.kickstart.KickstartableTree; import com.redhat.rhn.domain.org.Org; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.dto.ActivationKeyDto; @@ -88,11 +89,22 @@ public class KickstartLister extends BaseManager { Map params = new HashMap(); params.put("org_id", orgIn.getId()); Map elabParams = new HashMap(); - DataResult returnDataResult = makeDataResult(params, elabParams, pc, m); + DataResult<KickstartDto> returnDataResult = makeDataResult(params, + elabParams, pc, m); if (logger.isDebugEnabled()) { logger.debug("kickstartsInOrg(Org, PageControl) - end - return value=" + returnDataResult); } + + Set<Long> ids = new HashSet<Long>(); + List<KickstartableTree> trees = KickstartManager.getInstance(). + removeInvalid(KickstartFactory.lookupAccessibleTreesByOrg(orgIn)); + for (KickstartableTree tree : trees) { + ids.add(tree.getId()); + } + for (KickstartDto dto : returnDataResult) { + dto.setValid(ids.contains(dto.getKstreeId())); + } return returnDataResult; }
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java index bccc6ba..4d8a5f8 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartManager.java @@ -24,6 +24,7 @@ import com.redhat.rhn.common.validator.ValidatorException; import com.redhat.rhn.domain.kickstart.KickstartData; import com.redhat.rhn.domain.kickstart.KickstartFactory; import com.redhat.rhn.domain.kickstart.KickstartIpRange; +import com.redhat.rhn.domain.kickstart.KickstartableTree; import com.redhat.rhn.domain.org.Org; import com.redhat.rhn.domain.server.NetworkInterface; import com.redhat.rhn.domain.server.Server; @@ -35,6 +36,7 @@ import com.redhat.rhn.manager.BaseManager; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map;
@@ -88,10 +90,13 @@ public class KickstartManager extends BaseManager { */ public void validateKickstartFile(KickstartData ksdata) { try { - String text = renderKickstart(ksdata); - if (text.contains("Traceback (most recent call last):")) { - ValidatorException.raiseException("kickstart.jsp.error.template_generation", - KickstartUrlHelper.getFileDowloadPageUrl(ksdata)); + if (ksdata.isValid()) { + String text = renderKickstart(ksdata); + if (text.contains("Traceback (most recent call last):")) { + ValidatorException. + raiseException("kickstart.jsp.error.template_generation", + KickstartUrlHelper.getFileDowloadPageUrl(ksdata)); + } } } catch (DownloadException de) { @@ -195,5 +200,20 @@ public class KickstartManager extends BaseManager { }
- + /** + * Accept a list of trees and only return those + * that are valid, as in they pass the isValid method + * @param trees the input list + * @return List of KickstartableTree objects + */ + public List<KickstartableTree> removeInvalid(List<KickstartableTree> trees) { + List<KickstartableTree> ret = new LinkedList<KickstartableTree>(trees); + for (Iterator<KickstartableTree> itr = ret.iterator(); itr.hasNext();) { + KickstartableTree tree = itr.next(); + if (!tree.isValid()) { + itr.remove(); + } + } + return ret; + } } diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java index e312d8a..e10fbf6 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java @@ -26,7 +26,6 @@ import com.redhat.rhn.domain.kickstart.crypto.CryptoKey; import com.redhat.rhn.domain.rhnpackage.PackageFactory; import com.redhat.rhn.domain.rhnpackage.PackageName; import com.redhat.rhn.domain.user.User; -import com.redhat.rhn.manager.kickstart.cobbler.CobblerDistroCommand; import com.redhat.rhn.manager.kickstart.cobbler.CobblerProfileCreateCommand;
import org.apache.log4j.Logger; @@ -36,7 +35,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; -import java.util.Map; import java.util.Set;
/** @@ -62,7 +60,9 @@ public class KickstartWizardHelper { * @return list of KickstartableTrees */ public List getKickstartableTrees() { - return KickstartFactory.lookupAccessibleTreesByOrg(currentUser.getOrg()); + return KickstartManager.getInstance(). + removeInvalid(KickstartFactory. + lookupAccessibleTreesByOrg(currentUser.getOrg())); }
/** @@ -128,36 +128,11 @@ public class KickstartWizardHelper { * @param channelId base channel * @return list of KickstartableTree instances */ - public List getTrees(Long channelId) { - List trees = KickstartFactory.lookupKickstartableTrees(channelId, - currentUser.getOrg()); - // Now we filter out an - List retval = new LinkedList(); - CobblerDistroCommand cmd = new CobblerDistroCommand(currentUser); - - List<Map> distros = cmd.getCobblerDistros(); - for (int i = 0; i < trees.size(); i++) { - KickstartableTree tree = (KickstartableTree) trees.get(i); - boolean hasCobblerDistro = false; - for (Map row : distros) { - log.debug("getDistroMap.ROW: " + row); - String uid = (String) row.get("uid"); - if (uid.equals(tree.getCobblerId())) { - log.debug("tree [" + tree.getLabel() + - "] has a cobbler distro. Display it."); - hasCobblerDistro = true; - } - } - if (hasCobblerDistro) { - retval.add(tree); - } - else { - log.error("This Kickstart tree " + - "does not have an associated " + - "cobbler distro: " + tree.getLabel()); - } - } - return retval; + public List<KickstartableTree> getTrees(Long channelId) { + return KickstartManager.getInstance(). + removeInvalid(KickstartFactory. + lookupKickstartableTrees(channelId, + currentUser.getOrg())); }
/** diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerCommand.java index 2a8ebc0..bcd243e 100755 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerCommand.java @@ -24,15 +24,11 @@ import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.integration.IntegrationService; import com.redhat.rhn.frontend.xmlrpc.util.XMLRPCInvoker;
-import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.cobbler.CobblerConnection;
-import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.List; -import java.util.Map;
import redstone.xmlrpc.XmlRpcFault;
@@ -135,8 +131,6 @@ public abstract class CobblerCommand { org.getName().replace(' ', '-')); }
- - /** * Makes a local file path out of the cobbler name. * @@ -159,7 +153,6 @@ public abstract class CobblerCommand { return retval; }
- /** * Make a cobbler name for a kickstartable tree * @param tree the tree @@ -177,77 +170,7 @@ public abstract class CobblerCommand { public static String makeCobblerName(KickstartData data) { return makeCobblerName(data.getLabel(), data.getOrg()); } - - /** - * Lookup a cobbler distro based on UID (cobbler_id) - * or on name if UID isn't available. - * @param tree the tree/distro to get a cobbler version of - * @return the cobbler distro as a map - */ - public Map lookupCobblerDistro(KickstartableTree tree) { - - if (StringUtils.isBlank(tree.getCobblerId())) { - return (Map) invokeXMLRPC("get_distro", - CobblerCommand.makeCobblerName(tree)); - } - - List<Map> distros = getCobblerDistros(); - for (Map row : distros) { - log.debug("getDistroMap.ROW: " + row); - String uid = (String) row.get("uid"); - if (uid.equals(tree.getCobblerId())) { - return row; - } - } - return new HashMap(); - } - - /** - * Get the list of cobbler distro objects. - * @return List of cobbler distros - */ - public List<Map> getCobblerDistros() { - List<String> args = new ArrayList(); - args.add(xmlRpcToken); - List<Map> distros = (List) invokeXMLRPC("get_distros", args); - return distros; - } - - /** - * lookup the cobbler profile map based on UID - * or on name if cobbler_id isn't available - * @param data the ks profile to get a cobbler map of - * @return the profile in map form - */ - public Map lookupCobblerProfile(KickstartData data) { - if (StringUtils.isBlank(data.getCobblerId())) { - return (Map) invokeXMLRPC("get_profile", - CobblerCommand.makeCobblerName(data)); - } - return lookupCobblerProfileByUid(data.getCobblerId()); - } - - - /** - * Lookup cobbler profile by a UID - * @param uid the uid (or cobblerID) to pull the profile with - * @return a Map consisting of the Cobbler id - */ - public Map lookupCobblerProfileByUid(String uid) { - List <String> args = new ArrayList(); - args.add(xmlRpcToken); - List<Map> profiles = (List) invokeXMLRPC("get_profiles", args); - for (Map row : profiles) { - log.debug("getProfileMap.ROW: " + row + - " looking for: " + uid); - String id = (String) row.get("uid"); - if (id != null && id.equals(uid)) { - return row; - } - } - return new HashMap(); - } - + protected void invokeCobblerUpdate() { invokeXMLRPC("update", xmlRpcToken); } diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCommand.java index 6d378c7..6950ca3 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCommand.java @@ -63,15 +63,6 @@ public class CobblerDistroCommand extends CobblerCommand { }
/** - * Get the distribution associated with the current KickstartData - * @return Map of cobbler distro fields. - */ - public Map getDistroMap() { - log.debug("getDistroMap()"); - return lookupCobblerDistro(this.tree); - } - - /** * Copy cobbler fields that shouldn't change in cobbler */ protected void updateCobblerFields() { @@ -79,7 +70,6 @@ public class CobblerDistroCommand extends CobblerCommand { Distro nonXen = Distro.lookupById(con, tree.getCobblerId()); Distro xen = Distro.lookupById(con, tree.getCobblerXenId());
- Map ksmeta = new HashMap(); KickstartUrlHelper helper = new KickstartUrlHelper(this.tree); ksmeta.put(KickstartUrlHelper.COBBLER_MEDIA_VARIABLE, diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCreateCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCreateCommand.java index e7a2e39..e24207c 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCreateCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCreateCommand.java @@ -32,7 +32,7 @@ import java.util.Map; public class CobblerDistroCreateCommand extends CobblerDistroCommand {
private static Logger log = Logger.getLogger(CobblerDistroCreateCommand.class); - + private boolean syncProfiles; /** * Constructor * @param ksTreeIn to sync @@ -51,6 +51,20 @@ public class CobblerDistroCreateCommand extends CobblerDistroCommand { super(ksTreeIn, userIn); }
+ /** + * Constructor + * @param ksTreeIn to sync + * @param userIn - user wanting to sync with cobbler + * @param syncProfilesIn - true if you want the distro command + * to run a CobblerProfileSync + * when storing. + */ + public CobblerDistroCreateCommand(KickstartableTree ksTreeIn, + User userIn, boolean syncProfilesIn) { + this(ksTreeIn, userIn); + syncProfiles = syncProfilesIn; + } + /** * Save the Cobbler profile to cobbler. * @return ValidatorError if there was a problem @@ -79,6 +93,11 @@ public class CobblerDistroCreateCommand extends CobblerDistroCommand { tree.getInitrdXenPath(), ksmeta); tree.setCobblerXenId(distroXen.getUid()); } + + if (syncProfiles) { + CobblerProfileSyncCommand syncer = new CobblerProfileSyncCommand(); + syncer.store(); + } return null; }
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroDeleteCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroDeleteCommand.java index d3a23a1..9f58076 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroDeleteCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroDeleteCommand.java @@ -18,6 +18,7 @@ import com.redhat.rhn.common.validator.ValidatorError; import com.redhat.rhn.domain.kickstart.KickstartableTree; import com.redhat.rhn.domain.user.User;
+import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.cobbler.CobblerConnection; import org.cobbler.Distro; @@ -50,8 +51,12 @@ public class CobblerDistroDeleteCommand extends CobblerDistroCommand { */ @Override public ValidatorError store() { - CobblerConnection con = CobblerXMLRPCHelper.getConnection(user); + //Upgrade Scenario where a cobbler id will be null + if (StringUtils.isBlank(tree.getCobblerId())) { + return null; + }
+ CobblerConnection con = CobblerXMLRPCHelper.getConnection(user); Distro dis = Distro.lookupById(con, tree.getCobblerId());
if (dis == null) { diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileCommand.java index 5928490..6a7d25b 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileCommand.java @@ -67,16 +67,6 @@ public abstract class CobblerProfileCommand extends CobblerCommand { this.ksData = ksDataIn; }
- - /** - * Get the Cobbler profile associated with this KickstartData - * @return Map of Cobbler profile fields. - */ - public Map getProfileMap() { - return lookupCobblerProfile(this.ksData); - } - - protected void updateCobblerFields(Profile profile) { profile.setDistro(getDistroForKickstart()); if (kernelOptions != null) { diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileDeleteCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileDeleteCommand.java index 419e5b0..06d6311 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileDeleteCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileDeleteCommand.java @@ -19,8 +19,7 @@ import com.redhat.rhn.domain.kickstart.KickstartData; import com.redhat.rhn.domain.user.User;
import org.apache.log4j.Logger; - -import java.util.Map; +import org.cobbler.Profile;
/** * KickstartCobblerCommand - class to contain logic to communicate with cobbler @@ -48,16 +47,12 @@ public class CobblerProfileDeleteCommand extends CobblerProfileCommand { @Override public ValidatorError store() { // No need to delete if it doesnt exist in cobbler - Map profile = this.getProfileMap(); - if (profile == null || profile.isEmpty()) { + Profile profile = ksData.getCobblerObject(user); + if (profile == null) { log.warn("No cobbler profile associated with this Profile."); return null; } - - Boolean rc = (Boolean) invokeXMLRPC("remove_profile", - profile.get("name"), xmlRpcToken); - log.debug("RC: " + rc); - if (rc == null || !rc.booleanValue()) { + if (!profile.remove()) { return new ValidatorError("cobbler.profile.remove_failed"); } invokeCobblerUpdate(); diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileEditCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileEditCommand.java index c248128..f183653 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileEditCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileEditCommand.java @@ -18,6 +18,7 @@ import com.redhat.rhn.common.validator.ValidatorError; import com.redhat.rhn.domain.kickstart.KickstartData; import com.redhat.rhn.domain.user.User;
+import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.cobbler.Profile;
@@ -26,9 +27,6 @@ import org.cobbler.Profile; * @version $Rev$ */ public class CobblerProfileEditCommand extends CobblerProfileCommand { - - - private static Logger log = Logger.getLogger(CobblerProfileEditCommand.class);
/** @@ -45,7 +43,9 @@ public class CobblerProfileEditCommand extends CobblerProfileCommand { * {@inheritDoc} */ public ValidatorError store() { - log.debug("ProfileMap: " + this.getProfileMap()); + if (StringUtils.isBlank(ksData.getCobblerId())) { + return new CobblerProfileCreateCommand(ksData, user).store(); + }
String cobName = makeCobblerName(ksData);
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java index a1a70be..853dd7b 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java @@ -71,7 +71,7 @@ public class CobblerSystemCreateCommand extends CobblerCommand { this.server = serverIn; this.mediaPath = mediaPathIn; if (ksDataIn != null) { - profileName = (String)lookupCobblerProfile(ksDataIn).get("name"); + profileName = ksDataIn.getCobblerObject(user).getName(); } else { throw new NullPointerException("ksDataIn cant be null"); diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/test/CobblerCommandTest.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/test/CobblerCommandTest.java index 6983f77..37ab33d 100755 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/test/CobblerCommandTest.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/test/CobblerCommandTest.java @@ -36,8 +36,6 @@ import com.redhat.rhn.testing.ServerTestUtils; import com.redhat.rhn.testing.TestUtils; import com.redhat.rhn.testing.UserTestUtils;
-import java.util.Map; - /** * CobblerCommandTest */ @@ -94,9 +92,8 @@ public class CobblerCommandTest extends BaseTestCaseWithUser { CobblerProfileCreateCommand cmd = new CobblerProfileCreateCommand( ksdata, user); assertNull(cmd.store()); - Map profile = cmd.getProfileMap(); - assertNotNull(profile); - assertNotNull(profile.get("name")); + assertNotNull(ksdata.getCobblerObject(user)); + assertNotNull(ksdata.getCobblerObject(user).getName()); }
public void testProfileEdit() throws Exception { @@ -111,9 +108,7 @@ public class CobblerCommandTest extends BaseTestCaseWithUser { String newName = "some-new-name-" + System.currentTimeMillis(); ksdata.setLabel(newName); assertNull(pec.store()); - Map profile = pec.getProfileMap(); - String profileName = (String) profile.get("name"); - assertNotNull(profileName); + assertNotNull(ksdata.getCobblerObject(user).getName()); }
public void testProfileDelete() throws Exception { @@ -123,16 +118,16 @@ public class CobblerCommandTest extends BaseTestCaseWithUser {
CobblerProfileDeleteCommand cmd = new CobblerProfileDeleteCommand(ksdata, user); assertNull(cmd.store()); - assertTrue(cmd.getProfileMap().isEmpty()); + assertNull(ksdata.getCobblerObject(user)); }
public void testDistroCreate() throws Exception { CobblerDistroCreateCommand cmd = new CobblerDistroCreateCommand(ksdata.getTree(), user); assertNull(cmd.store()); - assertNotNull(cmd.getDistroMap()); - Map ksmeta = (Map) cmd.getDistroMap().get("ksmeta"); - assertNotNull(ksmeta.get(KickstartUrlHelper.COBBLER_MEDIA_VARIABLE)); + assertNotNull(ksdata.getTree().getCobblerObject(user)); + assertNotNull(ksdata.getTree().getCobblerObject(user). + getKsMeta().get(KickstartUrlHelper.COBBLER_MEDIA_VARIABLE)); }
@@ -148,9 +143,8 @@ public class CobblerCommandTest extends BaseTestCaseWithUser { String newName = TestUtils.randomString(); ksdata.getKickstartDefaults().getKstree().setLabel(newName); assertNull(cmd.store()); - Map distro = cmd.getDistroMap(); - String distroName = (String) distro.get("name"); - assertNotNull(distroName); + assertNotNull(ksdata.getTree().getCobblerObject(user)); + assertNotNull(ksdata.getTree().getCobblerObject(user).getName()); }
public void testLogin() throws Exception { diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/tree/BaseTreeEditOperation.java b/java/code/src/com/redhat/rhn/manager/kickstart/tree/BaseTreeEditOperation.java index 801a0d7..28f99ac 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/tree/BaseTreeEditOperation.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/tree/BaseTreeEditOperation.java @@ -16,6 +16,7 @@ package com.redhat.rhn.manager.kickstart.tree;
import com.redhat.rhn.common.hibernate.HibernateFactory; import com.redhat.rhn.common.validator.ValidatorError; +import com.redhat.rhn.common.validator.ValidatorException; import com.redhat.rhn.domain.channel.Channel; import com.redhat.rhn.domain.channel.ChannelFactory; import com.redhat.rhn.domain.channel.ChannelVersion; @@ -34,6 +35,7 @@ import com.redhat.rhn.manager.rhnpackage.PackageManager; import org.cobbler.Distro; import org.cobbler.XmlRpcException;
+import java.io.File; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -47,7 +49,8 @@ import java.util.regex.Pattern; * @version $Rev$ */ public abstract class BaseTreeEditOperation extends BasePersistOperation { - + private static final String INVALID_INITRD = "kickstart.tree.invalidinitrd"; + private static final String INVALID_KERNEL = "kickstart.tree.invalidkernel"; protected KickstartableTree tree; private static final String EMPTY_STRING = ""; public static final String KICKSTART_CAPABILITY = "rhn.kickstart.boot_image"; @@ -82,10 +85,18 @@ public abstract class BaseTreeEditOperation extends BasePersistOperation { return new ValidatorError("kickstart.tree.invalidlabel"); }
+ try { + validateBasePath(); + } + catch (ValidatorException ve) { + return ve.getResult().getErrors().get(0); + } + KickstartFactory.saveKickstartableTree(this.tree); // Sync to cobbler try { - getCobblerCommand().store(); + CobblerCommand command = getCobblerCommand(); + command.store();
Distro distro = Distro.lookupById(CobblerXMLRPCHelper.getConnection( this.getUser()), tree.getCobblerId()); @@ -93,37 +104,34 @@ public abstract class BaseTreeEditOperation extends BasePersistOperation { Map kOpts = distro.getKernelOptions(); distro.setKernelOptions(getKernelOptions()); distro.setKernelPostOptions(getPostKernelOptions()); - distro.save(); - - } catch (XmlRpcException xe) { HibernateFactory.rollbackTransaction(); if (xe.getCause().getMessage().contains("kernel not found")) { - return new ValidatorError("kickstart.tree.invalidkernel", + return new ValidatorError(INVALID_KERNEL, this.tree.getKernelPath()); } else if (xe.getCause().getMessage().contains("initrd not found")) { - return new ValidatorError("kickstart.tree.invalidinitrd", + return new ValidatorError(INVALID_INITRD, this.tree.getInitrdPath()); } else { - throw new RuntimeException(xe.getCause()); - } + throw new RuntimeException(xe.getCause()); + } } catch (Exception e) { HibernateFactory.rollbackTransaction(); if (e.getMessage().contains("kernel not found")) { - return new ValidatorError("kickstart.tree.invalidkernel", + return new ValidatorError(INVALID_KERNEL, this.tree.getKernelPath()); } else if (e.getMessage().contains("initrd not found")) { - return new ValidatorError("kickstart.tree.invalidinitrd", + return new ValidatorError(INVALID_INITRD, this.tree.getInitrdPath()); } else { - throw new RuntimeException(e); + throw new RuntimeException(e); }
} @@ -145,7 +153,21 @@ public abstract class BaseTreeEditOperation extends BasePersistOperation { return matcher.matches(); }
- + private void validatePathExists(String path, String key) { + if (!(new File(path).exists())) { + ValidatorException.raiseException(key, path); + } + } + /** + * Ensures that the base path is correctly setup.. + * As in the initrd and kernel structures are setup correctly. + * @throws ValidatorException if those paths don;t exist + */ + public void validateBasePath() throws ValidatorException { + validatePathExists(getTree().getInitrdPath(), INVALID_INITRD); + validatePathExists(getTree().getKernelPath(), INVALID_KERNEL); + } + /** * @return Returns the tree. */ diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/tree/TreeEditOperation.java b/java/code/src/com/redhat/rhn/manager/kickstart/tree/TreeEditOperation.java index 21b1757..0bf53d8 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/tree/TreeEditOperation.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/tree/TreeEditOperation.java @@ -17,8 +17,11 @@ package com.redhat.rhn.manager.kickstart.tree; import com.redhat.rhn.domain.kickstart.KickstartFactory; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.manager.kickstart.cobbler.CobblerCommand; +import com.redhat.rhn.manager.kickstart.cobbler.CobblerDistroCreateCommand; import com.redhat.rhn.manager.kickstart.cobbler.CobblerDistroEditCommand;
+import org.apache.commons.lang.StringUtils; + /** * TreeEditCommand to edit a KickstartableTree * @version $Rev$ @@ -59,6 +62,9 @@ public class TreeEditOperation extends BaseTreeEditOperation { * {@inheritDoc} */ protected CobblerCommand getCobblerCommand() { + if (StringUtils.isBlank(tree.getCobblerId())) { + return new CobblerDistroCreateCommand(tree, user, true); + } return new CobblerDistroEditCommand(this.tree, this.user); }
diff --git a/java/code/src/org/cobbler/test/MockConnection.java b/java/code/src/org/cobbler/test/MockConnection.java index 87e95bf..1c511b7 100644 --- a/java/code/src/org/cobbler/test/MockConnection.java +++ b/java/code/src/org/cobbler/test/MockConnection.java @@ -102,6 +102,10 @@ public class MockConnection extends CobblerConnection { return random(); }
+ if (name.startsWith("modify_") && "ksmeta".equals(args[1])) { + args[1] = "ks_meta"; + } + //profiles: if ("get_profiles".equals(name)) { return profiles; diff --git a/java/code/webapp/WEB-INF/nav/kickstart_details.xml b/java/code/webapp/WEB-INF/nav/kickstart_details.xml index 10478dc..d8783e2 100644 --- a/java/code/webapp/WEB-INF/nav/kickstart_details.xml +++ b/java/code/webapp/WEB-INF/nav/kickstart_details.xml @@ -1,64 +1,64 @@ <?xml version="1.0"?> <rhn-navi-tree label="kickstart_detail" invisible="1" formvar="ksid" title-depth="1" acl_mixins="com.redhat.rhn.common.security.acl.KickstartAclHandler"> - <rhn-tab name="Kickstart Details" > + <rhn-tab name="Kickstart Details" acl="user_role(config_admin)" > <rhn-tab-url>/rhn/kickstart/KickstartDetailsEdit.do</rhn-tab-url> <rhn-tab name="Details" > <rhn-tab-url>/rhn/kickstart/KickstartDetailsEdit.do</rhn-tab-url> <rhn-tab-url>/rhn/kickstart/KickstartClone.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="Operating System"> + <rhn-tab name="Operating System" acl="user_role(config_admin)"> <rhn-tab-url>/rhn/kickstart/KickstartSoftwareEdit.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="kickstart.variable.nav"> + <rhn-tab name="kickstart.variable.nav" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/EditVariables.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="Advanced Options"> + <rhn-tab name="Advanced Options" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/KickstartOptionsEdit.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="Bare Metal Kickstart"> + <rhn-tab name="Bare Metal Kickstart" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/KickstartIpRangeEdit.do</rhn-tab-url> </rhn-tab> </rhn-tab> - <rhn-tab name="System Details"> + <rhn-tab name="System Details" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/SystemDetailsEdit.do</rhn-tab-url> <rhn-tab name="Details"> <rhn-tab-url>/rhn/kickstart/SystemDetailsEdit.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="Locale"> + <rhn-tab name="Locale" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/Locale.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="Partitioning"> + <rhn-tab name="Partitioning" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/KickstartPartitionEdit.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="File Preservation"> + <rhn-tab name="File Preservation" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/KickstartFilePreservationLists.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="GPG_SSL"> + <rhn-tab name="GPG_SSL" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/KickstartCryptoKeysList.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="Troubleshooting"> + <rhn-tab name="Troubleshooting" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/Troubleshooting.do</rhn-tab-url> </rhn-tab> </rhn-tab> - <rhn-tab name="Software" > + <rhn-tab name="Software" acl="user_role(config_admin);profile_is_valid()" > <rhn-tab-url>/rhn/kickstart/KickstartPackagesEdit.do</rhn-tab-url> <rhn-tab name="Package Groups"> <rhn-tab-url>/rhn/kickstart/KickstartPackagesEdit.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="Package Profiles"> + <rhn-tab name="Package Profiles" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/KickstartPackageProfileEdit.do</rhn-tab-url> </rhn-tab> </rhn-tab> - <rhn-tab name="Activation Keys" > + <rhn-tab name="Activation Keys" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/ActivationKeysList.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="Scripts" > + <rhn-tab name="Scripts" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/Scripts.do</rhn-tab-url> <rhn-tab-url>/rhn/kickstart/KickstartScriptEdit.do</rhn-tab-url> <rhn-tab-url>/rhn/kickstart/KickstartScriptCreateEdit.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="Kickstart File" > + <rhn-tab name="Kickstart File" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/KickstartFileDownload.do</rhn-tab-url> </rhn-tab> </rhn-navi-tree> diff --git a/java/code/webapp/WEB-INF/nav/kickstart_raw_mode.xml b/java/code/webapp/WEB-INF/nav/kickstart_raw_mode.xml index ab5123a..6db783b 100644 --- a/java/code/webapp/WEB-INF/nav/kickstart_raw_mode.xml +++ b/java/code/webapp/WEB-INF/nav/kickstart_raw_mode.xml @@ -4,13 +4,13 @@ <rhn-tab name="Details" acl="user_role(config_admin)"> <rhn-tab-url>/rhn/kickstart/AdvancedModeEdit.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="Bare Metal Kickstart"> + <rhn-tab name="Bare Metal Kickstart" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/KickstartIpRangeEditAdvanced.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="kickstart.variable.nav" acl="user_role(config_admin)"> + <rhn-tab name="kickstart.variable.nav" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/EditVariables.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="Kickstart File" acl="user_role(config_admin)"> + <rhn-tab name="Kickstart File" acl="user_role(config_admin);profile_is_valid()"> <rhn-tab-url>/rhn/kickstart/KickstartFileDownloadAdvanced.do</rhn-tab-url> </rhn-tab>
diff --git a/java/code/webapp/WEB-INF/nav/kickstart_tree_details.xml b/java/code/webapp/WEB-INF/nav/kickstart_tree_details.xml index ba4f036..4c83ea7 100644 --- a/java/code/webapp/WEB-INF/nav/kickstart_tree_details.xml +++ b/java/code/webapp/WEB-INF/nav/kickstart_tree_details.xml @@ -1,10 +1,10 @@ <?xml version="1.0"?> <rhn-navi-tree label="kickstart_tree" invisible="1" formvar="kstid" title-depth="1" - acl_mixins="com.redhat.rhn.common.security.acl.ConfigAclHandler"> + acl_mixins="com.redhat.rhn.common.security.acl.ConfigAclHandler,com.redhat.rhn.common.security.acl.KickstartAclHandler"> <rhn-tab name="kickstart.tree.edit.nav" acl="user_role(config_admin)"> <rhn-tab-url>/rhn/kickstart/TreeEdit.do</rhn-tab-url> </rhn-tab> - <rhn-tab name="kickstart.variable.nav" acl="user_role(config_admin)"> + <rhn-tab name="kickstart.variable.nav" acl="user_role(config_admin); tree_is_synced()"> <rhn-tab-url>/rhn/kickstart/tree/EditVariables.do</rhn-tab-url> </rhn-tab> </rhn-navi-tree> diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/advanced/details.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/advanced/details.jspf index b334c36..f813202 100644 --- a/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/advanced/details.jspf +++ b/java/code/webapp/WEB-INF/pages/common/fragments/kickstart/advanced/details.jspf @@ -3,6 +3,8 @@ <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <%@ include file="/WEB-INF/pages/common/fragments/editarea.jspf" %> + <c:choose> + <c:when test="${empty requestScope.invalid}"> <html:form styleId="wizard-form" method="post" action="${param.url}" enctype="multipart/form-data"> @@ -104,4 +106,43 @@ <input type="hidden" name="ksid" value="${param.ksid}"/> </c:if> </div> - </html:form> \ No newline at end of file + </html:form> + </c:when> + <c:when test="${empty requestScope.create}"> + <p><bean:message key="kickstartdetails.invalid.jsp.summary"/> + <bean:message key="kickstartdetails.invalid.jsp.summary-option1" + arg0="${ksdata.tree.label}" + arg1="/rhn/kickstart/TreeEdit.do?kstid=${ksdata.tree.id}"/></p> + <p><bean:message key="kickstartdetails.advanced.invalid.jsp.summary-option2" + arg0="${rhn:localize(param.action_key)}"/></p> + + <html:form styleId="wizard-form" method="post" action="${param.url}"> + <table class="details"> + <tr> + <th><rhn:required-field key="kickstart.jsp.create.wizard.kstree.label"/>:</th> + <td> + <c:choose> + <c:when test="${notrees == null}"> + <html:select property="kstreeId"> + <html:optionsCollection property="kstrees" label="label" value="id" /> + </html:select> + </c:when> + <c:otherwise> + <b><bean:message key="kickstart.edit.software.notrees.jsp" /></b> + </c:otherwise> + </c:choose> + </td> + </tr> + <div align="right"> + </table> + <hr /> + <html:submit property="dispatch"> + <bean:message key="${param.action_key}"/> + </html:submit> + </div> + rhn:submitted/ + <input type="hidden" name="ksid" value="${param.ksid}"/> + </html:form> + </c:when> + </c:choose> + \ No newline at end of file diff --git a/java/code/webapp/WEB-INF/pages/kickstart/kickstartdetails.jsp b/java/code/webapp/WEB-INF/pages/kickstart/kickstartdetails.jsp index e8f40ae..a6ed6f4 100644 --- a/java/code/webapp/WEB-INF/pages/kickstart/kickstartdetails.jsp +++ b/java/code/webapp/WEB-INF/pages/kickstart/kickstartdetails.jsp @@ -12,16 +12,13 @@ renderer="com.redhat.rhn.frontend.nav.DialognavRenderer" />
<h2><bean:message key="kickstartdetails.jsp.header2"/></h2> - - - <div> +<c:choose><c:when test="${empty requestScope.invalid}"> <bean:message key="kickstartdetails.jsp.summary1"/> <html:form method="post" action="/kickstart/KickstartDetailsEdit.do"> <html:hidden property="ksid" value="${ksdata.id}"/> <html:hidden property="submitted" value="true"/> <table class="details"> - <tr> <th><rhn:required-field key="kickstartdetails.jsp.label"/>:</th> <td><html:text property="label" maxlength="64" size="32" /><br/> @@ -35,9 +32,6 @@
<%@ include file="/WEB-INF/pages/common/fragments/kickstart/virtoptions.jspf" %>
- - - <tr> <th><bean:message key="kickstartdetails.jsp.active"/></th> <td> @@ -89,6 +83,16 @@ </tr> </table> </html:form> + </c:when> + <c:otherwise> + <p><bean:message key="kickstartdetails.invalid.jsp.summary"/> + <bean:message key="kickstartdetails.invalid.jsp.summary-option1" + arg0="${ksdata.tree.label}" + arg1="/rhn/kickstart/TreeEdit.do?kstid=${ksdata.tree.id}"/></p> + <p><bean:message key="kickstartdetails.invalid.jsp.summary-option2" + arg0="/rhn/kickstart/KickstartSoftwareEdit.do?ksid=${ksdata.id}"/></p> + </c:otherwise> + </c:choose> </div>
</body> diff --git a/java/code/webapp/WEB-INF/pages/kickstart/kickstarts.jsp b/java/code/webapp/WEB-INF/pages/kickstart/kickstarts.jsp index 1afa501..de3f3f0 100644 --- a/java/code/webapp/WEB-INF/pages/kickstart/kickstarts.jsp +++ b/java/code/webapp/WEB-INF/pages/kickstart/kickstarts.jsp @@ -24,12 +24,9 @@ <rl:list dataset="pageList" name="ksList" emptykey="kickstart.jsp.nokickstarts" alphabarcolumn="label" filter="com.redhat.rhn.frontend.action.kickstart.KickstartProfileFilter"> - <rl:decorator name="ElaborationDecorator"/> <rl:decorator name="PageSizeDecorator"/> - - - <rl:column sortable="true" + <rl:column bound="false" headerkey="kickstart.jsp.label" sortattr="label" @@ -51,7 +48,7 @@ ** </c:if> </rl:column> - <rl:column sortable="true" bound="false" headerkey="kickstart.jsp.active" sortattr="active"> + <rl:column bound="false" headerkey="kickstart.jsp.active" sortattr="active"> <c:if test="${current.active}"> <img src="/img/rhn-listicon-ok.gif" alt="<bean:message key="kickstart.jsp.active"/>" title="<bean:message key="kickstart.jsp.active"/>"/> @@ -61,10 +58,10 @@ title="<bean:message key="kickstart.jsp.inactive"/>"/> </c:if> </rl:column> - <rl:column headerkey="kickstart.distro.label.jsp"> + <rl:column headerkey="kickstart.distro.label.jsp" sortattr="treeLabel"> <c:out value="${current.treeLabel}"/> </rl:column> - <rl:column headerkey="kickstart.distro.sw_managed.jsp" styleclass="last-column"> + <rl:column headerkey="kickstart.distro.sw_managed.jsp" sortattr="cobbler"> <c:choose> <c:when test="${current.cobbler}"> <img src="/img/rhn-listicon-error.gif"> @@ -74,6 +71,16 @@ </c:otherwise> </c:choose> </rl:column> + <rl:column headertext="${rhn:localize('kickstart.distro.is-valid.jsp')}?***" sortattr="valid" styleclass="last-column"> + <c:choose> + <c:when test="${current.valid}"> + <img src="/img/rhn-listicon-checked.gif"> + </c:when> + <c:otherwise> + <img src="/img/rhn-listicon-error.gif"> + </c:otherwise> + </c:choose> + </rl:column> </rl:list>
</rl:listset> @@ -82,6 +89,7 @@ <c:if test="${not empty requestScope.orgDefaultExists}"> <p>rhn:tooltip** - <bean:message key="kickstart.list.jsp.orgdefault"/></rhn:tooltip></p> </c:if> + <p>rhn:tooltip***-<bean:message key="kickstarts.profile.is-valid.tooltip"/></rhn:tooltip></p>
</body> </html:html> diff --git a/java/code/webapp/WEB-INF/pages/kickstart/kstrees.jsp b/java/code/webapp/WEB-INF/pages/kickstart/kstrees.jsp index 63e7530..c96e73d 100644 --- a/java/code/webapp/WEB-INF/pages/kickstart/kstrees.jsp +++ b/java/code/webapp/WEB-INF/pages/kickstart/kstrees.jsp @@ -37,7 +37,7 @@ <rl:column bound="false" headerkey="softwareedit.jsp.basechannel" sortattr="channel"> ${current.channel.name} </rl:column> - <rl:column headerkey="kickstart.distro.is-valid.jsp" sortattr="valid" styleclass="last-column"> + <rl:column headertext="${rhn:localize('kickstart.distro.is-valid.jsp')}?*" sortattr="valid" styleclass="last-column"> <c:choose> <c:when test="${current.valid}"> <img src="/img/rhn-listicon-checked.gif">
commit e5fc1fb0cc3f2031b76d133a083b00d75573dc00 Author: Shannon Hughes shughes@redhat.com Date: Fri Jul 17 11:58:10 2009 -0400
509409 - rewrote package file naming when pushed from proxy
diff --git a/java/code/src/com/redhat/rhn/domain/rhnpackage/Package.java b/java/code/src/com/redhat/rhn/domain/rhnpackage/Package.java index 1e884a6..feb20bd 100644 --- a/java/code/src/com/redhat/rhn/domain/rhnpackage/Package.java +++ b/java/code/src/com/redhat/rhn/domain/rhnpackage/Package.java @@ -14,6 +14,15 @@ */ package com.redhat.rhn.domain.rhnpackage;
+import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.builder.EqualsBuilder; +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.commons.lang.builder.ToStringBuilder; + import com.redhat.rhn.common.util.StringUtil; import com.redhat.rhn.domain.BaseDomainHelper; import com.redhat.rhn.domain.channel.Channel; @@ -22,15 +31,6 @@ import com.redhat.rhn.domain.errata.impl.UnpublishedErrata; import com.redhat.rhn.domain.org.Org; import com.redhat.rhn.domain.rpm.SourceRpm;
-import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang.builder.EqualsBuilder; -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.commons.lang.builder.ToStringBuilder; - -import java.util.Date; -import java.util.HashSet; -import java.util.Set; - /** * Package * @version $Rev$ @@ -662,9 +662,20 @@ public class Package extends BaseDomainHelper { public String getFilename() { String pkgFile = getFile(); if (pkgFile == null) { - pkgFile = getPackageName().getName() + "-" + getPackageEvr().getVersion() + - "-" + getPackageEvr().getRelease() + "." + - getPackageArch().getArchType().getLabel() + ".rpm"; + StringBuffer buf = new StringBuffer(); + buf.append(getPackageName().getName()); + buf.append("-"); + buf.append(getPackageEvr().getVersion()); + buf.append("-"); + buf.append(getPackageEvr().getRelease()); + buf.append("."); + if (getPackageEvr().getEpoch() != null) { + buf.append(getPackageEvr().getEpoch() + "."); + } + buf.append(getPackageArch().getLabel()); + buf.append("."); + buf.append(getPackageArch().getArchType().getLabel()); + pkgFile = buf.toString(); } return pkgFile; }
commit bc8bf56117970fba635eddc1d9dafb3074c80936 Author: Justin Sherrill jsherril@redhat.com Date: Thu Jul 16 18:04:24 2009 -0400
510785 - modifying query to now show profiles on provisioning schedule pages if the profiles cobbler id is null
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/General_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/General_queries.xml index 1c82147..6661e89 100644 --- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/General_queries.xml +++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/General_queries.xml @@ -52,6 +52,7 @@ ORDER BY UPPER(C.name) AND ( C.channel_arch_id = :prim_arch_id OR C.channel_arch_id = :sec_arch_id ) AND ( KVT.label != 'xenpv' OR KVT.label IS NULL) + AND KS.cobbler_id IS NOT NULL ORDER BY KS.label, KS.id </query> </mode> @@ -70,6 +71,7 @@ ORDER BY KS.label, KS.id AND ( C.channel_arch_id = :prim_arch_id OR C.channel_arch_id = :sec_arch_id ) AND KSD.virtualization_type = KVT.id AND KVT.label not in ('none','para_host') + AND KS.cobbler_id IS NOT NULL ORDER BY KS.label, KS.id </query> </mode>
commit 930cbb8741610c93f286221284b27a0ba74332f1 Author: Justin Sherrill jsherril@redhat.com Date: Thu Jul 16 16:55:24 2009 -0400
512224 - improving handling of invalid network interfaces when adding them to cobbler
diff --git a/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java b/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java index 8d68162..42dba00 100644 --- a/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java +++ b/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java @@ -15,7 +15,9 @@ package com.redhat.rhn.domain.server;
import com.redhat.rhn.domain.BaseDomainHelper; +import com.redhat.rhn.manager.kickstart.IpAddress;
+import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.builder.EqualsBuilder; import org.apache.commons.lang.builder.HashCodeBuilder;
@@ -184,4 +186,28 @@ public class NetworkInterface extends BaseDomainHelper implements }
+ private boolean isIpValid() { + try { + IpAddress ip = new IpAddress(this.getIpaddr()); + return true; + } + catch (Exception e) { + return false; + } + } + + private boolean isMacValid() { + return !(StringUtils.isEmpty(this.getHwaddr()) || + this.getHwaddr().equals("00:00:00:00:00:00") || + this.getHwaddr().equals("fe:ff:ff:ff:ff:ff")); + } + + /** + * Returns if this network interface is valid and should be used + * @return true if valid, else false + */ + public boolean isValid() { + return isIpValid() && isMacValid(); + } + } diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/IpAddress.java b/java/code/src/com/redhat/rhn/manager/kickstart/IpAddress.java index 8ced2c1..df59ccf 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/IpAddress.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/IpAddress.java @@ -42,6 +42,10 @@ public class IpAddress { */ public IpAddress(String ipIn) { this(); + if (StringUtils.isEmpty(ipIn)) { + throw new InvalidIpAddressException(StringUtils.defaultString(ipIn)); + } + String [] soctets = StringUtils.split(ipIn, "."); if (soctets.length == 4) { try { diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java index 721161d..a1a70be 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerSystemCreateCommand.java @@ -157,11 +157,7 @@ public class CobblerSystemCreateCommand extends CobblerCommand { List macs = new LinkedList(); for (NetworkInterface n : server.getNetworkInterfaces()) { // Skip localhost and non real interfaces - if (n.getHwaddr() == null || - n.getHwaddr().equals("00:00:00:00:00:00") || - n.getHwaddr().equals("fe:ff:ff:ff:ff:ff") || - n.getIpaddr() == null || - n.getIpaddr().equals("127.0.0.1")) { + if (!n.isValid()) { log.debug("Skipping. not a real interface"); } else { @@ -309,7 +305,7 @@ public class CobblerSystemCreateCommand extends CobblerCommand { Server serverIn) { Map inet = new HashMap(); for (NetworkInterface n : serverIn.getNetworkInterfaces()) { - if (!n.getHwaddr().equals("00:00:00:00:00:00")) { + if (n.isValid()) { inet.put("macaddress-" + n.getName(), n.getHwaddr()); if (!StringUtils.isBlank(n.getIpaddr())) { inet.put("ipaddress-" + n.getName(), n.getIpaddr());
commit 6e56af40b4e978897e808ece8e44e772c146d89c Author: Pradeep Kilambi pkilambi@redhat.com Date: Thu Jul 16 15:59:39 2009 -0400
Automatic commit of package [spacewalk-backend] release [0.6.19-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec index 91eaab6..8a7f5a4 100644 --- a/backend/spacewalk-backend.spec +++ b/backend/spacewalk-backend.spec @@ -7,7 +7,7 @@ Name: spacewalk-backend Summary: Common programs needed to be installed on the Spacewalk servers/proxies Group: Applications/Internet License: GPLv2 -Version: 0.6.18 +Version: 0.6.19 Release: 1%{?dist} URL: https://fedorahosted.org/spacewalk Source0: https://fedorahosted.org/releases/s/p/spacewalk/%%7Bname%7D-%%7Bversion%7D.t... @@ -568,6 +568,17 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$ %changelog +* Thu Jul 16 2009 Pradeep Kilambi pkilambi@redhat.com 0.6.19-1 +- 512236 - the org id checks were defaulting to None in custom channel cases + instead of 1. Also the metadata sting frommaster is a string None so we need + to check for the string. This should fix both custom and null org content in + iss case. hosted syncs should work as usual. (pkilambi@redhat.com) +- Return config channels sorted highest to lowest priority. + (dgoodwin@redhat.com) +- 511116 - changing updatePackages to change the permissions on the kickstart + trees in the same way we do for packages within /var/satellite + (jsherril@redhat.com) + * Fri Jul 10 2009 Pradeep Kilambi pkilambi@redhat.com 0.6.18-1 - If not commandline options given, compare the erratum channels to the already imported ones (pkilambi@redhat.com) diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend index 623b7fc..3ded2a7 100644 --- a/rel-eng/packages/spacewalk-backend +++ b/rel-eng/packages/spacewalk-backend @@ -1 +1 @@ -0.6.18-1 backend/ +0.6.19-1 backend/
commit 4e0e20335b3d6d4e38e09178ace3103e4cb8cf25 Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 16 21:57:30 2009 +0200
Automatic commit of package [spacewalk-schema] release [0.6.13-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema index da2ac22..4b9b8f3 100644 --- a/rel-eng/packages/spacewalk-schema +++ b/rel-eng/packages/spacewalk-schema @@ -1 +1 @@ -0.6.12-1 schema/spacewalk/ +0.6.13-1 schema/spacewalk/ diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec index e4e85b2..eac9ac9 100644 --- a/schema/spacewalk/spacewalk-schema.spec +++ b/schema/spacewalk/spacewalk-schema.spec @@ -2,7 +2,7 @@ Name: spacewalk-schema Group: Applications/Internet Summary: Oracle SQL schema for Spacewalk server
-Version: 0.6.12 +Version: 0.6.13 Release: 1%{?dist} Source0: %{name}-%{version}.tar.gz
@@ -52,6 +52,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man1/spacewalk-schema-upgrade*
%changelog +* Thu Jul 16 2009 Miroslav Suchy msuchy@redhat.com 0.6.13-1 +- 512104 - add sshbannerignore parametr to existing probes which use ssh + * Mon Jul 06 2009 John Matthews jmatthew@redhat.com 0.6.12-1 - 509029 - schema/upgrade - update the text used for action type = kickstart_guest.initiate (bbuckingham@redhat.com)
commit 692b8ce5844a0bdf48ee774bd77bacbcc0e780fd Author: Miroslav Suchý msuchy@redhat.com Date: Thu Jul 16 21:51:24 2009 +0200
512104 - add sshbannerignore parametr to existing probes which use ssh
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/124-rhn_probe_param_value.sql b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/124-rhn_probe_param_value.sql new file mode 100644 index 0000000..523c358 --- /dev/null +++ b/schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/124-rhn_probe_param_value.sql @@ -0,0 +1,27 @@ +DECLARE + type result_type is record ( + probe_id NUMBER, + command_id NUMBER + ); + one_row result_type; +BEGIN +FOR one_row IN ( + select probe_id, command_id from rhn_probe_param_value + where + command_id in (25, 26, 27, 28, 29, 30, 31, 99, 105, 106, 107, 109, 117, 118, 123, 226, 228, 230, 249, 274, 304) + group by probe_id, command_id + having (probe_id, command_id) not in ( + select probe_id, command_id from rhn_probe_param_value where + command_id in (25, 26, 27, 28, 29, 30, 31, 99, 105, 106, 107, 109, 117, 118, 123, 226, 228, 230, 249, 274, 304) + AND param_name = 'sshbannerignore' + ) + ) +LOOP + insert into rhn_probe_param_value + (probe_id, command_id, param_name, value, last_update_user, last_update_date) values + (one_row.probe_id, one_row.command_id, 'sshbannerignore', '0', 'upgrade', SYSDATE()); +END LOOP; +END; +/ + +commit;
commit 04255751b7dd516854f9679d3bb5285752b839c4 Author: Justin Sherrill jsherril@redhat.com Date: Thu Jul 16 15:51:11 2009 -0400
510785 - updating cobbler sync tasks to ignore kickstarts and trees when the tree is not able to be synced to cobbler
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroSyncCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroSyncCommand.java index dfbddd6..9174ea2 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroSyncCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroSyncCommand.java @@ -72,6 +72,12 @@ public class CobblerDistroSyncCommand extends CobblerCommand { List<KickstartableTree> unSynced = KickstartFactory.listUnsyncedKickstartTrees(); String err; for (KickstartableTree tree : unSynced) { + + if (!tree.isValid()) { + log.warn("Could not sync tree " + tree.getLabel()); + continue; + } + Distro distro = Distro.lookupByName( CobblerXMLRPCHelper.getAutomatedConnection(), tree.getCobblerDistroName()); diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileSyncCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileSyncCommand.java index 83edac3..a9f8b53 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileSyncCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerProfileSyncCommand.java @@ -75,8 +75,16 @@ public class CobblerProfileSyncCommand extends CobblerCommand { Map<String, Map> profileNames = getModifiedProfileNames(); for (KickstartData profile : profiles) { if (!profileNames.containsKey(profile.getCobblerId())) { - createProfile(profile); - profile.setModified(new Date()); + if (profile.getKickstartDefaults().getKstree().getCobblerId() != null) { + log.warn("Kickstart profile " + profile.getLabel() + + " could not be synced to cobbler, due to it's " + + "tree being unsynced. Please edit the tree url " + + "to correct this."); + } + else { + createProfile(profile); + profile.setModified(new Date()); + } } }
commit a507b500abb55acf19655b7df40b62c78dc94988 Author: Partha Aji paji@redhat.com Date: Thu Jul 16 15:27:06 2009 -0400
510299 - static ks fix.
Basically spacewalk koan did ifconfig $DEVICE | perl -lne '/Mask:([\d.]+)/ and print $1'" instead of "ifconfig %s | perl -lne '/Mask:([\d.]+)/ and print $1'" % device to determine the interface of the network we are interested .. This may give us wrong information on the ip address of the network interface we are interested on.
diff --git a/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py b/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py index b3f77ae..d5f7e50 100644 --- a/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py +++ b/client/tools/spacewalk-koan/spacewalkkoan/spacewalkkoan.py @@ -47,10 +47,10 @@ def find_host_name(): return execute("hostname")[0]
def find_netmask(device): - return execute("ifconfig $DEVICE | perl -lne '/Mask:([\d.]+)/ and print $1'")[0] + return execute("ifconfig %s | perl -lne '/Mask:([\d.]+)/ and print $1'" % device)[0]
def find_ip(device): - return execute("ifconfig $DEVICE | perl -lne '/inet addr:([\d.]+)/ and print $1'")[0] + return execute("ifconfig %s | perl -lne '/inet addr:([\d.]+)/ and print $1'" % device)[0]
def find_name_servers(): servers = execute("cat /etc/resolv.conf | perl -lne '/^nameserver\s+(\S+)$/ and print $1'")
commit 4e1aa66e133689bff5ad887d886f45b067069f76 Author: Pradeep Kilambi pkilambi@redhat.com Date: Thu Jul 16 15:20:07 2009 -0400
512236 - the org id checks were defaulting to None in custom channel cases instead of 1. Also the metadata sting frommaster is a string None so we need to check for the string. This should fix both custom and null org content in iss case. hosted syncs should work as usual.
diff --git a/backend/satellite_tools/satsync.py b/backend/satellite_tools/satsync.py index 6de2651..bf3cb63 100644 --- a/backend/satellite_tools/satsync.py +++ b/backend/satellite_tools/satsync.py @@ -874,7 +874,8 @@ Please contact your RHN representative""" % (generation, sat_cert.generation)) for t in nvrea_keys: nevra[t] = package[t] or ""
- if OPTIONS.orgid is not None: + if OPTIONS.orgid is not None and \ + package['org_id'] is not None: nevra['org_id'] = OPTIONS.orgid package['org_id'] = OPTIONS.orgid else: @@ -1442,7 +1443,8 @@ Please contact your RHN representative""" % (generation, sat_cert.generation)) for ks, timestamp in missing_kickstarts: ksobj = coll.get_item(ks, timestamp=timestamp) assert ksobj is not None - if OPTIONS.orgid is not None: + if OPTIONS.orgid is not None and \ + ksobj['org_id'] is not None: ksobj['org_id'] = OPTIONS.orgid batch.append(ksobj)
@@ -1690,8 +1692,6 @@ Please contact your RHN representative""" % (generation, sat_cert.generation)) uq_packages[pid] = package
uq_pkg_data = uq_packages.values() - # check to make sure the orgs exported are valid - _validate_package_org(uq_pkg_data) try: if OPTIONS.mount_point: importer = sync_handlers.link_channel_packages(uq_pkg_data, strict=0) @@ -1781,7 +1781,8 @@ Please contact your RHN representative""" % (generation, sat_cert.generation))
erratum['packages'] = packages
- if OPTIONS.orgid is not None: + if OPTIONS.orgid is not None and \ + erratum['org_id'] is not None: erratum['org_id'] = OPTIONS.orgid
# Now fix channels @@ -2023,13 +2024,15 @@ def _validate_package_org(batch): orgid = OPTIONS.orgid or None orgs = map(lambda a: a['id'], satCerts.get_all_orgs()) for pkg in batch: - if not OPTIONS.orgid and pkg['org_id'] is not None and \ - pkg['org_id'] not in orgs: - - pkg['org_id'] = 1 - else: + if not pkg['org_id'] or pkg['org_id'] == 'None': + # default to Null so do nothing + pkg['org_id'] = None + elif orgid: + # if options.orgid specified use it pkg['org_id'] = orgid - + elif pkg['org_id'] not in orgs: + # org from server is not valid + pkg['org_id'] = 1
def _getImportedChannels(): "Retrieves the channels already imported in the satellite's database"
commit 6ca26abc49d04ed905487732aa6734dca774d087 Author: Justin Sherrill jsherril@redhat.com Date: Thu Jul 16 14:19:20 2009 -0400
511963 - fixing issue where changing distro from non-para virt to paravirt would not update cobbler objects correctly (or vice-versa)
diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCommand.java b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCommand.java index aaeeff6..6d378c7 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCommand.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/cobbler/CobblerDistroCommand.java @@ -88,12 +88,31 @@ public class CobblerDistroCommand extends CobblerCommand { ksmeta.put("org", tree.getOrg().getId()); }
- if (xen != null) { - xen.setKernel(tree.getKernelXenPath()); - xen.setInitrd(tree.getInitrdXenPath()); - xen.setKsMeta(ksmeta); - xen.save(); + //if the newly edited tree does para virt.... + if (tree.doesParaVirt()) { + //IT does paravirt so we need to either update the xen distro or create one + if (xen == null) { + xen = Distro.create(con, tree.getCobblerXenDistroName(), + tree.getKernelXenPath(), tree.getInitrdXenPath(), ksmeta); + xen.save(); + tree.setCobblerXenId(xen.getId()); + } + else { + xen.setKernel(tree.getKernelXenPath()); + xen.setInitrd(tree.getInitrdXenPath()); + xen.setKsMeta(ksmeta); + xen.save(); + } + } + else { + //it doesn't do paravirt, so we need to delete the xen distro + if (xen != null) { + xen.remove(); + tree.setCobblerXenId(null); + } + } + if (nonXen != null) { nonXen.setInitrd(tree.getInitrdPath()); nonXen.setKernel(tree.getKernelPath()); diff --git a/java/code/src/org/cobbler/CobblerObject.java b/java/code/src/org/cobbler/CobblerObject.java index 588bafb..2e18e28 100644 --- a/java/code/src/org/cobbler/CobblerObject.java +++ b/java/code/src/org/cobbler/CobblerObject.java @@ -71,7 +71,9 @@ public abstract class CobblerObject { */ protected static Map<String, Object> lookupDataMapById(CobblerConnection client, String id, String findMethod) { - + if (id == null) { + return null; + } List<Map<String, Object>> objects = lookupDataMapsByCriteria(client, UID, id, findMethod); if (!objects.isEmpty()) {
commit 88fb9792edb765a9011a85f4a985ea6da3a69416 Author: Pradeep Kilambi pkilambi@redhat.com Date: Thu Jul 16 12:05:59 2009 -0400
adding disable_iss flag to rhn.conf
diff --git a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf index 1eed807..e1b3706 100644 --- a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf +++ b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf @@ -20,6 +20,12 @@ iss_ca_chain = /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT # allowed_iss_slaves=slave1-satellite.redhat.com,slave2-satellite.redhat.com allowed_iss_slaves=
+# Completely disable ISS. +# If set to 1, then no slave will be able to sync from this server +# this option does not affect ability to sync to this server from +# another spacewalk (or hosted). +disable_iss=0 + default_db = @@default_db@@
server.nls_lang = @@serverDOTnls_lang@@
commit fbae80186729b8edd725e68b872af6f87f096299 Author: Partha Aji paji@redhat.com Date: Wed Jul 15 18:54:25 2009 -0400
510785 - Initial stab on the Invalid KS Distro Base Path issue.
Added the concept of the a distro being 'invalid'. So if the cobbler id is null or the kernel or initrd of the distro points to an invalid location, the distro list page will show an error.
diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java index 8dd7d43..6d1019e 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartFactory.java @@ -570,14 +570,15 @@ public class KickstartFactory extends HibernateFactory { }
/** - * Fetch all trees for an org + * Fetch all trees for an org, these include + * trees where org_id is null or org_id = org.id * @param org owning org * @return list of KickstartableTrees */ - public static List <KickstartableTree> lookupKickstartTreesByOrg(Org org) { + public static List <KickstartableTree> lookupAccessibleTreesByOrg(Org org) { Session session = null; List retval = null; - String query = "KickstartableTree.findByOrg"; + String query = "KickstartableTree.findAccesibleToOrg"; session = HibernateFactory.getSession(); retval = session.getNamedQuery(query). setLong("org_id", org.getId().longValue()) @@ -585,6 +586,18 @@ public class KickstartFactory extends HibernateFactory { .setCacheable(true).list(); return retval; } + + /** + * Return a list of KickstartableTree objects in the Org + * @param org to lookup by + * @return List of KickstartableTree objects if found + */ + public static List<KickstartableTree> listTreesByOrg(Org org) { + Map<String, Object> params = new HashMap<String, Object>(); + params.put("org_id", org.getId()); + return singleton.listObjectsByNamedQuery( + "KickstartableTree.findByOrg", params, true); + }
/** * list all kickstart trees stored in the satellite @@ -594,11 +607,9 @@ public class KickstartFactory extends HibernateFactory { Session session = null; List retval = null; String query = "KickstartableTree.findAll"; - return singleton.listObjectsByNamedQuery(query, new HashMap()); + return singleton.listObjectsByNamedQuery(query, Collections.EMPTY_MAP, true); }
- - /** * Lookup KickstartableTree by tree id and org id * @param treeId desired tree @@ -868,19 +879,6 @@ public class KickstartFactory extends HibernateFactory { }
/** - * Lookup a list of KickstartData objects by the Org - * Useful for finding KickstartData objects that are in a org - * @param org to lookup by - * @return List of KickstartData objects if found - */ - public static List<KickstartData> listKickstartDataByOrg(Org org) { - Session session = getSession(); - Criteria c = session.createCriteria(KickstartData.class); - c.add(Restrictions.eq("org", org)); - return c.list(); - } - - /** * Lookup a list of all KickstartData objects located on the Satellite * Should not be used by much. Ignores org! * @return List of KickstartData objects if found @@ -900,7 +898,6 @@ public class KickstartFactory extends HibernateFactory { */ public static KickstartData lookupOrgDefault(Org org) { Session session = HibernateFactory.getSession(); - return (KickstartData) session .getNamedQuery("KickstartData.findOrgDefault") .setEntity("org", org) @@ -1025,6 +1022,4 @@ public class KickstartFactory extends HibernateFactory { Session session = HibernateFactory.getSession(); return (List<KickstartableTree>) session.getNamedQuery(query).list(); } - - } diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartableTree.hbm.xml b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartableTree.hbm.xml index 63f7b95..96b24e0 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartableTree.hbm.xml +++ b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartableTree.hbm.xml @@ -78,11 +78,14 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" order by k.label]]> </query>
- <query name="KickstartableTree.findByOrg"> + <query name="KickstartableTree.findAccessibleToOrg"> <![CDATA[from com.redhat.rhn.domain.kickstart.KickstartableTree as k where k.org = :org_id or k.org is null order by k.label]]> </query> - + <query name="KickstartableTree.findByOrg"> + <![CDATA[from com.redhat.rhn.domain.kickstart.KickstartableTree as k + where k.org.id = :org_id order by k.label]]> + </query> <query name="KickstartableTree.findAll"> <![CDATA[from com.redhat.rhn.domain.kickstart.KickstartableTree as k ]]> diff --git a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartableTree.java b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartableTree.java index d5c66bb..168a25f 100644 --- a/java/code/src/com/redhat/rhn/domain/kickstart/KickstartableTree.java +++ b/java/code/src/com/redhat/rhn/domain/kickstart/KickstartableTree.java @@ -385,4 +385,18 @@ public class KickstartableTree extends BaseDomainHelper { } return Distro.lookupById(con, getCobblerId()); } + + private boolean pathExists(String path) { + return new File(path).exists(); + } + + /** + * Returns true if both the kernel path and initrd paths exist + * and cobbler id is not null for this distribution. + * @return true if this is a valid distro. + */ + public boolean isValid() { + return !StringUtils.isBlank(getCobblerId()) && + pathExists(getInitrdPath()) && pathExists(getKernelPath()); + } } diff --git a/java/code/src/com/redhat/rhn/domain/org/OrgImpl.java b/java/code/src/com/redhat/rhn/domain/org/OrgImpl.java index 9af8606..a6660f1 100644 --- a/java/code/src/com/redhat/rhn/domain/org/OrgImpl.java +++ b/java/code/src/com/redhat/rhn/domain/org/OrgImpl.java @@ -654,12 +654,12 @@ public class OrgImpl extends BaseDomainHelper implements Org { return false; } final OrgImpl other = (OrgImpl) obj; - if (id == null) { - if (other.id != null) { + if (getId() == null) { + if (other.getId() != null) { return false; } } - else if (!id.equals(other.id)) { + else if (!getId().equals(other.getId())) { return false; } return true; @@ -672,7 +672,7 @@ public class OrgImpl extends BaseDomainHelper implements Org { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + ((id == null) ? 0 : id.hashCode()); + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); return result; } } diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/ViewTreesAction.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ViewTreesAction.java index f194596..bdc1e53 100644 --- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/ViewTreesAction.java +++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/ViewTreesAction.java @@ -14,22 +14,43 @@ */ package com.redhat.rhn.frontend.action.kickstart;
-import com.redhat.rhn.common.db.datasource.DataResult; -import com.redhat.rhn.frontend.listview.PageControl; -import com.redhat.rhn.frontend.struts.BaseListAction; +import com.redhat.rhn.domain.kickstart.KickstartFactory; import com.redhat.rhn.frontend.struts.RequestContext; -import com.redhat.rhn.manager.kickstart.KickstartLister; +import com.redhat.rhn.frontend.struts.RhnAction; +import com.redhat.rhn.frontend.struts.RhnHelper; +import com.redhat.rhn.frontend.taglibs.list.helper.ListHelper; +import com.redhat.rhn.frontend.taglibs.list.helper.Listable; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse;
/** * Handles listing of kickstart distributions * * @version $Rev $ */ -public class ViewTreesAction extends BaseListAction { - - protected DataResult getDataResult(RequestContext rctx, PageControl pc) { - return KickstartLister.getInstance().kickstartTreesInOrg( - rctx.getCurrentUser().getOrg(), pc); +public class ViewTreesAction extends RhnAction implements Listable { + /** + * ${@inheritDoc} + */ + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws Exception { + ListHelper helper = new ListHelper(this, request); + helper.execute(); + return mapping.findForward(RhnHelper.DEFAULT_FORWARD); + } + + /** + * {@inheritDoc} + */ + public List getResult(RequestContext contextIn) { + return KickstartFactory.listTreesByOrg(contextIn.getLoggedInUser().getOrg()); }
} 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 5ab91f4..ac272cd 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 @@ -16464,7 +16464,7 @@ the <a href="/rhn/kickstart/ActivationKeysList.do?ksid={0}">Acti <context context-type="sourcefile">/rhn/systems/details/kickstart/ScheduleWizard.do</context> </context-group> </trans-unit> - + <!--KS schedule pages --> <group> <context-group name="ctx"> @@ -16775,34 +16775,31 @@ the <a href="/rhn/kickstart/ActivationKeysList.do?ksid={0}">Acti <context context-type="sourcefile">/rhn/systems/details/kickstart/SessionCancel.do</context> </context-group> </trans-unit> - - <trans-unit id="kickstart.kickstartable_distributions.jsp"> - <source>Kickstartable Distributions</source> - <context-group name="ctx"> - <context context-type="sourcefile">/rhn/kickstart/ViewTrees.do</context> - </context-group> - </trans-unit> - - <trans-unit id="kickstart.kickstartable_distributions_text.jsp"> - <source>The following kickstart distributions are available.</source> - <context-group name="ctx"> - <context context-type="sourcefile">/rhn/kickstart/ViewTrees.do</context> - </context-group> - </trans-unit> - - <trans-unit id="kickstart.kickstartable_distro_create_new.jsp"> - <source>create new distribution</source> - <context-group name="ctx"> - <context context-type="sourcefile">/rhn/kickstart/ViewTrees.do</context> - </context-group> - </trans-unit> - - <trans-unit id="kickstart.distributions.jsp.nolists"> - <source>No kickstartable distributions available.</source> - <context-group name="ctx"> - <context context-type="sourcefile">/rhn/kickstart/ViewTrees.do</context> - </context-group> - </trans-unit> +<!-- KS Distributions List Page --> + <group> + <context-group name="ctx"> + <context context-type="sourcefile">/rhn/kickstart/ViewTrees.do</context> + </context-group> + <trans-unit id="kickstart.distributions.jsp.nolists"> + <source>No kickstartable distributions available.</source> + </trans-unit> + <trans-unit id="kickstart.kickstartable_distro_create_new.jsp"> + <source>create new distribution</source> + </trans-unit> + <trans-unit id="kickstart.kickstartable_distributions.jsp"> + <source>Kickstartable Distributions</source> + </trans-unit> + <trans-unit id="kickstart.kickstartable_distributions_text.jsp"> + <source>The following kickstart distributions are available.</source> + </trans-unit> + <trans-unit id="kickstarts.distro.is-valid.tooltip"> + <source>Kickstart distributions may be invalid due wrong or non existent base path to the kernel or initrd image. To make your custom distribution valid please select the distribution and modify its base path appropriately.</source> + </trans-unit> + <trans-unit id="kickstart.distro.is-valid.jsp"> + <source>Valid?*</source> + </trans-unit> + </group> + <trans-unit id="preferences.jsp.lang.bn_IN"> <source>Bengali</source> <context-group name="ctx"> 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 3587f3f..0a00a95 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 @@ -65,6 +65,7 @@ public class ColumnTag extends BodyTagSupport { */ public void setSortattr(String sortAttr) { sortAttribute = sortAttr; + sortable = true; }
/** diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/tree/test/KickstartTreeHandlerTest.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/tree/test/KickstartTreeHandlerTest.java index a686c59..6672255 100644 --- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/tree/test/KickstartTreeHandlerTest.java +++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/tree/test/KickstartTreeHandlerTest.java @@ -60,7 +60,7 @@ public class KickstartTreeHandlerTest extends BaseHandlerTestCase { public void testCreateKickstartableTree() throws Exception { String label = TestUtils.randomString(); List trees = KickstartFactory. - lookupKickstartTreesByOrg(admin.getOrg()); + lookupAccessibleTreesByOrg(admin.getOrg()); int origCount = 0; if (trees != null) { origCount = trees.size(); @@ -70,7 +70,7 @@ public class KickstartTreeHandlerTest extends BaseHandlerTestCase { "http://localhost/ks", baseChan.getLabel(), KickstartInstallType.RHEL_5); assertTrue(origCount + 1 == KickstartFactory. - lookupKickstartTreesByOrg(admin.getOrg()).size()); + lookupAccessibleTreesByOrg(admin.getOrg()).size()); }
public void testEditKickstartableTree() throws Exception { diff --git a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java index a0b1dd5..e312d8a 100644 --- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java +++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartWizardHelper.java @@ -62,7 +62,7 @@ public class KickstartWizardHelper { * @return list of KickstartableTrees */ public List getKickstartableTrees() { - return KickstartFactory.lookupKickstartTreesByOrg(currentUser.getOrg()); + return KickstartFactory.lookupAccessibleTreesByOrg(currentUser.getOrg()); }
/** diff --git a/java/code/webapp/WEB-INF/pages/kickstart/kstrees.jsp b/java/code/webapp/WEB-INF/pages/kickstart/kstrees.jsp index 3b7c025..63e7530 100644 --- a/java/code/webapp/WEB-INF/pages/kickstart/kstrees.jsp +++ b/java/code/webapp/WEB-INF/pages/kickstart/kstrees.jsp @@ -2,7 +2,7 @@ <%@ taglib uri="http://rhn.redhat.com/rhn" prefix="rhn" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> - +<%@ taglib uri="http://rhn.redhat.com/tags/list" prefix="rl" %> html:xhtml/ <html> <body> @@ -21,20 +21,35 @@ <bean:message key="kickstart.kickstartable_distributions_text.jsp" /> </p> <div> - <form name="distribForm" method="POST" action="/rhn/kickstart/ViewTrees.do"> - <c:set var="pageList" value="${requestScope.pageList}" /> - <rhn:list pageList="${requestScope.pageList}" noDataText="kickstart.distributions.jsp.nolists"> - <rhn:listdisplay renderDisabled="true" set="${requestScope.set}" hiddenvars="${requestScope.newset}"> - <rhn:column header="kickstart.jsp.label"> - <a href="/rhn/kickstart/TreeEdit.do?kstid=${current.id}">${current.kickstartlabel}</a> - </rhn:column> - <rhn:column header="softwareedit.jsp.basechannel"> - ${current.channellabel} - </rhn:column> - </rhn:listdisplay> - </rhn:list> - </form> - </div> + <rl:listset name="ksDistros"> + <rl:list emptykey="kickstart.distributions.jsp.nolists" + alphabarcolumn="label"> + <rl:decorator name="PageSizeDecorator"/> + <rl:column + bound="false" + headerkey="kickstart.jsp.label" + sortattr="label" + defaultsort="asc" + filterattr="label" + styleclass="first-column"> + <a href="/rhn/kickstart/TreeEdit.do?kstid=${current.id}">${current.label}</a> + </rl:column> + <rl:column bound="false" headerkey="softwareedit.jsp.basechannel" sortattr="channel"> + ${current.channel.name} + </rl:column> + <rl:column headerkey="kickstart.distro.is-valid.jsp" sortattr="valid" styleclass="last-column"> + <c:choose> + <c:when test="${current.valid}"> + <img src="/img/rhn-listicon-checked.gif"> + </c:when> + <c:otherwise> + <img src="/img/rhn-listicon-error.gif"> + </c:otherwise> + </c:choose> + </rl:column> + </rl:list> + </rl:listset> </div> + <p>rhn:tooltip*-<bean:message key="kickstarts.distro.is-valid.tooltip"/></rhn:tooltip></p> </body> </html>
commit cf1fe73d24335a4924d38ab748978bf6c5a6ae35 Author: Miroslav Suchý msuchy@redhat.com Date: Wed Jul 15 18:05:50 2009 +0200
Automatic commit of package [spacewalk-utils] release [0.6.5-1].
diff --git a/rel-eng/packages/spacewalk-utils b/rel-eng/packages/spacewalk-utils index cce442a..215f738 100644 --- a/rel-eng/packages/spacewalk-utils +++ b/rel-eng/packages/spacewalk-utils @@ -1 +1 @@ -0.6.4-1 utils/ +0.6.5-1 utils/ diff --git a/utils/spacewalk-utils.spec b/utils/spacewalk-utils.spec index 552f0cf..6c946db 100644 --- a/utils/spacewalk-utils.spec +++ b/utils/spacewalk-utils.spec @@ -1,7 +1,7 @@ %define rhnroot %{_prefix}/share/rhn
Name: spacewalk-utils -Version: 0.6.4 +Version: 0.6.5 Release: 1%{?dist} Summary: Utilities that may be run against a Spacewalk server.
@@ -54,6 +54,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog +* Wed Jul 15 2009 Miroslav Suchý msuchy@redhat.com 0.6.5-1 +- add spacewalk-api script, which can interact with API from command line + * Mon May 11 2009 Brad Buckingham bbuckingham@redhat.com 0.6.4-1 - 500173 - update migrate-system-profile to import scripts from utils vs spacewalk_tools (bbuckingham@redhat.com)
commit fe7fd7a22df8d7055b25aae5f82c742c88b5f1d6 Author: Miroslav Suchý msuchy@redhat.com Date: Wed Jul 15 18:02:17 2009 +0200
add spacewalk-api script, which can interact with API from command line
diff --git a/utils/Makefile b/utils/Makefile index b8cb8bf..fa6ceb0 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -7,12 +7,12 @@ NAME := spacewalk-utils SUBDIR = utils
FILES = __init__ systemSnapshot migrateSystemProfile -SCRIPTS = sw-system-snapshot migrate-system-profile +SCRIPTS = sw-system-snapshot migrate-system-profile spacewalk-api
DOCBOOK = $(wildcard /usr/bin/docbook2man)
SGMLS = $(wildcard *.sgml) -MANS = $(patsubst %.sgml,%.8,$(SGMLS)) +MANS = $(patsubst %.sgml,%.8,$(SGMLS) )
BINDIR = /usr/bin MANDIR ?= /usr/man @@ -29,8 +29,9 @@ install :: $(SCRIPTS) $(PREFIX)/$(BINDIR) ifneq ($(DOCBOOK),) # install man pages all :: $(MANS) + pod2man --section=8 spacewalk-api spacewalk-api.8 install :: $(MANS) $(PREFIX)/$(MANDIR) - $(INSTALL_DATA) $(MANS) $(PREFIX)/$(MANDIR)/man8 + $(INSTALL_DATA) $(MANS) spacewalk-api.8* $(PREFIX)/$(MANDIR)/man8 endif
%.new : % diff --git a/utils/spacewalk-api b/utils/spacewalk-api new file mode 100644 index 0000000..6abb41c --- /dev/null +++ b/utils/spacewalk-api @@ -0,0 +1,142 @@ +#!/usr/bin/perl +use strict; +# +# Copyright (c) 2009 Red Hat, Inc. +# +# This software is licensed to you under the GNU General Public License, +# version 2 (GPLv2). There is NO WARRANTY for this software, express or +# implied, including the implied warranties of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 +# along with this software; if not, see +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. +# +# Red Hat trademarks are not licensed under GPLv2. No permission is +# granted to use or replicate Red Hat trademarks that are incorporated +# in this software or its documentation. +# + +use Data::Dumper; +use Getopt::Long; +use Frontier::Client; +use Term::ReadKey; + +#set defaults; +my ($server, $user, $password)= ('', '', ''); +my $login=1; + +GetOptions("server=s" => $server, + "login!" => $login, + "user:s" => $user, + "password:s" => $password, + ); + +if (not $server) { + print "Error: No server specified.\n"; + exit 1; +} + +# read username if not given on command line +if ((not $user) and $login) { + print "Enter username: "; + $user = ReadLine 0; + chomp $user; + print "\n"; +} + +# read password if not given on command line +if ((not $password) and $login) { + print "Enter your password: "; + ReadMode 'noecho'; + $password = ReadLine 0; + chomp $password; + ReadMode 'normal'; + print "\n"; +} + +my $client = new Frontier::Client(url => "http://$server/rpc/api"); + +my $session; +if ($login) { + $session = $client->call('auth.login', $user, $password); + if (not $session) { + print "Error: Log in failed.\n"; + exit 2; + } +} + +my @params; +while (my $param = shift @ARGV) { + if ($param eq '%session%') { + $param = $session; + } elsif ( $param =~ '%file:(.*)%') { + open F, $1 or die "Error: Could not open $1"; + $param = join('', <F>); + close F; + } + push @params, $param; +} + +my $data = $client->call(@params); + +print Data::Dumper->Dump([$data], ["result"]); + +if ($login) { + $client->call('auth.logout', $session); +} + +=pod + +=head1 NAME + +spacewalk-api - Call Spacawalk API from command line. + +=head1 SYNOPSIS + +spacewalk-api [OPTIONS] --server=spacewalk.domain.com FUNCTION [PARAM1 PARAM2 ...] + +=head1 DESCRIPTION + +spacewalk-api interact with the Spacewalk server and expose its API layer. + +FUNCTION is api method you wish to call and is followed by its parameters. +There is few special substitution available: + +%session% + Is replaced with sessionid. If you use --nologin option, then it is replaced by empty string. + +%file:/some/file% + Is replaced by content of given file. + +=head1 OPTIONS + +--server + URL of your Spacewalk server. + +--login +--nologin + If we should log in or not. Default is to log in. + +--user + Name of user to log in. + +--password + If you do not specify this and unless --nologin is specified, you will be prompted for your password. + +=head1 EXAMPLES + + spacewalk-api --server=spacewalk.com --nologin api.systemVersion + + spacewalk-api --server=spacewalk.com --user=foo --password=bar channel.listAllChannels "%session%" + + spacewalk-api --server=spacewalk.com --nologin proxy.isProxy '%file:/etc/sysconfig/rhn/systemid%' + +=head1 AUTHOR + +Miroslav Suchý msuchy@redhat.com + +=head1 COPYRIGHT AND LICENSE + +Copyright (c) 2009 Red Hat, Inc. +Released under GNU General Public License, version 2 (GPLv2). + +=cut diff --git a/utils/spacewalk-utils.spec b/utils/spacewalk-utils.spec index a4a79bd..552f0cf 100644 --- a/utils/spacewalk-utils.spec +++ b/utils/spacewalk-utils.spec @@ -16,6 +16,7 @@ BuildRequires: /usr/bin/docbook2man BuildRequires: docbook-utils
Requires: python, rpm-python +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
%description Generic utilities that may be run against a Spacewalk server. This package @@ -44,14 +45,12 @@ rm -rf $RPM_BUILD_ROOT
%files %defattr(-,root,root) -%attr(755,root,root) %{_bindir}/sw-system-snapshot -%attr(755,root,root) %{_bindir}/migrate-system-profile +%attr(755,root,root) %{_bindir}/* %dir %{rhnroot}/utils %{rhnroot}/utils/__init__.py* %{rhnroot}/utils/systemSnapshot.py* %{rhnroot}/utils/migrateSystemProfile.py* -%{_mandir}/man8/sw-system-snapshot.8* -%{_mandir}/man8/migrate-system-profile.8* +%{_mandir}/man8/*
%changelog
commit 7e029cca2dd724b92cf8da00789a52875dc0fe20 Author: Milan Zazrivec mzazrivec@redhat.com Date: Wed Jul 15 08:29:49 2009 +0200
511377 - insert 'i86pc' row only if it doesn't exist
This row may already be present in the schema from a previous satellite-sync.
diff --git a/schema/spacewalk/upgrade/spacewalk-0.2-spacewalk-0.3/100-rhnCpuArch-i86pc.sql b/schema/spacewalk/upgrade/spacewalk-0.2-spacewalk-0.3/100-rhnCpuArch-i86pc.sql index 509fc4b..8ab903b 100644 --- a/schema/spacewalk/upgrade/spacewalk-0.2-spacewalk-0.3/100-rhnCpuArch-i86pc.sql +++ b/schema/spacewalk/upgrade/spacewalk-0.2-spacewalk-0.3/100-rhnCpuArch-i86pc.sql @@ -1,4 +1,9 @@ - -insert into rhnCpuArch (id, label, name) values -(rhn_cpu_arch_id_seq.nextval, 'i86pc', 'i86pc'); +insert into rhnCpuArch (id, label, name) ( + select rhn_cpu_arch_id_seq.nextval, 'i86pc', 'i86pc' + from dual + where not exists ( + select 1 + from rhnCpuArch + where label = 'i86pc' and name = 'i86pc') +);
commit 3b88d929f09a44f11df89409d2920b55c4312022 Author: Brad Buckingham bbuckingham@redhat.com Date: Tue Jul 14 19:10:45 2009 -0400
rhn-load-config.pl - remove accidental 's'
diff --git a/spacewalk/setup/share/upgrade/rhn-load-config.pl b/spacewalk/setup/share/upgrade/rhn-load-config.pl index 5ea4fb6..93df00e 100755 --- a/spacewalk/setup/share/upgrade/rhn-load-config.pl +++ b/spacewalk/setup/share/upgrade/rhn-load-config.pl @@ -122,7 +122,7 @@ RHN::SatInstall->write_config(%config_opts,
Spacewalk::Setup::satcon_deploy(); -s + print "Done\n";
exit 0;
commit 9a04a11541e09092ee74322ab9b2a480ba6c8056 Author: Partha Aji paji@redhat.com Date: Tue Jul 14 17:54:12 2009 -0400
511100 - Fixed upgrade scripts to include cobbler.host
diff --git a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf index b7a2e16..1eed807 100644 --- a/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf +++ b/spacewalk/config/etc/sysconfig/rhn-satellite-prep/etc/rhn/rhn.conf @@ -88,3 +88,6 @@ web.force_unentitlement=0
# system snapshots enabled enable_snapshots = 1 + +#cobbler host name +cobbler.host = @@cobblerDOThost@@ diff --git a/spacewalk/config/satellite-rules.conf b/spacewalk/config/satellite-rules.conf index e68ccc7..dea21ff 100644 --- a/spacewalk/config/satellite-rules.conf +++ b/spacewalk/config/satellite-rules.conf @@ -101,4 +101,6 @@ webDOTis_monitoring_scout= # line 45 serverDOTnls_lang[prompt]=Enter a value for serverDOTnls_lang serverDOTnls_lang=english.UTF8 - +#line 46 +cobblerDOThost[prompt]=Enter a value for cobblerDOThost +cobblerDOThost= diff --git a/spacewalk/setup/bin/spacewalk-setup b/spacewalk/setup/bin/spacewalk-setup index 7285b45..7a00825 100755 --- a/spacewalk/setup/bin/spacewalk-setup +++ b/spacewalk/setup/bin/spacewalk-setup @@ -983,6 +983,7 @@ sub populate_initial_configs { monitoringDOTorahome => '/opt/oracle', monitoringDOTdbd => 'Oracle', monitoringDOTscout_shared_key => '', # blank for now. + cobblerDOThost => $answers->{hostname} );
for ($config_opts{'db_password'}) { diff --git a/spacewalk/setup/share/upgrade/rhn-load-config.pl b/spacewalk/setup/share/upgrade/rhn-load-config.pl old mode 100644 new mode 100755 index 2d2535f..5ea4fb6 --- a/spacewalk/setup/share/upgrade/rhn-load-config.pl +++ b/spacewalk/setup/share/upgrade/rhn-load-config.pl @@ -115,16 +115,14 @@ if ($already_monitoring) {
my %nls_database_paramaters = RHN::SatInstall->get_nls_database_parameters(); $config_opts{serverDOTnls_lang} = 'english.' . $nls_database_paramaters{NLS_CHARACTERSET}; - +$config_opts{cobblerDOThost} = Sys::Hostname::hostname; print "Writing configuration\n"; - - RHN::SatInstall->write_config(%config_opts, '/etc/sysconfig/rhn-satellite-prep/satellite-local-rules.conf');
Spacewalk::Setup::satcon_deploy(); - +s print "Done\n";
exit 0;
commit 22d042ad3421c0f068981a9353fb606127133049 Author: Milan Zazrivec mzazrivec@redhat.com Date: Tue Jul 14 21:57:21 2009 +0200
511052 - script to fix rhn_sat_node, rhn_sat_cluster
This script sets rhn_sat_node.ip and rhn_sat_cluster.vip for satellite monitoring scout to IP address of your satellite if set to 127.0.0.1 by previous installation. This script is to be used during satellite upgrade.
diff --git a/spacewalk/setup/share/upgrade/rhn-update-monitoring.pl b/spacewalk/setup/share/upgrade/rhn-update-monitoring.pl new file mode 100755 index 0000000..2679760 --- /dev/null +++ b/spacewalk/setup/share/upgrade/rhn-update-monitoring.pl @@ -0,0 +1,65 @@ +#!/usr/bin/perl + +# This script fixes monitoring problem described in bug #511052 +# Earlier Satellites (3.7) set rhn_sat_node.ip and rhn_sat_cluster.vip +# to '127.0.0.1' during installation / monitoring activation. These +# values need to be set to ip address of satellite for MonitoringAccessHandler.pm +# to operate properly. + +use strict; +use warnings; + +use Sys::Hostname; +use RHN::SatInstall; +use RHN::Utils; +use RHN::DataSource::Simple; + +my $org_id = RHN::SatInstall->get_satellite_org_id(); +my $db_connect = RHN::SatInstall->test_db_connection(); +die "Could not connect to the database" unless $db_connect; + +my $ds = new RHN::DataSource::Simple(-querybase => "scout_queries", + -mode => 'scouts_for_org'); +my $data = $ds->execute_query(-org_id => $org_id); +my ($scout) = grep { not $_->{SERVER_ID} } @{$data}; + +exit 0 unless $scout; + +my ($ip, $vip) = ($scout->{IP}, $scout->{VIP}); +my ($sn_id, $sc_id) = ($scout->{SAT_NODE_ID}, $scout->{ID}); + +if ($ip eq '127.0.0.1' or $vip eq '127.0.0.1') { + my $hostname = Sys::Hostname::hostname; + my $ip_addr = RHN::Utils::find_ip_address($hostname); + + my $dbh = RHN::DB->connect; + + my $sql1 = q{ + update rhn_sat_node + set ip = :ip, + last_update_user = 'upgrade', + last_update_date = sysdate + where ip = '127.0.0.1' and + recid = :recid + }; + my $sql2 = q{ + update rhn_sat_cluster + set vip = :vip, + last_update_user = 'upgrade', + last_update_date = sysdate + where vip = '127.0.0.1' and + recid = :recid + }; + + $dbh->do_h($sql1, + ip => $ip_addr, + recid => $sn_id, + ); + $dbh->do_h($sql2, + vip => $ip_addr, + recid => $sc_id, + ); + $dbh->commit; +} + +1;
commit b40b1b03df90eb8773c971b3e6fd8e929483a2e7 Author: Pradeep Kilambi pkilambi@redhat.com Date: Tue Jul 14 12:28:34 2009 -0400
Adding back custom check removed for debugging
diff --git a/java/code/src/com/redhat/rhn/domain/channel/Channel.java b/java/code/src/com/redhat/rhn/domain/channel/Channel.java index adc17c9..ca5071e 100644 --- a/java/code/src/com/redhat/rhn/domain/channel/Channel.java +++ b/java/code/src/com/redhat/rhn/domain/channel/Channel.java @@ -810,8 +810,8 @@ public class Channel extends BaseDomainHelper implements Comparable { DistChannelMap channelDist = ChannelFactory.lookupDistChannelMap(toConsider); if (channelDist != null) { String release = channelDist.getRelease(); - // If channle or parent is RHEL-5 use sha1, else use sha256 - if (sha1compatiblechannels.contains(release)) { + // If channel or parent is RHEL-5 use sha1, else use sha256 + if (toConsider.isCustom() || sha1compatiblechannels.contains(release)) { return CHECKSUM_SHA_1; } else {
commit 3cc55fde0273207c056868ac497f063963555b7f Author: Devan Goodwin dgoodwin@redhat.com Date: Tue Jul 14 10:52:49 2009 -0300
Return config channels sorted highest to lowest priority.
Suggested by Maxim Burgerhout maxim@wzzrd.com on the spacewalk-devel list, rhncfg-client was returning the list of config channels sorted in the opposite order the web UI was. Changed now so that they both return highest priority first.
diff --git a/backend/server/handlers/config/rhn_config_management.py b/backend/server/handlers/config/rhn_config_management.py index f2f3fe9..4b16fa9 100644 --- a/backend/server/handlers/config/rhn_config_management.py +++ b/backend/server/handlers/config/rhn_config_management.py @@ -212,7 +212,7 @@ class ConfigManagement(configFilesHandler.ConfigFilesHandler): and scc.config_channel_id = cc.id and cc.confchan_type_id = cct.id and cct.label in ('normal', 'local_override') - order by scc.position desc nulls last, cc.name desc + order by scc.position nulls last, cc.name desc """)
def _get_client_config_channels(self, server_id):