2 commits - java/code schema/spacewalk web/conf web/html web/modules
by Partha Aji
java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml | 7
java/code/src/com/redhat/rhn/common/security/acl/ChannelAclHandler.java | 20
java/code/src/com/redhat/rhn/domain/channel/ChannelFamily.hbm.xml | 12
java/code/src/com/redhat/rhn/domain/channel/ChannelFamilyFactory.java | 12
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 3
java/code/webapp/WEB-INF/nav/channel_detail.xml | 1
java/code/webapp/WEB-INF/nav/system_detail.xml | 1
schema/spacewalk/common/tables/rhnChannelFamilyLicense.sql | 35
schema/spacewalk/common/tables/rhnChannelFamilyLicenseConsent.sql | 51
schema/spacewalk/common/tables/tables.deps | 1
schema/spacewalk/oracle/packages/rhn_channel.pkb | 56
schema/spacewalk/oracle/packages/rhn_channel.pks | 2
schema/spacewalk/oracle/procs/delete_server.sql | 1
schema/spacewalk/oracle/procs/procs.deps | 2
schema/spacewalk/oracle/triggers/rhnChannelFamilyLicense.sql | 25
schema/spacewalk/oracle/triggers/rhnChannelFamilyLicenseConsent.sql | 25
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/013-delete_server.sql | 271 ++
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/014-rhn_channel-pks.sql | 248 +
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/015-rhn_channel-pkb.sql | 1344 ++++++++++
schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/100-drop-rhnChannelFamilyLicense-tables.sql | 23
web/conf/rhn_web.conf | 3
web/html/nav/channel_detail.xml | 1
web/html/nav/system_detail.xml | 1
web/html/network/software/channels/display_license.pxt | 33
web/html/network/systems/details/channel_license.pxt | 45
web/html/network/systems/ssm/channels/alter_subscriptions_conf.pxt | 40
web/modules/rhn/RHN/Access/Channel.pm | 12
web/modules/rhn/RHN/DB/Channel.pm | 20
web/modules/rhn/RHN/DB/DataSource/xml/Channel_queries.xml | 6
web/modules/rhn/RHN/DB/Server.pm | 14
web/modules/rhn/RHN/DB/ServerActions.pm | 36
web/modules/sniglets/Sniglets/ActivationKeys.pm | 2
web/modules/sniglets/Sniglets/ChannelLicense.pm | 346 --
33 files changed, 1893 insertions(+), 806 deletions(-)
New commits:
commit 20841b237216bccc459b6aae224c0a69dd16329b
Author: Partha Aji <paji(a)redhat.com>
Date: Fri Jun 18 11:49:50 2010 -0400
Good Bye rhnChannelFamilyLicense and rhnChannelFamilyLicenseConsent tables schemas
diff --git a/schema/spacewalk/common/tables/rhnChannelFamilyLicense.sql b/schema/spacewalk/common/tables/rhnChannelFamilyLicense.sql
deleted file mode 100644
index dfca5ce..0000000
--- a/schema/spacewalk/common/tables/rhnChannelFamilyLicense.sql
+++ /dev/null
@@ -1,35 +0,0 @@
---
--- Copyright (c) 2008 Red Hat, Inc.
---
--- This software is licensed to you under the GNU General Public License,
--- version 2 (GPLv2). There is NO WARRANTY for this software, express or
--- implied, including the implied warranties of MERCHANTABILITY or FITNESS
--- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
--- along with this software; if not, see
--- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
---
--- Red Hat trademarks are not licensed under GPLv2. No permission is
--- granted to use or replicate Red Hat trademarks that are incorporated
--- in this software or its documentation.
---
-
-
-CREATE TABLE rhnChannelFamilyLicense
-(
- channel_family_id NUMBER NOT NULL
- CONSTRAINT rhn_cfl_cfid_fk
- REFERENCES rhnChannelFamily (id)
- ON DELETE CASCADE,
- license_path VARCHAR2(1000) NOT NULL,
- created DATE
- DEFAULT (sysdate) NOT NULL,
- modified DATE
- DEFAULT (sysdate) NOT NULL
-)
-ENABLE ROW MOVEMENT
-;
-
-CREATE UNIQUE INDEX rhn_cf_license_cfid_uq
- ON rhnChannelFamilyLicense (channel_family_id)
- TABLESPACE [[64k_tbs]];
-
diff --git a/schema/spacewalk/common/tables/rhnChannelFamilyLicenseConsent.sql b/schema/spacewalk/common/tables/rhnChannelFamilyLicenseConsent.sql
deleted file mode 100644
index 41af7ce..0000000
--- a/schema/spacewalk/common/tables/rhnChannelFamilyLicenseConsent.sql
+++ /dev/null
@@ -1,51 +0,0 @@
---
--- Copyright (c) 2008 Red Hat, Inc.
---
--- This software is licensed to you under the GNU General Public License,
--- version 2 (GPLv2). There is NO WARRANTY for this software, express or
--- implied, including the implied warranties of MERCHANTABILITY or FITNESS
--- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
--- along with this software; if not, see
--- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
---
--- Red Hat trademarks are not licensed under GPLv2. No permission is
--- granted to use or replicate Red Hat trademarks that are incorporated
--- in this software or its documentation.
---
-
-
-CREATE TABLE rhnChannelFamilyLicenseConsent
-(
- channel_family_id NUMBER NOT NULL
- CONSTRAINT rhn_cfl_consent_cfid_fk
- REFERENCES rhnChannelFamily (id)
- ON DELETE CASCADE,
- user_id NUMBER NOT NULL
- CONSTRAINT rhn_cfl_consent_uid_fk
- REFERENCES web_contact (id)
- ON DELETE CASCADE,
- server_id NUMBER NOT NULL
- CONSTRAINT rhn_cfl_consent_sid_fk
- REFERENCES rhnServer (id),
- created DATE
- DEFAULT (sysdate) NOT NULL,
- modified DATE
- DEFAULT (sysdate) NOT NULL
-)
-ENABLE ROW MOVEMENT
-;
-
-CREATE UNIQUE INDEX rhn_cfl_consent_cf_s_uq
- ON rhnChannelFamilyLicenseConsent (channel_family_id, server_id)
- TABLESPACE [[64k_tbs]];
-
-CREATE INDEX rhn_cfl_consent_uid_idx
- ON rhnChannelFamilyLicenseConsent (user_id)
- TABLESPACE [[64k_tbs]]
- NOLOGGING;
-
-CREATE INDEX rhn_cfl_consent_sid_idx
- ON rhnChannelFamilyLicenseConsent (server_id)
- TABLESPACE [[8m_tbs]]
- NOLOGGING;
-
diff --git a/schema/spacewalk/common/tables/tables.deps b/schema/spacewalk/common/tables/tables.deps
index 1515473..ce3799a 100644
--- a/schema/spacewalk/common/tables/tables.deps
+++ b/schema/spacewalk/common/tables/tables.deps
@@ -56,7 +56,6 @@ rhnChannelComps :: rhnChannel
rhnChannelCloned :: rhnChannelComps
rhnChannelErrata :: rhnChannel rhnErrata
rhnChannelFamily :: web_customer
-rhnChannelFamilyLicenseConsent :: rhnChannelFamily web_contact rhnServer
rhnChannelFamilyMembers :: rhnChannel rhnChannelFamily
rhnChannelFamilyVirtSubLevel :: rhnChannelFamily rhnVirtSubLevel
rhnPrivateChannelFamily :: web_customer rhnChannelFamily
diff --git a/schema/spacewalk/oracle/packages/rhn_channel.pkb b/schema/spacewalk/oracle/packages/rhn_channel.pkb
index f5d5c96..77377f5 100644
--- a/schema/spacewalk/oracle/packages/rhn_channel.pkb
+++ b/schema/spacewalk/oracle/packages/rhn_channel.pkb
@@ -42,44 +42,8 @@ IS
and scac.server_arch_id = server_arch_id_in
and scac.channel_arch_id = c.channel_arch_id;
- FUNCTION get_license_path(channel_id_in IN NUMBER)
- RETURN VARCHAR2
- IS
- license_val VARCHAR2(1000);
- BEGIN
- SELECT CFL.license_path INTO license_val
- FROM rhnChannelFamilyLicense CFL, rhnChannelFamilyMembers CFM
- WHERE CFM.channel_id = channel_id_in
- AND CFM.channel_family_id = CFL.channel_family_id;
-
- RETURN license_val;
-
- EXCEPTION
- WHEN NO_DATA_FOUND
- THEN
- RETURN NULL;
- END get_license_path;
- PROCEDURE license_consent(channel_id_in IN NUMBER, user_id_in IN NUMBER, server_id_in IN NUMBER)
- IS
- channel_family_id_val NUMBER;
- BEGIN
- channel_family_id_val := rhn_channel.family_for_channel(channel_id_in);
- IF channel_family_id_val IS NULL
- THEN
- rhn_exception.raise_exception('channel_subscribe_no_family');
- END IF;
-
- IF rhn_channel.get_license_path(channel_id_in) IS NULL
- THEN
- rhn_exception.raise_exception('channel_consent_no_license');
- END IF;
-
- INSERT INTO rhnChannelFamilyLicenseConsent (channel_family_id, user_id, server_id)
- VALUES (channel_family_id_val, user_id_in, server_id_in);
- END license_consent;
-
PROCEDURE subscribe_server(server_id_in IN NUMBER, channel_id_in NUMBER, immediate_in NUMBER := 1, user_id_in in number := null, recalcfamily_in NUMBER := 1)
IS
channel_parent_val rhnChannel.parent_channel%TYPE;
@@ -172,21 +136,6 @@ IS
can_server_consume_virt_channl(server_id_in, channel_family_id_val) = 1
THEN
- IF rhn_channel.get_license_path(channel_id_in) IS NOT NULL
- THEN
- BEGIN
-
- SELECT user_id INTO consenting_user
- FROM rhnChannelFamilyLicenseConsent
- WHERE channel_family_id = channel_family_id_val
- AND server_id = server_id_in;
-
- EXCEPTION
- WHEN NO_DATA_FOUND THEN
- rhn_exception.raise_exception('channel_subscribe_no_consent');
- END;
- END IF;
-
insert into rhnServerHistory (id,server_id,summary,details) (
select rhn_event_id_seq.nextval,
server_id_in,
@@ -583,11 +532,6 @@ IS
for ignore in channel_family_is_proxy(channel_family_id_val) loop
delete from rhnProxyInfo where server_id = server_id_in;
end loop;
-
- DELETE FROM rhnChannelFamilyLicenseConsent
- WHERE channel_family_id = channel_family_id_val
- AND server_id = server_id_in;
-
SELECT org_id INTO server_org_id_val
FROM rhnServer
WHERE id = server_id_in;
diff --git a/schema/spacewalk/oracle/packages/rhn_channel.pks b/schema/spacewalk/oracle/packages/rhn_channel.pks
index 2036f9a..9385a2a 100644
--- a/schema/spacewalk/oracle/packages/rhn_channel.pks
+++ b/schema/spacewalk/oracle/packages/rhn_channel.pks
@@ -47,8 +47,6 @@ IS
WHERE channel_family_id = channel_family_id_in
AND org_id = org_id_in;
- PROCEDURE license_consent(channel_id_in IN NUMBER, user_id_in IN NUMBER, server_id_in IN NUMBER);
- FUNCTION get_license_path(channel_id_in IN NUMBER) RETURN VARCHAR2;
PROCEDURE unsubscribe_server(server_id_in IN NUMBER, channel_id_in NUMBER, immediate_in NUMBER := 1, unsubscribe_children_in number := 0,
deleting_server in number := 0,
diff --git a/schema/spacewalk/oracle/procs/delete_server.sql b/schema/spacewalk/oracle/procs/delete_server.sql
index d388cb9..3d75909 100644
--- a/schema/spacewalk/oracle/procs/delete_server.sql
+++ b/schema/spacewalk/oracle/procs/delete_server.sql
@@ -150,7 +150,6 @@ begin
delete from rhnActionConfigChannel where server_id = server_id_in;
delete from rhnActionConfigRevision where server_id = server_id_in;
delete from rhnActionPackageRemovalFailure where server_id = server_id_in;
- delete from rhnChannelFamilyLicenseConsent where server_id = server_id_in;
delete from rhnClientCapability where server_id = server_id_in;
delete from rhnCpu where server_id = server_id_in;
-- there's still a cascade here, because the constraint keeps the
diff --git a/schema/spacewalk/oracle/procs/procs.deps b/schema/spacewalk/oracle/procs/procs.deps
index 4328b6a..f4e66e4 100644
--- a/schema/spacewalk/oracle/procs/procs.deps
+++ b/schema/spacewalk/oracle/procs/procs.deps
@@ -34,7 +34,7 @@ delete_server :: rhn_channel.pks rhn_config.pks \
rhnKickstartSession rhnActionConfigChannel \
rhnActionConfigRevision rhnClientCapability \
rhnActionPackageRemovalFailure rhnCpu \
- rhnChannelFamilyLicenseConsent rhnDevice \
+ rhnDevice \
rhnProxyInfo rhnRam rhnRegToken \
rhnSNPServerQueue rhnSatelliteChannelFamily \
rhnSatelliteInfo rhnServerAction \
diff --git a/schema/spacewalk/oracle/triggers/rhnChannelFamilyLicense.sql b/schema/spacewalk/oracle/triggers/rhnChannelFamilyLicense.sql
deleted file mode 100644
index 483f7af..0000000
--- a/schema/spacewalk/oracle/triggers/rhnChannelFamilyLicense.sql
+++ /dev/null
@@ -1,25 +0,0 @@
-
---
--- Copyright (c) 2008 Red Hat, Inc.
---
--- This software is licensed to you under the GNU General Public License,
--- version 2 (GPLv2). There is NO WARRANTY for this software, express or
--- implied, including the implied warranties of MERCHANTABILITY or FITNESS
--- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
--- along with this software; if not, see
--- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
---
--- Red Hat trademarks are not licensed under GPLv2. No permission is
--- granted to use or replicate Red Hat trademarks that are incorporated
--- in this software or its documentation.
---
-
-create or replace trigger
-rhn_cf_license_mod_trig
-before insert or update on rhnChannelFamilyLicense
-for each row
-begin
- :new.modified := sysdate;
-end;
-/
-show errors
diff --git a/schema/spacewalk/oracle/triggers/rhnChannelFamilyLicenseConsent.sql b/schema/spacewalk/oracle/triggers/rhnChannelFamilyLicenseConsent.sql
deleted file mode 100644
index bf1959d..0000000
--- a/schema/spacewalk/oracle/triggers/rhnChannelFamilyLicenseConsent.sql
+++ /dev/null
@@ -1,25 +0,0 @@
-
---
--- Copyright (c) 2008 Red Hat, Inc.
---
--- This software is licensed to you under the GNU General Public License,
--- version 2 (GPLv2). There is NO WARRANTY for this software, express or
--- implied, including the implied warranties of MERCHANTABILITY or FITNESS
--- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
--- along with this software; if not, see
--- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
---
--- Red Hat trademarks are not licensed under GPLv2. No permission is
--- granted to use or replicate Red Hat trademarks that are incorporated
--- in this software or its documentation.
---
-
-create or replace trigger
-rhn_cfl_consent_mod_trig
-before insert or update on rhnChannelFamilyLicenseConsent
-for each row
-begin
- :new.modified := sysdate;
-end;
-/
-show errors
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/013-delete_server.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/013-delete_server.sql
new file mode 100644
index 0000000..3d75909
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/013-delete_server.sql
@@ -0,0 +1,271 @@
+--
+-- 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.
+--
+--
+--
+-- This deletes a server. All codepaths which delete servers should hit this
+-- or delete_server_bulk()
+
+create or replace
+procedure delete_server (
+ server_id_in in number
+) is
+ cursor servergroups is
+ select server_id, server_group_id
+ from rhnServerGroupMembers sgm
+ where sgm.server_id = server_id_in;
+ cursor configchannels is
+ select cc.id
+ from rhnConfigChannel cc,
+ rhnConfigChannelType cct,
+ rhnServerConfigChannel scc
+ where 1=1
+ and scc.server_id = server_id_in
+ and scc.config_channel_id = cc.id
+ -- these config channel types are reserved
+ -- for use by a single server, so we don't
+ -- need to check for other servers subscribed
+ and cct.label in
+ ('local_override','server_import')
+ and cct.id = cc.confchan_type_id;
+ type filelistsid_t is table of rhnServerPreserveFileList.file_list_id%type;
+ filelistsid_c filelistsid_t;
+
+ type probesid_t is table of rhn_check_probe.probe_id%type;
+ probesid_c probesid_t;
+
+ is_virt number := 0;
+begin
+ rhn_channel.delete_server_channels(server_id_in);
+ -- rhn_channel.clear_subscriptions(server_id_in);
+
+ -- filelists
+ select spfl.file_list_id id bulk collect into filelistsid_c
+ from rhnServerPreserveFileList spfl
+ where spfl.server_id = server_id_in
+ and not exists (
+ select 1
+ from rhnServerPreserveFileList
+ where file_list_id = spfl.file_list_id
+ and server_id != server_id_in
+ union
+ select 1
+ from rhnKickstartPreserveFileList
+ where file_list_id = spfl.file_list_id
+ );
+ if filelistsid_c.first is not null then
+ forall i in filelistsid_c.first..filelistsid_c.last
+ delete from rhnFileList where id = filelistsid_c(i);
+ end if;
+
+ for configchannel in configchannels loop
+ rhn_config.delete_channel(configchannel.id);
+ end loop;
+
+ select count(1) into is_virt
+ from rhnServerEntitlementView
+ where server_id = server_id_in
+ and label in ('virtualization_host', 'virtualization_host_platform')
+ and rownum <= 1;
+
+ for sgm in servergroups loop
+ rhn_server.delete_from_servergroup(
+ sgm.server_id, sgm.server_group_id);
+ end loop;
+
+ if is_virt = 1 then
+ rhn_entitlements.repoll_virt_guest_entitlements(server_id_in);
+ end if;
+
+ -- we're handling this instead of letting an "on delete
+ -- set null" do it so that we don't run the risk
+ -- of setting off the triggers and killing us with a
+ -- mutating table
+
+ -- this is merge of two single updates:
+ -- update ... set old_server_id = null where old_server_id = server_id_in;
+ -- update ... set new_server_id = null where new_server_id = server_id_in;
+ -- so we scan rhnKickstartSession table only once
+ update rhnKickstartSession
+ set old_server_id = case when old_server_id = server_id_in then null else old_server_id end,
+ new_server_id = case when new_server_id = server_id_in then null else new_server_id end
+ where old_server_id = server_id_in
+ or new_server_id = server_id_in;
+
+ rhn_channel.clear_subscriptions(server_id_in,1);
+
+ -- A little complicated here, but the goal is to
+ -- delete records from rhnVirtualInstace only if we don't
+ -- care about them anymore. We don't care about records
+ -- in rhnVirtualInstance if we are deleting the host
+ -- system and the virtual system is already null, or
+ -- vice-versa. We *do* care about them if either the
+ -- host or virtual system is still registered because we
+ -- still want them to show up in the UI.
+ -- If there's a newer row in rhnVirtualInstance with the same
+ -- uuid, this guest must have been re-registered, so we can clean
+ -- this data up.
+
+ delete from rhnVirtualInstance vi
+ where (host_system_id = server_id_in and virtual_system_id is null)
+ or (virtual_system_id = server_id_in and host_system_id is null)
+ or (vi.virtual_system_id = server_id_in and vi.modified < (select max(vi2.modified)
+ from rhnVirtualInstance vi2 where vi2.uuid = vi.uuid));
+
+ -- this is merge of two single updates:
+ -- update ... set host_system_id = null where host_system_id = server_id_in;
+ -- update ... set virtual_system_id = null where virtual_system_id = server_id_in;
+ -- so we scan rhnVirtualInstance table only once
+ update rhnVirtualInstance
+ set host_system_id = case when host_system_id = server_id_in then null else host_system_id end,
+ virtual_system_id = case when virtual_system_id = server_id_in then null else virtual_system_id end
+ where host_system_id = server_id_in
+ or virtual_system_id = server_id_in;
+
+ -- this is merge of two single updates:
+ -- update ... set old_host_system_id = null when old_host_system_id = server_id_in;
+ -- update ... set new_host_system_id = null when new_host_system_id = server_id_in;
+ -- so we scan rhnVirtualInstanceEventLog table only once
+ update rhnVirtualInstanceEventLog
+ set old_host_system_id = case when old_host_system_id = server_id_in then null else old_host_system_id end,
+ new_host_system_id = case when new_host_system_id = server_id_in then null else new_host_system_id end
+ where old_host_system_id = server_id_in
+ or new_host_system_id = server_id_in;
+
+ -- We're deleting everything with a foreign key to rhnServer
+ -- here, now. I'm hoping this will help aleviate our deadlock
+ -- problem.
+
+ delete from rhnActionConfigChannel where server_id = server_id_in;
+ delete from rhnActionConfigRevision where server_id = server_id_in;
+ delete from rhnActionPackageRemovalFailure where server_id = server_id_in;
+ delete from rhnClientCapability where server_id = server_id_in;
+ delete from rhnCpu where server_id = server_id_in;
+ -- there's still a cascade here, because the constraint keeps the
+ -- table locked for too long to rebuild it. Ugh...
+ delete from rhnDevice where server_id = server_id_in;
+ delete from rhnProxyInfo where server_id = server_id_in;
+ delete from rhnRam where server_id = server_id_in;
+ delete from rhnRegToken where server_id = server_id_in;
+ delete from rhnSNPServerQueue where server_id = server_id_in;
+ delete from rhnSatelliteChannelFamily where server_id = server_id_in;
+ delete from rhnSatelliteInfo where server_id = server_id_in;
+ -- this cascades to rhnActionConfigChannel and rhnActionConfigFileName
+ delete from rhnServerAction where server_id = server_id_in;
+ delete from rhnServerActionPackageResult where server_id = server_id_in;
+ delete from rhnServerActionScriptResult where server_id = server_id_in;
+ delete from rhnServerActionVerifyResult where server_id = server_id_in;
+ delete from rhnServerActionVerifyMissing where server_id = server_id_in;
+ -- counts are handled above. this should be a delete_ function.
+ delete from rhnServerChannel where server_id = server_id_in;
+ delete from rhnServerConfigChannel where server_id = server_id_in;
+ delete from rhnServerCustomDataValue where server_id = server_id_in;
+ delete from rhnServerDMI where server_id = server_id_in;
+ delete from rhnServerMessage where server_id = server_id_in;
+ -- this gets rhnServerMessage (only) on cascade; it's handled just above
+ delete from rhnServerEvent where server_id = server_id_in;
+ delete from rhnServerHistory where server_id = server_id_in;
+ delete from rhnServerInfo where server_id = server_id_in;
+ delete from rhnServerInstallInfo where server_id = server_id_in;
+ delete from rhnServerLocation where server_id = server_id_in;
+ delete from rhnServerLock where server_id = server_id_in;
+ delete from rhnServerNeededCache where server_id = server_id_in;
+ delete from rhnServerNetwork where server_id = server_id_in;
+ delete from rhnServerNotes where server_id = server_id_in;
+ -- I'm not removing the foreign key from rhnServerPackage; that'll
+ -- take forever. Do the delete anyway.
+ delete from rhnServerPackage where server_id = server_id_in;
+ delete from rhnServerTokenRegs where server_id = server_id_in;
+ delete from rhnSnapshotTag where server_id = server_id_in;
+ -- this cascades to:
+ -- rhnSnapshotChannel, rhnSnapshotConfigChannel, rhnSnapshotPackage,
+ -- rhnSnapshotConfigRevision, rhnSnapshotServerGroup,
+ -- rhnSnapshotTag.
+ -- We may want to consider delete_snapshot() at some point, but
+ -- I don't think we need to yet.
+ delete from rhnSnapshot where server_id = server_id_in;
+ delete from rhnTransaction where server_id = server_id_in;
+ delete from rhnUserServerPrefs where server_id = server_id_in;
+ -- hrm, this one's interesting... we _probably_ should delete
+ -- everything for the parent server_id when we delete the proxy,
+ -- but we don't currently.
+ delete from rhnServerPath where server_id_in in (server_id, proxy_server_id);
+ delete from rhnUserServerPerms where server_id = server_id_in;
+
+ delete from rhn_interface_monitoring where server_id = server_id_in;
+ delete from rhnServerNetInterface where server_id = server_id_in;
+ delete from rhn_server_monitoring_info where recid = server_id_in;
+
+ delete from rhnAppInstallSession where server_id = server_id_in;
+ delete from rhnServerUuid where server_id = server_id_in;
+ -- We delete all the probes running directly against this system
+ -- and any probes that were using this Server as a Proxy Scout.
+ SELECT CP.probe_id bulk collect into probesid_c
+ FROM rhn_check_probe CP
+ WHERE CP.host_id = server_id_in
+ OR CP.sat_cluster_id in
+ (SELECT SN.sat_cluster_id
+ FROM rhn_sat_node SN
+ WHERE SN.server_id = server_id_in);
+
+ if probesid_c.first is not null then
+ FORALL i IN probesid_c.first..probesid_c.last
+ DELETE FROM rhn_probe_state PS WHERE PS.probe_id = probesid_c(i);
+ FORALL i IN probesid_c.first..probesid_c.last
+ DELETE FROM rhn_probe P WHERE P.recid = probesid_c(i);
+ FORALL i IN probesid_c.first..probesid_c.last
+ DELETE /*+index(time_series time_series_probe_id_idx)*/
+ FROM time_series
+ WHERE substr(o_id, instr(o_id, '-') + 1,
+ (instr(o_id, '-', instr(o_id, '-') + 1) - instr(o_id, '-')) - 1) = probesid_c(i);
+ end if;
+
+ delete from rhn_check_probe where host_id = server_id_in;
+ delete from rhn_host_probe where host_id = server_id_in;
+
+ delete from rhn_sat_cluster where recid in
+ ( select sat_cluster_id from rhn_sat_node where server_id = server_id_in );
+
+ delete from rhn_sat_node where server_id = server_id_in;
+
+ -- now get rhnServer itself.
+ delete
+ from rhnServer
+ where id = server_id_in;
+
+ delete
+ from rhnSet
+ where 1=1
+ and user_id in (
+ select wc.id
+ from rhnServer rs,
+ web_contact wc
+ where rs.id = server_id_in
+ and rs.org_id = wc.org_id
+ )
+ and label = 'system_list'
+ and element = server_id_in;
+end delete_server;
+/
+show errors;
+
+--
+-- Revision 1.25 2004/11/01 17:53:03 pjones
+-- bugzilla: 136124 -- Fix the "no data found" when deleting rhn_sat_cluster
+--
+--
+--
+--
+-- This deletes a list of server.
+--
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/014-rhn_channel-pks.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/014-rhn_channel-pks.sql
new file mode 100644
index 0000000..9385a2a
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/014-rhn_channel-pks.sql
@@ -0,0 +1,248 @@
+--
+-- Copyright (c) 2008--2010 Red Hat, Inc.
+--
+-- This software is licensed to you under the GNU General Public License,
+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+-- along with this software; if not, see
+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+--
+-- Red Hat trademarks are not licensed under GPLv2. No permission is
+-- granted to use or replicate Red Hat trademarks that are incorporated
+-- in this software or its documentation.
+--
+--
+--
+--
+
+CREATE OR REPLACE
+PACKAGE rhn_channel
+IS
+ version varchar2(100) := '';
+
+ CURSOR server_base_subscriptions(server_id_in NUMBER) IS
+ SELECT C.id
+ FROM rhnChannel C, rhnServerChannel SC
+ WHERE C.id = SC.channel_id
+ AND SC.server_id = server_id_in
+ AND C.parent_channel IS NULL;
+
+ CURSOR check_server_subscription(server_id_in NUMBER, channel_id_in NUMBER) IS
+ SELECT channel_id
+ FROM rhnServerChannel
+ WHERE server_id = server_id_in
+ AND channel_id = channel_id_in;
+
+ CURSOR check_server_parent_membership(server_id_in NUMBER, channel_id_in NUMBER) IS
+ SELECT C.id
+ FROM rhnChannel C, rhnServerChannel SC
+ WHERE C.parent_channel = channel_id_in
+ AND C.id = SC.channel_id
+ AND SC.server_id = server_id_in;
+
+ CURSOR channel_family_perm_cursor(channel_family_id_in NUMBER, org_id_in NUMBER) IS
+ SELECT *
+ FROM rhnOrgChannelFamilyPermissions
+ WHERE channel_family_id = channel_family_id_in
+ AND org_id = org_id_in;
+
+
+ PROCEDURE unsubscribe_server(server_id_in IN NUMBER, channel_id_in NUMBER, immediate_in NUMBER := 1, unsubscribe_children_in number := 0,
+ deleting_server in number := 0,
+ update_family_countsYN IN NUMBER := 1);
+ PROCEDURE subscribe_server(server_id_in IN NUMBER, channel_id_in NUMBER, immediate_in NUMBER := 1, user_id_in number := null, recalcfamily_in number := 1);
+
+ function can_server_consume_virt_channl(
+ server_id_in IN NUMBER,
+ family_id_in in number)
+ return number;
+
+ FUNCTION guess_server_base(server_id_in IN NUMBER) RETURN NUMBER;
+
+ FUNCTION base_channel_for_release_arch(release_in in varchar2,
+ server_arch_in in varchar2, org_id_in in number := -1,
+ user_id_in in number := null) RETURN number;
+
+ FUNCTION base_channel_rel_archid(release_in in varchar2,
+ server_arch_id_in in number, org_id_in in number := -1,
+ user_id_in in number := null) RETURN number;
+
+ FUNCTION channel_priority(channel_id_in in number) RETURN number;
+
+ PROCEDURE bulk_server_base_change(channel_id_in IN NUMBER, set_label_in IN VARCHAR2, set_uid_in IN NUMBER);
+ procedure bulk_server_basechange_from(
+ set_label_in in varchar2,
+ set_uid_in in number,
+ old_channel_id_in in number,
+ new_channel_id_in in number);
+
+ procedure bulk_guess_server_base(
+ set_label_in in varchar2,
+ set_uid_in in number);
+
+ procedure bulk_guess_server_base_from(
+ set_label_in in varchar2,
+ set_uid_in in number,
+ channel_id_in in number);
+
+ PROCEDURE clear_subscriptions(server_id_in IN NUMBER, deleting_server in number := 0,
+ update_family_countsYN IN NUMBER := 1);
+
+ FUNCTION available_family_subscriptions(channel_family_id_in IN NUMBER, org_id_in IN NUMBER) RETURN NUMBER;
+
+ function channel_family_current_members(channel_family_id_in IN NUMBER,
+ org_id_in IN NUMBER)
+ return number;
+
+ PROCEDURE update_family_counts(channel_family_id_in IN NUMBER, org_id_in IN NUMBER);
+ PROCEDURE update_group_family_counts(group_label_in IN VARCHAR2, org_id_in IN NUMBER);
+ FUNCTION family_for_channel(channel_id_in IN NUMBER) RETURN NUMBER;
+
+ FUNCTION available_chan_subscriptions(channel_id_in IN NUMBER, org_id_in IN NUMBER) RETURN NUMBER;
+
+ procedure entitle_customer(customer_id_in in number, channel_family_id_in in number, quantity_in in number);
+ procedure set_family_maxmembers(customer_id_in in number, channel_family_id_in in number, quantity_in in number);
+ procedure unsubscribe_server_from_family(server_id_in in number, channel_family_id_in in number);
+
+ procedure delete_server_channels(server_id_in in number);
+ procedure refresh_newest_package(channel_id_in in number, caller_in in varchar2 := '(unknown)');
+
+ function get_org_id(channel_id_in in number) return number;
+ PRAGMA RESTRICT_REFERENCES(get_org_id, WNDS, RNPS, WNPS);
+
+ function get_org_access(channel_id_in in number, org_id_in in number) return number;
+ PRAGMA RESTRICT_REFERENCES(get_org_access, WNDS, RNPS, WNPS);
+
+ function get_cfam_org_access(cfam_id_in in number, org_id_in in number) return number;
+
+ function user_role_check_debug(channel_id_in in number, user_id_in in number, role_in in varchar2, reason_out out varchar2)
+ RETURN NUMBER;
+ PRAGMA RESTRICT_REFERENCES(user_role_check_debug, WNDS, RNPS, WNPS);
+
+ function user_role_check(channel_id_in in number, user_id_in in number, role_in in varchar2)
+ RETURN NUMBER;
+ PRAGMA RESTRICT_REFERENCES(user_role_check, WNDS, RNPS, WNPS);
+
+ function loose_user_role_check(channel_id_in in number, user_id_in in number, role_in in varchar2)
+ RETURN NUMBER;
+ PRAGMA RESTRICT_REFERENCES(loose_user_role_check, WNDS, RNPS, WNPS);
+
+ function direct_user_role_check(channel_id_in in number, user_id_in in number, role_in in varchar2)
+ RETURN NUMBER;
+ PRAGMA RESTRICT_REFERENCES(direct_user_role_check, WNDS, RNPS, WNPS);
+
+ function shared_user_role_check(channel_id in number, user_id in number, role in varchar2)
+ RETURN NUMBER;
+ PRAGMA RESTRICT_REFERENCES(shared_user_role_check, WNDS, RNPS, WNPS);
+
+ function org_channel_setting(channel_id_in in number, org_id_in in number, setting_in in varchar2)
+ RETURN NUMBER;
+
+ PROCEDURE update_channel ( channel_id_in in number, invalidate_ss in number := 0,
+ date_to_use in date := sysdate );
+
+ PROCEDURE update_channels_by_package ( package_id_in in number, date_to_use in date := sysdate );
+
+ PROCEDURE update_channels_by_errata ( errata_id_in number, date_to_use in date := sysdate );
+
+
+ PRAGMA RESTRICT_REFERENCES(org_channel_setting, WNDS, RNPS, WNPS);
+
+END rhn_channel;
+/
+SHOW ERRORS
+
+--
+-- Revision 1.37 2004/04/14 00:09:24 pjones
+-- bugzilla: 120761 -- split rhnChannelPermissions into two tables, eliminating
+-- a frequent full table scan
+--
+-- Revision 1.36 2004/03/26 18:11:32 rbb
+-- Bugzilla: 114057
+--
+-- Add a script to determine channel priority.
+--
+-- Revision 1.35 2004/02/17 20:16:52 pjones
+-- bugzilla: none -- add cvs tags into the package as long as we're touching
+-- it anyway
+--
+-- Revision 1.34 2003/11/13 18:13:09 cturner
+-- pragmas can now return now that rhn_user pragmas are fixed
+--
+-- Revision 1.32 2003/09/22 21:00:40 cturner
+-- add method for easy acl check
+--
+-- Revision 1.31 2003/09/17 22:14:11 misa
+-- bugzilla: 103639 Changes to allow me to move the base channel guess into plsql
+--
+-- Revision 1.30 2003/07/24 16:44:16 misa
+-- bugzilla: none A function more usable on the rhnapp side
+--
+-- Revision 1.29 2003/07/24 14:00:17 misa
+-- bugzilla: none PRAGMA RESTRICT_REFERENCES good
+--
+-- Revision 1.28 2003/07/23 21:59:19 cturner
+-- rework how rhnUserChannel works; move to plsql for speed and maintenance
+--
+-- Revision 1.27 2003/07/21 17:49:12 pjones
+-- bugzilla: none
+--
+-- add optional user for subscribe_server
+--
+-- Revision 1.26 2002/12/19 18:13:42 misa
+-- Added caller with a default value
+--
+-- Revision 1.25 2002/12/11 22:18:46 pjones
+-- rhnChannelNewestPackage
+--
+-- Revision 1.24 2002/11/21 22:08:11 pjones
+-- make unsubscribe_channels have a "unsubscribe_children_in number := 0"
+-- argument so that you can tell it to unsubscribe children.
+--
+-- Also, make it raise an exception instead of silent failure in the
+-- other case.
+--
+-- Revision 1.23 2002/11/18 17:20:50 pjones
+-- this should have gone back too
+--
+-- Revision 1.22 2002/11/13 23:16:18 pjones
+-- lookup_*_arch()
+--
+-- Revision 1.21 2002/10/07 20:01:59 rnorwood
+-- guess base channel for ssm and single system
+--
+-- Revision 1.20 2002/10/02 19:21:03 bretm
+-- o 3rd party channel schema changes, no more clobs...
+--
+-- Revision 1.19 2002/09/20 19:21:58 bretm
+-- o more 3rd party channel stuff...
+--
+-- Revision 1.18 2002/06/12 22:33:03 pjones
+-- procedure bulk_guess_server_base_from(
+-- set_label_in in varchar2,
+-- set_uid_in in number,
+-- channel_id_in in number);
+--
+-- for bretm
+--
+-- Revision 1.17 2002/06/12 22:12:25 pjones
+-- procedure bulk_guess_server_base(
+-- set_label_in in varchar2,
+-- set_uid_in in number);
+--
+-- for bretm
+--
+-- Revision 1.16 2002/06/12 19:37:55 pjones
+-- bulk_server_basechange_from(
+-- set_label_in in varchar2,
+-- set_uid_in in number,
+-- old_channel_id_in in number,
+-- new_channel_id_in in number
+-- );
+--
+-- for bretm
+--
+-- Revision 1.15 2002/05/10 22:08:22 pjones
+-- id/log
+--
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/015-rhn_channel-pkb.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/015-rhn_channel-pkb.sql
new file mode 100644
index 0000000..77377f5
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/015-rhn_channel-pkb.sql
@@ -0,0 +1,1344 @@
+--
+-- Copyright (c) 2008--2010 Red Hat, Inc.
+--
+-- This software is licensed to you under the GNU General Public License,
+-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
+-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
+-- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
+-- along with this software; if not, see
+-- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
+--
+-- Red Hat trademarks are not licensed under GPLv2. No permission is
+-- granted to use or replicate Red Hat trademarks that are incorporated
+-- in this software or its documentation.
+--
+--
+--
+--
+
+CREATE OR REPLACE
+PACKAGE BODY rhn_channel
+IS
+ body_version varchar2(100) := '';
+
+ -- Cursor that fetches all the possible base channels for a
+ -- (server_arch_id, release, org_id) combination
+ cursor base_channel_cursor(
+ release_in in varchar2,
+ server_arch_id_in in number,
+ org_id_in in number
+ ) return rhnChannel%ROWTYPE is
+ select distinct c.*
+ from rhnDistChannelMap dcm,
+ rhnServerChannelArchCompat scac,
+ rhnChannel c,
+ rhnChannelPermissions cp
+ where cp.org_id = org_id_in
+ and cp.channel_id = c.id
+ and c.parent_channel is null
+ and c.id = dcm.channel_id
+ and c.channel_arch_id = dcm.channel_arch_id
+ and dcm.release = release_in
+ and scac.server_arch_id = server_arch_id_in
+ and scac.channel_arch_id = c.channel_arch_id;
+
+
+
+ PROCEDURE subscribe_server(server_id_in IN NUMBER, channel_id_in NUMBER, immediate_in NUMBER := 1, user_id_in in number := null, recalcfamily_in NUMBER := 1)
+ IS
+ channel_parent_val rhnChannel.parent_channel%TYPE;
+ parent_subscribed BOOLEAN;
+ server_has_base_chan BOOLEAN;
+ server_already_in_chan BOOLEAN;
+ channel_family_id_val NUMBER;
+ server_org_id_val NUMBER;
+ available_subscriptions NUMBER;
+ consenting_user NUMBER;
+ allowed number := 0;
+ current_members_val number;
+ BEGIN
+ if user_id_in is not null then
+ allowed := rhn_channel.user_role_check(channel_id_in, user_id_in, 'subscribe');
+ else
+ allowed := 1;
+ end if;
+
+ if allowed = 0 then
+ rhn_exception.raise_exception('no_subscribe_permissions');
+ end if;
+
+
+ SELECT parent_channel INTO channel_parent_val FROM rhnChannel WHERE id = channel_id_in;
+
+ IF channel_parent_val IS NOT NULL
+ THEN
+ -- child channel; if attempting to cross-subscribe a child to the wrong base, silently ignore
+ parent_subscribed := FALSE;
+
+ FOR check_subscription IN check_server_subscription(server_id_in, channel_parent_val)
+ LOOP
+ parent_subscribed := TRUE;
+ END LOOP check_subscription;
+
+ IF NOT parent_subscribed
+ THEN
+ RETURN;
+ END IF;
+ ELSE
+ -- base channel
+ server_has_base_chan := FALSE;
+ FOR base IN server_base_subscriptions(server_id_in)
+ LOOP
+ server_has_base_chan := TRUE;
+ END LOOP base;
+
+ IF server_has_base_chan
+ THEN
+ rhn_exception.raise_exception('channel_server_one_base');
+ END IF;
+ END IF;
+
+ FOR check_subscription IN check_server_subscription(server_id_in, channel_id_in)
+ LOOP
+ server_already_in_chan := TRUE;
+ END LOOP check_subscription;
+
+ IF server_already_in_chan
+ THEN
+ RETURN;
+ END IF;
+
+ channel_family_id_val := rhn_channel.family_for_channel(channel_id_in);
+ IF channel_family_id_val IS NULL
+ THEN
+ rhn_exception.raise_exception('channel_subscribe_no_family');
+ END IF;
+
+ --
+ -- Use the org_id of the server only if the org_id of the channel = NULL.
+ -- This is required for subscribing to shared channels.
+ --
+ SELECT NVL(org_id, (SELECT org_id FROM rhnServer WHERE id = server_id_in))
+ INTO server_org_id_val
+ FROM rhnChannel
+ WHERE id = channel_id_in;
+
+ select current_members
+ into current_members_val
+ from rhnPrivateChannelFamily
+ where org_id = server_org_id_val and channel_family_id = channel_family_id_val
+ for update of current_members;
+
+ available_subscriptions := rhn_channel.available_family_subscriptions(channel_family_id_val, server_org_id_val);
+
+ IF available_subscriptions IS NULL OR
+ available_subscriptions > 0 or
+ can_server_consume_virt_channl(server_id_in, channel_family_id_val) = 1
+ THEN
+
+ insert into rhnServerHistory (id,server_id,summary,details) (
+ select rhn_event_id_seq.nextval,
+ server_id_in,
+ 'subscribed to channel ' || SUBSTR(c.label, 0, 106),
+ c.label
+ from rhnChannel c
+ where c.id = channel_id_in
+ );
+ UPDATE rhnServer SET channels_changed = sysdate WHERE id = server_id_in;
+ INSERT INTO rhnServerChannel (server_id, channel_id) VALUES (server_id_in, channel_id_in);
+ IF recalcfamily_in > 0
+ THEN
+ rhn_channel.update_family_counts(channel_family_id_val, server_org_id_val);
+ END IF;
+ queue_server(server_id_in, immediate_in);
+ ELSE
+ rhn_exception.raise_exception('channel_family_no_subscriptions');
+ END IF;
+
+ END subscribe_server;
+
+ function can_server_consume_virt_channl(
+ server_id_in in number,
+ family_id_in in number )
+ return number
+ is
+
+ cursor server_virt_families is
+ select vi.virtual_system_id, cfvsl.channel_family_id
+ from
+ rhnChannelFamilyVirtSubLevel cfvsl,
+ rhnSGTypeVirtSubLevel sgtvsl,
+ rhnVirtualInstance vi
+ where
+ vi.virtual_system_id = server_id_in
+ and sgtvsl.virt_sub_level_id = cfvsl.virt_sub_level_id
+ and cfvsl.channel_family_id = family_id_in
+ and exists (
+ select 1
+ from rhnServerEntitlementView sev
+ where vi.host_system_id = sev.server_id
+ and sev.server_group_type_id = sgtvsl.server_group_type_id );
+ begin
+
+ for server_virt_family in server_virt_families loop
+ return 1;
+ end loop;
+
+ return 0;
+
+ end;
+
+
+ PROCEDURE bulk_server_base_change(channel_id_in IN NUMBER, set_label_in IN VARCHAR2, set_uid_in IN NUMBER)
+ IS
+ BEGIN
+ FOR server IN rhn_set.set_iterator(set_label_in, set_uid_in)
+ LOOP
+ IF rhn_server.can_change_base_channel(server.element) = 1
+ THEN
+ rhn_channel.clear_subscriptions(TO_NUMBER(server.element));
+ rhn_channel.subscribe_server(server.element, channel_id_in, 0, set_uid_in);
+ END IF;
+ END LOOP server;
+ END bulk_server_base_change;
+
+ procedure bulk_server_basechange_from(
+ set_label_in in varchar2,
+ set_uid_in in number,
+ old_channel_id_in in number,
+ new_channel_id_in in number
+ ) is
+ cursor servers is
+ select sc.server_id id
+ from rhnChannel nc,
+ rhnServerChannelArchCompat scac,
+ rhnServer s,
+ rhnChannel oc,
+ rhnServerChannel sc,
+ rhnSet st
+ where 1=1
+ -- first, find the servers we're looking for.
+ and st.label = set_label_in
+ and st.user_id = set_uid_in
+ and st.element = sc.server_id
+ -- now, filter out anything that's not in the
+ -- old base channel.
+ and sc.channel_id = old_channel_id_in
+ and sc.channel_id = oc.id
+ and oc.parent_channel is null
+ -- now, see if it's compatible with the new base channel
+ and nc.id = new_channel_id_in
+ and nc.parent_channel is null
+ and sc.server_id = s.id
+ and s.server_arch_id = scac.server_arch_id
+ and scac.channel_arch_id = nc.channel_arch_id;
+ begin
+ for s in servers loop
+ insert into rhnSet (
+ user_id, label, element
+ ) values (
+ set_uid_in,
+ set_label_in || 'basechange',
+ s.id
+ );
+ end loop channel;
+ bulk_server_base_change(new_channel_id_in,
+ set_label_in || 'basechange',
+ set_uid_in);
+ delete from rhnSet
+ where label = set_label_in||'basechange'
+ and user_id = set_uid_in;
+ end bulk_server_basechange_from;
+
+ procedure bulk_guess_server_base(
+ set_label_in in varchar2,
+ set_uid_in in number
+ ) is
+ channel_id number;
+ begin
+ for server in rhn_set.set_iterator(set_label_in, set_uid_in)
+ loop
+ -- anything that doesn't work, we just ignore
+ begin
+ if rhn_server.can_change_base_channel(server.element) = 1
+ then
+ channel_id := guess_server_base(TO_NUMBER(server.element));
+ rhn_channel.clear_subscriptions(TO_NUMBER(server.element));
+ rhn_channel.subscribe_server(TO_NUMBER(server.element), channel_id, 0, set_uid_in);
+ end if;
+ exception when others then
+ null;
+ end;
+ end loop server;
+ end;
+
+ function guess_server_base(
+ server_id_in in number
+ ) RETURN number is
+ cursor server_cursor is
+ select s.server_arch_id, s.release, s.org_id
+ from rhnServer s
+ where s.id = server_id_in;
+ begin
+ for s in server_cursor loop
+ for channel in base_channel_cursor(s.release,
+ s.server_arch_id, s.org_id)
+ loop
+ return channel.id;
+ end loop base_channel_cursor;
+ end loop server_cursor;
+ -- Server not found, or no base channel applies to it
+ return null;
+ end;
+
+ -- Private function
+ function normalize_server_arch(server_arch_in in varchar2)
+ return varchar2
+ deterministic
+ is
+ suffix VARCHAR2(128) := '-redhat-linux';
+ suffix_len NUMBER := length(suffix);
+ begin
+ if server_arch_in is NULL then
+ return NULL;
+ end if;
+ if instr(server_arch_in, '-') > 0
+ then
+ -- Suffix already present
+ return server_arch_in;
+ end if;
+ return server_arch_in || suffix;
+ end normalize_server_arch;
+
+ --
+ --
+ -- Raises:
+ -- server_arch_not_found
+ -- no_subscribe_permissions
+ function base_channel_for_release_arch(
+ release_in in varchar2,
+ server_arch_in in varchar2,
+ org_id_in in number := -1,
+ user_id_in in number := null
+ ) return number is
+ server_arch varchar2(256) := normalize_server_arch(server_arch_in);
+ server_arch_id number;
+ begin
+ -- Look up the server arch
+ begin
+ select id
+ into server_arch_id
+ from rhnServerArch
+ where label = server_arch;
+ exception
+ when no_data_found then
+ rhn_exception.raise_exception('server_arch_not_found');
+ end;
+ return base_channel_rel_archid(release_in, server_arch_id,
+ org_id_in, user_id_in);
+ end base_channel_for_release_arch;
+
+ function base_channel_rel_archid(
+ release_in in varchar2,
+ server_arch_id_in in number,
+ org_id_in in number := -1,
+ user_id_in in number := null
+ ) return number is
+ denied_channel_id number := null;
+ valid_org_id number := org_id_in;
+ valid_user_id number := user_id_in;
+ channel_subscribable number;
+ begin
+ if org_id_in = -1 and user_id_in is not null then
+ -- Get the org id from the user id
+ begin
+ select org_id
+ into valid_org_id
+ from web_contact
+ where id = user_id_in;
+ exception
+ when no_data_found then
+ -- User doesn't exist
+ -- XXX Only list public stuff for now
+ valid_user_id := null;
+ valid_org_id := -1;
+ end;
+ end if;
+
+ for c in base_channel_cursor(release_in, server_arch_id_in, valid_org_id)
+ loop
+ -- This row is a possible match
+ if valid_user_id is null then
+ -- User ID not specified, so no user to channel permissions to
+ -- check
+ return c.id;
+ end if;
+
+ -- Check user to channel permissions
+ select loose_user_role_check(c.id, user_id_in, 'subscribe')
+ into channel_subscribable
+ from dual;
+
+ if channel_subscribable = 1 then
+ return c.id;
+ end if;
+
+ -- Base channel exists, but is not subscribable; keep trying
+ denied_channel_id := c.id;
+ end loop base_channel_fetch;
+
+ if denied_channel_id is not null then
+ rhn_exception.raise_exception('no_subscribe_permissions');
+ end if;
+ -- No base channel applies
+ return NULL;
+ end base_channel_rel_archid;
+
+ procedure bulk_guess_server_base_from(
+ set_label_in in varchar2,
+ set_uid_in in number,
+ channel_id_in in number
+ ) is
+ cursor channels(server_id_in in number) is
+ select rsc.channel_id
+ from rhnServerChannel rsc,
+ rhnChannel rc
+ where server_id_in = rsc.server_id
+ and rsc.channel_id = rc.id
+ and rc.parent_channel is null;
+ begin
+ for server in rhn_set.set_iterator(set_label_in, set_uid_in)
+ loop
+ for channel in channels(server.element)
+ loop
+ if channel.channel_id = channel_id_in
+ then
+ insert into rhnSet (user_id, label, element) values (set_uid_in, set_label_in || 'baseguess', server.element);
+ end if;
+ end loop channel;
+ end loop server;
+ bulk_guess_server_base(set_label_in||'baseguess',set_uid_in);
+ delete from rhnSet where label = set_label_in||'baseguess' and user_id = set_uid_in;
+ end;
+
+
+ PROCEDURE clear_subscriptions(server_id_in IN NUMBER, deleting_server IN NUMBER := 0,
+ update_family_countsYN IN NUMBER := 1)
+ IS
+ cursor server_channels(server_id_in in number) is
+ select s.org_id, sc.channel_id, cfm.channel_family_id
+ from rhnServer s,
+ rhnServerChannel sc,
+ rhnChannelFamilyMembers cfm
+ where s.id = server_id_in
+ and s.id = sc.server_id
+ and sc.channel_id = cfm.channel_id;
+ BEGIN
+ for channel in server_channels(server_id_in)
+ loop
+ unsubscribe_server(server_id_in, channel.channel_id, 1, 1, deleting_server, update_family_countsYN);
+ end loop channel;
+ END clear_subscriptions;
+
+ PROCEDURE unsubscribe_server(server_id_in IN NUMBER, channel_id_in NUMBER, immediate_in NUMBER := 1, unsubscribe_children_in number := 0,
+ deleting_server IN NUMBER := 0,
+ update_family_countsYN IN NUMBER := 1)
+ IS
+ channel_family_id_val NUMBER;
+ server_org_id_val NUMBER;
+ available_subscriptions NUMBER;
+ server_already_in_chan BOOLEAN;
+ cursor channel_family_is_proxy(channel_family_id_in in number) is
+ select 1
+ from rhnChannelFamily
+ where id = channel_family_id_in
+ and label = 'rhn-proxy';
+ cursor channel_family_is_satellite(channel_family_id_in in number) is
+ select 1
+ from rhnChannelFamily
+ where id = channel_family_id_in
+ and label = 'rhn-satellite';
+ -- this is *EXACTLY* like check_server_parent_membership, but if we recurse
+ -- with the package-level one, we get a "cursor already open", so we need a
+ -- copy on our call stack instead. GROAN.
+ cursor local_chk_server_parent_memb (
+ server_id_in number,
+ channel_id_in number ) is
+ select c.id
+ from rhnChannel c,
+ rhnServerChannel sc
+ where 1=1
+ and c.parent_channel = channel_id_in
+ and c.id = sc.channel_id
+ and sc.server_id = server_id_in;
+ BEGIN
+ FOR child IN local_chk_server_parent_memb(server_id_in, channel_id_in)
+ LOOP
+ if unsubscribe_children_in = 1 then
+ unsubscribe_server(server_id_in => server_id_in,
+ channel_id_in => child.id,
+ immediate_in => immediate_in,
+ unsubscribe_children_in => unsubscribe_children_in,
+ deleting_server => deleting_server,
+ update_family_countsYN => update_family_countsYN);
+ else
+ rhn_exception.raise_exception('channel_unsubscribe_child_exists');
+ end if;
+ END LOOP child;
+
+ server_already_in_chan := FALSE;
+
+ FOR check_subscription IN check_server_subscription(server_id_in, channel_id_in)
+ LOOP
+ server_already_in_chan := TRUE;
+ END LOOP check_subscription;
+
+ IF NOT server_already_in_chan
+ THEN
+ RETURN;
+ END IF;
+
+ if deleting_server = 0 then
+
+ insert into rhnServerHistory (id,server_id,summary,details) (
+ select rhn_event_id_seq.nextval,
+ server_id_in,
+ 'unsubscribed from channel ' || SUBSTR(c.label, 0, 106),
+ c.label
+ from rhnChannel c
+ where c.id = channel_id_in
+ );
+
+ UPDATE rhnServer SET channels_changed = sysdate WHERE id = server_id_in;
+ end if;
+
+ DELETE FROM rhnServerChannel WHERE server_id = server_id_in AND channel_id = channel_id_in;
+
+ if deleting_server = 0 then
+ queue_server(server_id_in, immediate_in);
+ end if;
+
+ channel_family_id_val := rhn_channel.family_for_channel(channel_id_in);
+ IF channel_family_id_val IS NULL
+ THEN
+ rhn_exception.raise_exception('channel_unsubscribe_no_family');
+ END IF;
+
+ for ignore in channel_family_is_satellite(channel_family_id_val) loop
+ delete from rhnSatelliteInfo where server_id = server_id_in;
+ delete from rhnSatelliteChannelFamily where server_id = server_id_in;
+ end loop;
+
+ for ignore in channel_family_is_proxy(channel_family_id_val) loop
+ delete from rhnProxyInfo where server_id = server_id_in;
+ end loop;
+ SELECT org_id INTO server_org_id_val
+ FROM rhnServer
+ WHERE id = server_id_in;
+
+ if update_family_countsYN = 1 then
+ rhn_channel.update_family_counts(channel_family_id_val, server_org_id_val);
+ end if;
+ END unsubscribe_server;
+
+
+ FUNCTION family_for_channel(channel_id_in IN NUMBER)
+ RETURN NUMBER
+ IS
+ channel_family_id_val NUMBER;
+ BEGIN
+ SELECT channel_family_id INTO channel_family_id_val
+ FROM rhnChannelFamilyMembers
+ WHERE channel_id = channel_id_in;
+
+ RETURN channel_family_id_val;
+ EXCEPTION
+ WHEN NO_DATA_FOUND
+ THEN
+ RETURN NULL;
+ END family_for_channel;
+
+ FUNCTION available_family_subscriptions(channel_family_id_in IN NUMBER, org_id_in IN NUMBER)
+ RETURN NUMBER
+ IS
+ cfp channel_family_perm_cursor%ROWTYPE;
+ current_members_val NUMBER;
+ max_members_val NUMBER;
+ found NUMBER;
+ BEGIN
+ IF NOT channel_family_perm_cursor%ISOPEN
+ THEN
+ OPEN channel_family_perm_cursor(channel_family_id_in, org_id_in);
+ END IF;
+
+ FETCH channel_family_perm_cursor INTO cfp;
+
+ WHILE channel_family_perm_cursor%FOUND
+ LOOP
+ found := 1;
+
+ current_members_val := cfp.current_members;
+ max_members_val := cfp.max_members;
+
+ FETCH channel_family_perm_cursor INTO cfp;
+ END LOOP;
+
+ IF channel_family_perm_cursor%ISOPEN
+ THEN
+ CLOSE channel_family_perm_cursor;
+ END IF;
+
+ -- not found: either the channel fam doesn't have an entry in cfp, or the org doesn't have access to it.
+ -- either way, there are no available subscriptions
+
+ IF found IS NULL
+ THEN
+ RETURN 0;
+ END IF;
+
+ -- null max members? in that case, pass it on; NULL means infinite
+ IF max_members_val IS NULL
+ THEN
+ RETURN NULL;
+ END IF;
+
+ -- otherwise, return the delta
+ RETURN max_members_val - current_members_val;
+ END available_family_subscriptions;
+
+ -- *******************************************************************
+ -- FUNCTION: channel_family_current_members
+ -- Calculates and returns the actual count of systems consuming
+ -- physical channel subscriptions.
+ -- Called by: update_family_counts
+ -- rhn_entitlements.repoll_virt_guest_entitlements
+ -- *******************************************************************
+ function channel_family_current_members(channel_family_id_in IN NUMBER,
+ org_id_in IN NUMBER)
+ return number
+ is
+ current_members_count number := 0;
+ begin
+ select count(distinct server_id)
+ into current_members_count
+ from rhnChannelFamilyServerPhysical cfsp
+ where cfsp.channel_family_id = channel_family_id_in
+ and cfsp.customer_id = org_id_in;
+ return current_members_count;
+ end;
+
+ PROCEDURE update_family_counts(channel_family_id_in IN NUMBER,
+ org_id_in IN NUMBER)
+ IS
+ BEGIN
+ update rhnPrivateChannelFamily
+ set current_members = (
+ channel_family_current_members(channel_family_id_in, org_id_in)
+ )
+ where org_id = org_id_in
+ and channel_family_id = channel_family_id_in;
+
+ END update_family_counts;
+
+ PROCEDURE update_group_family_counts(group_label_in IN VARCHAR2,
+ org_id_in IN NUMBER)
+ IS
+ BEGIN
+ FOR i IN (
+ SELECT DISTINCT CFM.channel_family_id, SG.org_id
+ FROM rhnChannelFamilyMembers CFM
+ JOIN rhnServerChannel SC
+ ON SC.channel_id = CFM.channel_id
+ JOIN rhnServerGroupMembers SGM
+ ON SC.server_id = SGM.server_id
+ JOIN rhnServerGroup SG
+ ON SGM.server_group_id = SG.id
+ JOIN rhnServerGroupType SGT
+ ON SG.group_type = SGT.id
+ WHERE SGT.label = group_label_in
+ AND SG.org_id = org_id_in
+ AND SGT.is_base = 'Y'
+ ) LOOP
+ rhn_channel.update_family_counts(i.channel_family_id, i.org_id);
+ END LOOP;
+ END update_group_family_counts;
+
+ FUNCTION available_chan_subscriptions(channel_id_in IN NUMBER,
+ org_id_in IN NUMBER)
+ RETURN NUMBER
+ IS
+ channel_family_id_val NUMBER;
+ BEGIN
+ SELECT channel_family_id INTO channel_family_id_val
+ FROM rhnChannelFamilyMembers
+ WHERE channel_id = channel_id_in;
+
+ RETURN rhn_channel.available_family_subscriptions(
+ channel_family_id_val, org_id_in);
+ END available_chan_subscriptions;
+
+ -- *******************************************************************
+ -- PROCEDURE: entitle_customer
+ -- Creates a chan fam bucket, or sets max_members for an existing bucket
+ -- Called by: rhn_ep.poll_customer_internal
+ -- Calls: set_family_maxmembers + update_family_counts if the row
+ -- already exists, else it creates it in rhnPrivateChannelFamily.
+ -- *******************************************************************
+ procedure entitle_customer(customer_id_in in number,
+ channel_family_id_in in number,
+ quantity_in in number)
+ is
+ cursor permissions is
+ select 1
+ from rhnPrivateChannelFamily pcf
+ where pcf.org_id = customer_id_in
+ and pcf.channel_family_id = channel_family_id_in;
+ begin
+ for perm in permissions loop
+ set_family_maxmembers(
+ customer_id_in,
+ channel_family_id_in,
+ quantity_in
+ );
+ rhn_channel.update_family_counts(
+ channel_family_id_in,
+ customer_id_in
+ );
+ return;
+ end loop;
+
+ insert into rhnPrivateChannelFamily pcf (
+ channel_family_id, org_id, max_members, current_members
+ ) values (
+ channel_family_id_in, customer_id_in, quantity_in, 0
+ );
+ end;
+
+ -- *******************************************************************
+ -- PROCEDURE: set_family_maxmembers
+ -- Prunes an existing channel family bucket by unsubscribing the
+ -- necessary servers and sets max_members.
+ -- Called by: rhn_channel.entitle_customer
+ -- Calls: unsubscribe_server_from_family
+ -- *******************************************************************
+ procedure set_family_maxmembers(customer_id_in in number,
+ channel_family_id_in in number,
+ quantity_in in number)
+ is
+ cursor servers is
+ select server_id from (
+ select rownum row_number, server_id, modified from (
+ select rcfsp.server_id,
+ rcfsp.modified
+ from rhnChannelFamilyServerPhysical rcfsp
+ where rcfsp.customer_id = customer_id_in
+ and rcfsp.channel_family_id = channel_family_id_in
+ order by modified
+ )
+ where rownum > quantity_in
+ );
+ begin
+ -- prune subscribed servers
+ for server in servers loop
+ rhn_channel.unsubscribe_server_from_family(server.server_id,
+ channel_family_id_in);
+ end loop;
+
+ update rhnPrivateChannelFamily pcf
+ set pcf.max_members = quantity_in
+ where pcf.org_id = customer_id_in
+ and pcf.channel_family_id = channel_family_id_in;
+ end;
+
+ procedure unsubscribe_server_from_family(server_id_in in number,
+ channel_family_id_in in number)
+ is
+ begin
+ delete
+ from rhnServerChannel rsc
+ where rsc.server_id = server_id_in
+ and channel_id in (
+ select rcfm.channel_id
+ from rhnChannelFamilyMembers rcfm
+ where rcfm.channel_family_id = channel_family_id_in);
+ end;
+
+ function get_org_id(channel_id_in in number)
+ return number
+ is
+ org_id_out number;
+ begin
+ select org_id into org_id_out
+ from rhnChannel
+ where id = channel_id_in;
+
+ return org_id_out;
+ end get_org_id;
+
+ function get_cfam_org_access(cfam_id_in in number, org_id_in in number)
+ return number
+ is
+ cursor families is
+ select 1
+ from rhnOrgChannelFamilyPermissions cfp
+ where cfp.org_id = org_id_in;
+ begin
+ -- the idea: if we get past this query,
+ -- the user has the role, else catch the exception and return 0
+ for family in families loop
+ return 1;
+ end loop;
+ return 0;
+ end;
+
+ function get_org_access(channel_id_in in number, org_id_in in number)
+ return number
+ is
+ throwaway number;
+ begin
+ -- the idea: if we get past this query,
+ -- the org has access to the channel, else catch the exception and return 0
+ select distinct 1 into throwaway
+ from rhnChannelFamilyMembers CFM,
+ rhnOrgChannelFamilyPermissions CFP
+ where cfp.org_id = org_id_in
+ and CFM.channel_family_id = CFP.channel_family_id
+ and CFM.channel_id = channel_id_in
+ and (CFP.max_members > 0 or CFP.max_members is null or CFP.org_id = 1);
+
+ return 1;
+ exception
+ when no_data_found
+ then
+ return 0;
+ end;
+
+ -- check if a user has a given role, or if such a role is inferrable
+ function user_role_check_debug(channel_id_in in number,
+ user_id_in in number,
+ role_in in varchar2,
+ reason_out out varchar2)
+ return number
+ is
+ org_id number;
+ begin
+ org_id := rhn_user.get_org_id(user_id_in);
+
+ -- channel might be shared
+ if role_in = 'subscribe' and
+ rhn_channel.shared_user_role_check(channel_id_in, user_id_in, role_in) = 1 then
+ return 1;
+ end if;
+
+ if role_in = 'manage' and
+ NVL(rhn_channel.get_org_id(channel_id_in), -1) <> org_id then
+ reason_out := 'channel_not_owned';
+ return 0;
+ end if;
+
+ if role_in = 'subscribe' and
+ rhn_channel.get_org_access(channel_id_in, org_id) = 0 then
+ reason_out := 'channel_not_available';
+ return 0;
+ end if;
+
+ -- channel admins have all roles
+ if rhn_user.check_role_implied(user_id_in, 'channel_admin') = 1 then
+ reason_out := 'channel_admin';
+ return 1;
+ end if;
+
+ -- the subscribe permission is inferred
+ -- UNLESS the not_globally_subscribable flag is set
+ if role_in = 'subscribe'
+ then
+ if rhn_channel.org_channel_setting(channel_id_in,
+ org_id,
+ 'not_globally_subscribable') = 0 then
+ reason_out := 'globally_subscribable';
+ return 1;
+ end if;
+ end if;
+
+ -- all other roles (manage right now) are explicitly granted
+ reason_out := 'direct_permission';
+ return rhn_channel.direct_user_role_check(channel_id_in,
+ user_id_in, role_in);
+ end;
+
+ -- same as above, but with no OUT param; useful in views, etc
+ function user_role_check(channel_id_in in number, user_id_in in number, role_in in varchar2)
+ return number
+ is
+ throwaway varchar2(256);
+ begin
+ return rhn_channel.user_role_check_debug(channel_id_in, user_id_in, role_in, throwaway);
+ end;
+
+ --
+ -- For multiorg phase II, this function simply checks to see if the user's
+ -- has a trust relationship that includes this channel by id.
+ --
+ function shared_user_role_check(channel_id in number, user_id in number, role in varchar2)
+ return number
+ is
+ n number;
+ oid number;
+ begin
+ oid := rhn_user.get_org_id(user_id);
+ select 1 into n
+ from rhnSharedChannelView s
+ where s.id = channel_id and s.org_trust_id = oid;
+ return 1;
+ exception
+ when no_data_found then
+ return 0;
+ end;
+
+ -- same as above, but returns 1 if user_id_in is null
+ -- This is useful in queries where user_id is not specified
+ function loose_user_role_check(channel_id_in in number, user_id_in in number, role_in in varchar2)
+ return number
+ is
+ begin
+ if user_id_in is null then
+ return 1;
+ end if;
+ return user_role_check(channel_id_in, user_id_in, role_in);
+ end loose_user_role_check;
+
+ -- directly checks the table, no inferred permissions
+ function direct_user_role_check(channel_id_in in number, user_id_in in number, role_in in varchar2)
+ return number
+ is
+ throwaway number;
+ begin
+ -- the idea: if we get past this query, the user has the role, else catch the exception and return 0
+ select 1 into throwaway
+ from rhnChannelPermissionRole CPR,
+ rhnChannelPermission CP
+ where CP.user_id = user_id_in
+ and CP.channel_id = channel_id_in
+ and CPR.label = role_in
+ and CP.role_id = CPR.id;
+
+ return 1;
+ exception
+ when no_data_found
+ then
+ return 0;
+ end;
+
+ -- check if an org has a certain setting
+ function org_channel_setting(channel_id_in in number, org_id_in in number, setting_in in varchar2)
+ return number
+ is
+ throwaway number;
+ begin
+ -- the idea: if we get past this query, the org has the setting, else catch the exception and return 0
+ select 1 into throwaway
+ from rhnOrgChannelSettingsType OCST,
+ rhnOrgChannelSettings OCS
+ where OCS.org_id = org_id_in
+ and OCS.channel_id = channel_id_in
+ and OCST.label = setting_in
+ and OCS.setting_id = OCST.id;
+
+ return 1;
+ exception
+ when no_data_found
+ then
+ return 0;
+ end;
+
+ FUNCTION channel_priority(channel_id_in IN number)
+ RETURN number
+ IS
+ channel_name varchar2(256);
+ priority number;
+ end_of_life_val date;
+ org_id_val number;
+ BEGIN
+
+ select name, end_of_life, org_id
+ into channel_name, end_of_life_val, org_id_val
+ from rhnChannel
+ where id = channel_id_in;
+
+ if end_of_life_val is not null then
+ return -400;
+ end if;
+
+ if channel_name like 'Red Hat Enterprise Linux%' or channel_name like 'RHEL%' then
+ priority := 1000;
+ if channel_name not like '%Beta%' then
+ priority := priority + 1000;
+ end if;
+
+ priority := priority +
+ case
+ when channel_name like '%v. 5%' then 600
+ when channel_name like '%v. 4%' then 500
+ when channel_name like '%v. 3%' then 400
+ when channel_name like '%v. 2%' then 300
+ when channel_name like '%v. 1%' then 200
+ else 0
+ end;
+
+ priority := priority +
+ case
+ when channel_name like 'Red Hat Enterprise Linux (v. 5%' then 60
+ when (channel_name like '%AS%' and channel_name not like '%Extras%') then 50
+ when (channel_name like '%ES%' and channel_name not like '%Extras%') then 40
+ when (channel_name like '%WS%' and channel_name not like '%Extras%') then 30
+ when (channel_name like '%Desktop%' and channel_name not like '%Extras%') then 20
+ when channel_name like '%Extras%' then 10
+ else 0
+ end;
+
+ priority := priority +
+ case
+ when channel_name like '%)' then 5
+ else 0
+ end;
+
+ priority := priority +
+ case
+ when channel_name like '%32-bit x86%' then 4
+ when channel_name like '%64-bit Intel Itanium%' then 3
+ when channel_name like '%64-bit AMD64/Intel EM64T%' then 2
+ else 0
+ end;
+ elsif channel_name like 'Red Hat Desktop%' then
+ priority := 900;
+
+ if channel_name not like '%Beta%' then
+ priority := priority + 50;
+ end if;
+
+ priority := priority +
+ case
+ when channel_name like '%v. 4%' then 40
+ when channel_name like '%v. 3%' then 30
+ when channel_name like '%v. 2%' then 20
+ when channel_name like '%v. 1%' then 10
+ else 0
+ end;
+
+ priority := priority +
+ case
+ when channel_name like '%32-bit x86%' then 4
+ when channel_name like '%64-bit Intel Itanium%' then 3
+ when channel_name like '%64-bit AMD64/Intel EM64T%' then 2
+ else 0
+ end;
+
+ elsif org_id_val is not null then
+ priority := 600;
+ else
+ priority := 500;
+ end if;
+
+ return -priority;
+
+ end channel_priority;
+
+ -- right now this only does the accounting changes; the cascade
+ -- actually does the rhnServerChannel delete.
+ procedure delete_server_channels(server_id_in in number)
+ is
+ begin
+ update rhnPrivateChannelFamily
+ set current_members = current_members -1
+ where org_id in (
+ select org_id
+ from rhnServer
+ where id = server_id_in
+ )
+ and channel_family_id in (
+ select rcfm.channel_family_id
+ from rhnChannelFamilyMembers rcfm,
+ rhnServerChannel rsc
+ where rsc.server_id = server_id_in
+ and rsc.channel_id = rcfm.channel_id
+ and not exists (
+ select 1
+ from
+ rhnChannelFamilyVirtSubLevel cfvsl,
+ rhnSGTypeVirtSubLevel sgtvsl,
+ rhnServerEntitlementView sev,
+ rhnVirtualInstance vi
+ where
+ -- system is a virtual instance
+ vi.virtual_system_id = server_id_in
+ and vi.host_system_id = sev.server_id
+ -- system's host has a virt ent
+ and sev.label in ('virtualization_host',
+ 'virtualization_host_platform')
+ and sev.server_group_type_id =
+ sgtvsl.server_group_type_id
+ -- the host's virt ent grants a cf virt sub level
+ and sgtvsl.virt_sub_level_id = cfvsl.virt_sub_level_id
+ -- the cf is in that virt sub level
+ and cfvsl.channel_family_id = rcfm.channel_family_id
+ )
+ );
+ end;
+
+ -- this could certainly be optimized to do updates if needs be
+ procedure refresh_newest_package(channel_id_in in number, caller_in in varchar2 := '(unknown)')
+ is
+ begin
+ delete from rhnChannelNewestPackage where channel_id = channel_id_in;
+ insert into rhnChannelNewestPackage
+ ( channel_id, name_id, evr_id, package_id, package_arch_id )
+ ( select channel_id,
+ name_id, evr_id,
+ package_id, package_arch_id
+ from rhnChannelNewestPackageView
+ where channel_id = channel_id_in
+ );
+ insert into rhnChannelNewestPackageAudit (channel_id, caller)
+ values (channel_id_in, caller_in);
+ update rhnChannel
+ set last_modified = greatest(sysdate, last_modified + 1/86400)
+ where id = channel_id_in;
+ end;
+
+ procedure update_channel ( channel_id_in in number, invalidate_ss in number := 0,
+ date_to_use in date := sysdate )
+ is
+
+ channel_last_modified date;
+ last_modified_value date;
+
+ cursor snapshots is
+ select snapshot_id id
+ from rhnSnapshotChannel
+ where channel_id = channel_id_in;
+
+ begin
+
+ select last_modified
+ into channel_last_modified
+ from rhnChannel
+ where id = channel_id_in;
+
+ last_modified_value := date_to_use;
+
+ if last_modified_value <= channel_last_modified then
+ last_modified_value := last_modified_value + 1/86400;
+ end if;
+
+ update rhnChannel set last_modified = last_modified_value
+ where id = channel_id_in;
+
+ if invalidate_ss = 1 then
+ for snapshot in snapshots loop
+ update rhnSnapshot
+ set invalid = lookup_snapshot_invalid_reason('channel_modified')
+ where id = snapshot.id;
+ end loop;
+ end if;
+
+ end update_channel;
+
+ procedure update_channels_by_package ( package_id_in in number, date_to_use in date := sysdate )
+ is
+
+ cursor channels is
+ select channel_id
+ from rhnChannelPackage
+ where package_id = package_id_in
+ order by channel_id;
+
+ begin
+ for channel in channels loop
+ -- we want to invalidate the snapshot assocated with the channel when we
+ -- do this b/c we know we've added or removed or packages
+ rhn_channel.update_channel ( channel.channel_id, 1, date_to_use );
+ end loop;
+ end update_channels_by_package;
+
+
+ procedure update_channels_by_errata ( errata_id_in number, date_to_use in date := sysdate )
+ is
+
+ cursor channels is
+ select channel_id
+ from rhnChannelErrata
+ where errata_id = errata_id_in
+ order by channel_id;
+
+ begin
+ for channel in channels loop
+ -- we won't invalidate snapshots, b/c just changing the errata associated with
+ -- a channel shouldn't invalidate snapshots
+ rhn_channel.update_channel ( channel.channel_id, 0, date_to_use );
+ end loop;
+ end update_channels_by_errata;
+
+END rhn_channel;
+/
+SHOW ERRORS
+
+--
+-- Revision 1.75 2005/03/04 00:04:19 jslagle
+-- bz #147617
+-- Made Red Hat Desktop sort a little better.
+--
+-- Revision 1.74 2005/02/22 03:24:47 jslagle
+-- bz #147617
+-- Improve channel_priority function to order channels better.
+--
+-- Revision 1.73 2004/08/16 20:39:30 pjones
+-- bugzilla: 129889 -- make bulk_server_basechange_from() actually work.
+--
+-- Revision 1.72 2004/04/14 00:09:24 pjones
+-- bugzilla: 120761 -- split rhnChannelPermissions into two tables, eliminating
+-- a frequent full table scan
+--
+-- Revision 1.71 2004/04/13 16:28:36 bretm
+-- bugzilla: 119871
+--
+-- keep track of rhnServer.channels_changed through the pl/sql fns
+--
+-- Revision 1.70 2004/03/26 18:11:32 rbb
+-- Bugzilla: 114057
+--
+-- Add a script to determine channel priority.
+--
+-- Revision 1.69 2004/02/17 20:16:52 pjones
+-- bugzilla: none -- add cvs tags into the package as long as we're touching
+-- it anyway
+--
+-- Revision 1.68 2004/02/17 20:05:38 pjones
+-- bugzilla: 115782 -- make bulk_server_basechange_from() filter out servers
+-- with arches incompatible with the target channel
+--
+-- Revision 1.67 2004/02/06 02:36:10 misa
+-- Changed normalize_server_arch to allow for solaris arches
+--
+-- Revision 1.66 2003/11/13 16:58:34 cturner
+-- make use of new rhn_user.check_role_implied call; pragmas broke, removed them for now since I have no idea how to fix them
+--
+-- Revision 1.65 2003/10/23 20:26:24 bretm
+-- bugzilla: none
+--
+-- note the channel label when we unsubscribe, too
+--
+-- Revision 1.64 2003/10/15 14:47:17 bretm
+-- bugzilla: none
+--
+-- add the channel label to the server history summary line when we log a channel change
+--
+-- Revision 1.63 2003/09/24 19:25:56 pjones
+-- this wasn't the right fix, put it back
+--
+-- Revision 1.62 2003/09/24 17:42:19 pjones
+-- bugzilla: none
+--
+-- limit our server base channel guess to channels with available permissions
+--
+-- Revision 1.61 2003/09/22 21:00:40 cturner
+-- add method for easy acl check
+--
+-- Revision 1.60 2003/09/17 22:14:11 misa
+-- bugzilla: 103639 Changes to allow me to move the base channel guess into plsql
+--
+-- Revision 1.59 2003/08/21 13:41:17 cturner
+-- bugzilla: 99187. properly test for satellite and proxy in bulk_guess_server_base; reorg code for better reuse
+--
+-- Revision 1.58 2003/07/24 16:46:22 cturner
+-- bugzilla: 100723, the perm check was returning duplicates, so now it just calls the function it should have called anyway
+--
+-- Revision 1.57 2003/07/24 16:44:16 misa
+-- bugzilla: none A function more usable on the rhnapp side
+--
+-- Revision 1.56 2003/07/23 22:36:51 cturner
+-- argh, max returns null even when now rows; use distinct. how revolting
+--
+-- Revision 1.55 2003/07/23 22:01:31 cturner
+-- oops, this one can return multiple rows; eliminate that in a lazy way
+--
+-- Revision 1.54 2003/07/23 21:59:19 cturner
+-- rework how rhnUserChannel works; move to plsql for speed and maintenance
+--
+-- Revision 1.53 2003/07/21 17:49:12 pjones
+-- bugzilla: none
+--
+-- add optional user for subscribe_server
+--
+-- Revision 1.52 2003/07/14 22:19:29 misa
+-- bugzilla: none Updating guess_base_channel to work more like the rhnapp server code
+--
+-- Revision 1.51 2003/06/26 22:09:04 pjones
+-- bugzilla: none
+--
+-- log subscribe and unsubscribe
+--
+-- Revision 1.50 2003/06/05 19:31:15 pjones
+-- bugzilla: 88278 -- make the cursor name smaller
+--
+-- Revision 1.49 2003/06/05 19:18:21 pjones
+-- bugzilla: 88278
+--
+-- unsubscribe_server() opens the package-level cursor when it invokes itself,
+-- so we're using a local copy instead.
+--
+-- Revision 1.48 2003/06/04 16:41:39 pjones
+-- bugzilla: none
+--
+-- make bulk_guess_server_base() silently ignore unguessables
+--
+-- Revision 1.47 2003/06/04 16:27:03 pjones
+-- bugzilla: 88822
+--
+-- eliminate the last outliers that remove things from channels without using
+-- unsubscribe_server, I think.
+--
+-- Revision 1.46 2003/06/03 20:49:37 pjones
+-- bugzilla: 88822
+-- unsubscribing from rhn-satellite now clears rhnSatelliteChannelFamily
+-- for the server in question
+--
+-- Revision 1.45 2003/06/02 20:41:45 pjones
+-- bugzilla: none - fix rhnProxyInfo/rhnSatelliteInfo channel unsubscribe
+-- problem. Basicly, if you're out of the channel for any reason, you're
+-- also out of rhnProxyInfo/rhnProxyInfo
+--
+-- Revision 1.44 2003/03/24 15:26:28 pjones
+-- bugzilla: 85812
+--
+-- bulk_server_base_change silently ignores servers that are satellites
+-- or proxies, as requested.
+--
+-- Revision 1.43 2003/02/26 20:28:17 pjones
+-- rhn_channel.update_family_counts() in rhn_channel.entitle_customer()
+-- the old codepath is:
+--
+-- ep ->
+-- rhn_ep.entitlement_run_me() ->
+-- rhn_ep.poll_customer() ->
+-- rhn_channel.entitle_customer()
+--
+-- which doesn't change current_members, even though it may remove servers
+-- from the family.
+--
+-- There's another bug here: currently, we don't try to order forced
+-- unsubscribes in any way; we just use
+-- rhn_channel.unsubscribe_server_from_family . If there are any child
+-- channel subscriptions, this will leave them subscribed. We really need
+-- to iterate across the channels again, and subscribe any channel for which
+-- there are no parent channel subscriptions.
+--
+-- Ugh.
+--
+-- Revision 1.42 2003/01/28 00:19:45 pjones
+-- fix clear_subscriptions; AFAICT, this is only hit on the
+-- bulk_server_base_change / bulk_server_base_guess codepaths, which puts
+-- it infrequent enough that it could be our "bad count" culprit.
+--
+-- Revision 1.41 2003/01/14 19:51:45 pjones
+-- make setting current_members on rhnChannelFamilyPermissions work when
+-- a server is in more than one channel in a single family.
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/100-drop-rhnChannelFamilyLicense-tables.sql b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/100-drop-rhnChannelFamilyLicense-tables.sql
new file mode 100644
index 0000000..5bd06db
--- /dev/null
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.0-to-spacewalk-schema-1.1/100-drop-rhnChannelFamilyLicense-tables.sql
@@ -0,0 +1,23 @@
+--
+-- 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.
+--
+--
+--
+--
+drop trigger rhn_cf_license_mod_trig;
+drop trigger rhn_cfl_consent_mod_trig;
+drop table rhnChannelFamilyLicense;
+drop table rhnChannelFamilyLicenseConsent;
+
+
commit cf366a1603dc7c3610e429444354feec9163b043
Author: Partha Aji <paji(a)redhat.com>
Date: Fri Jun 18 11:40:15 2010 -0400
Good Bye Channel License Code
diff --git a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
index 00cf97e..69eefd8 100644
--- a/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
+++ b/java/code/src/com/redhat/rhn/common/db/datasource/xml/Channel_queries.xml
@@ -867,11 +867,9 @@ SELECT C.id, C.name, C.label, 1 AS IS_CUSTOM
SELECT DISTINCT C.id,
C.label,
C.name,
- C.summary,
- CFL.channel_family_id AS HAS_LICENSE,
+ C.summary
C.gpg_key_url
- FROM rhnChannelFamilyLicense CFL,
- rhnChannelFamilyMembers CFM,
+ FROM rhnChannelFamilyMembers CFM,
rhnChannel C,
rhnUserChannel UC
WHERE UC.user_id = :user_id
@@ -881,7 +879,6 @@ SELECT DISTINCT C.id,
AND C.id = CFM.channel_id
AND C.parent_channel IS NOT NULL
AND NOT EXISTS (SELECT 1 FROM rhnServerChannel WHERE server_id = :server_id AND channel_id = C.id)
- AND CFM.channel_family_id = CFL.channel_family_id (+)
</query>
</mode>
diff --git a/java/code/src/com/redhat/rhn/common/security/acl/ChannelAclHandler.java b/java/code/src/com/redhat/rhn/common/security/acl/ChannelAclHandler.java
index 17d4061..47e6042 100644
--- a/java/code/src/com/redhat/rhn/common/security/acl/ChannelAclHandler.java
+++ b/java/code/src/com/redhat/rhn/common/security/acl/ChannelAclHandler.java
@@ -17,7 +17,6 @@ package com.redhat.rhn.common.security.acl;
import com.redhat.rhn.common.db.datasource.DataResult;
import com.redhat.rhn.domain.channel.Channel;
import com.redhat.rhn.domain.channel.ChannelFactory;
-import com.redhat.rhn.domain.channel.ChannelFamilyFactory;
import com.redhat.rhn.domain.channel.ChannelVersion;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.manager.channel.ChannelManager;
@@ -183,24 +182,7 @@ public class ChannelAclHandler extends BaseHandler {
return false;
}
}
-
- /**
- * Does this channel have an associated license to be displayed?
- * rhnChannel<--rhnChannelFamilyMembers-->rhnChannelFamily<--rhnChannelFamilyLicense
- * @param ctx request context (user, cid)
- * @param params check parameters
- * @return true if allowed, false else
- */
- public boolean aclChannelLicensed(Object ctx, String[] params) {
- HashMap ctxMap = (HashMap)ctx;
- User usr = (User)ctxMap.get(USER);
- Channel chan = getChannel(usr, ctxMap);
- return (chan != null &&
- chan.getChannelFamily() != null &&
- ChannelFamilyFactory.lookupLicense(
- chan.getChannelFamily().getId()) != null);
- }
-
+
/**
* Does the channel have anything to download?
* @param ctx request context (user,cid)
diff --git a/java/code/src/com/redhat/rhn/domain/channel/ChannelFamily.hbm.xml b/java/code/src/com/redhat/rhn/domain/channel/ChannelFamily.hbm.xml
index 0a3888b..a64a2d4 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/ChannelFamily.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/channel/ChannelFamily.hbm.xml
@@ -50,16 +50,4 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
<query name="ChannelFamily.findByOrgId">
<![CDATA[from com.redhat.rhn.domain.channel.ChannelFamily as cfam where cfam.org.id = :orgId]]>
</query>
-
- <sql-query name="ChannelFamily.findLicensePath">
- <return-scalar column="LICENSE_PATH" type="string" />
- <![CDATA[
- SELECT
- LICENSE_PATH
- FROM
- RHNCHANNELFAMILYLICENSE
- WHERE
- CHANNEL_FAMILY_ID = :id
- ]]>
- </sql-query>
</hibernate-mapping>
diff --git a/java/code/src/com/redhat/rhn/domain/channel/ChannelFamilyFactory.java b/java/code/src/com/redhat/rhn/domain/channel/ChannelFamilyFactory.java
index f414335..5a39bc9 100644
--- a/java/code/src/com/redhat/rhn/domain/channel/ChannelFamilyFactory.java
+++ b/java/code/src/com/redhat/rhn/domain/channel/ChannelFamilyFactory.java
@@ -203,17 +203,5 @@ public class ChannelFamilyFactory extends HibernateFactory {
Restrictions.isNull("org")));
return c.list();
}
-
- /**
- * Returns the license-path for this channel-family, if one exists.
- * @param cid Channel-Family-Id whose license we're looking forl we want.
- * @return String containing the license-text pathm or null if not found
- */
- public static String lookupLicense(Long cid) {
- Map params = new HashMap();
- params.put("id", cid);
- return (String) singleton.lookupObjectByNamedQuery(
- "ChannelFamily.findLicensePath", params);
- }
}
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 6421bef..58557cc 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
@@ -685,8 +685,7 @@ public class SystemHandler extends BaseHandler {
channel.put("label", row.get("label"));
channel.put("name", row.get("name"));
channel.put("summary", row.get("summary"));
- channel.put("has_license", StringUtils.defaultString(
- (String) row.get("has_license")));
+ channel.put("has_license", "");
channel.put("gpg_key_url", StringUtils.defaultString(
(String) row.get("gpg_key_url")));
diff --git a/java/code/webapp/WEB-INF/nav/channel_detail.xml b/java/code/webapp/WEB-INF/nav/channel_detail.xml
index 991bef8..7178253 100644
--- a/java/code/webapp/WEB-INF/nav/channel_detail.xml
+++ b/java/code/webapp/WEB-INF/nav/channel_detail.xml
@@ -31,6 +31,5 @@
<rhn-tab-url>/rhn/channels/TargetSystemsConfirm.do</rhn-tab-url>
</rhn-tab>
<rhn-tab name="Downloads" acl="org_is_paying_customer(); channel_has_downloads()" url="/rhn/software/channel/downloads/Download.do" />
- <rhn-tab name="License" acl="channel_licensed()" url="/network/software/channels/display_license.pxt" />
</rhn-navi-tree>
diff --git a/java/code/webapp/WEB-INF/nav/system_detail.xml b/java/code/webapp/WEB-INF/nav/system_detail.xml
index ea57a2f..2b6c4c9 100644
--- a/java/code/webapp/WEB-INF/nav/system_detail.xml
+++ b/java/code/webapp/WEB-INF/nav/system_detail.xml
@@ -79,7 +79,6 @@
<rhn-tab name="Software Channels" acl="system_feature(ftr_package_updates)">
<rhn-tab-url>/rhn/systems/details/SystemChannels.do</rhn-tab-url>
- <rhn-tab-url>/network/systems/details/channel_license.pxt</rhn-tab-url>
</rhn-tab>
</rhn-tab>
diff --git a/web/conf/rhn_web.conf b/web/conf/rhn_web.conf
index 4e94b63..b032acf 100644
--- a/web/conf/rhn_web.conf
+++ b/web/conf/rhn_web.conf
@@ -15,9 +15,6 @@ web.post_max = 512000
# host bounces should be set to
-# Location of external channel family licenses (ex. BEA JRockit, etc)
-web.channel_licenses_path =
-
# offset for the database's timezone from utc
web.db_tz_offset = 0
diff --git a/web/html/nav/channel_detail.xml b/web/html/nav/channel_detail.xml
index 0a92216..b0c0864 100644
--- a/web/html/nav/channel_detail.xml
+++ b/web/html/nav/channel_detail.xml
@@ -29,6 +29,5 @@
<rhn-tab-url>/network/software/channels/target_systems.pxt</rhn-tab-url>
</rhn-tab>
<rhn-tab name="Downloads" acl="org_is_paying_customer(); channel_has_downloads()" url="/rhn/software/channel/downloads/Download.do" />
- <rhn-tab name="License" acl="channel_licensed()" url="/network/software/channels/display_license.pxt" />
</rhn-navi-tree>
diff --git a/web/html/nav/system_detail.xml b/web/html/nav/system_detail.xml
index 86987bf..216426c 100644
--- a/web/html/nav/system_detail.xml
+++ b/web/html/nav/system_detail.xml
@@ -78,7 +78,6 @@
<rhn-tab name="Software Channels" acl="system_feature(ftr_package_updates)">
<rhn-tab-url>/rhn/systems/details/SystemChannels.do</rhn-tab-url>
- <rhn-tab-url>/network/systems/details/channel_license.pxt</rhn-tab-url>
</rhn-tab>
</rhn-tab>
diff --git a/web/html/network/software/channels/display_license.pxt b/web/html/network/software/channels/display_license.pxt
deleted file mode 100644
index 82163b5..0000000
--- a/web/html/network/software/channels/display_license.pxt
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
- <pxt-use class="Grail::Frame" />
- <pxt-use class="Sniglets::Channel" />
- <pxt-use class="Sniglets::Users" />
- <pxt-use class="Sniglets::Lists" />
- <pxt-use class="Sniglets::Navi" />
- <pxt-use class="Sniglets::HTML" />
- <pxt-use class="Sniglets::ChannelLicense" />
-
- <grail-canvas-template base="/templates/c.pxt" mode="main_canvas">
-
-<rhn-channel-license-details>
- <h1><img src="/img/rhn-icon-channels.gif" /> {channel_name} <rhn-help href="s1-sm-channels-packages.jsp#s3-sm-channel-details" /></h1>
-
- <rhn-navi-nav prefix="channel_details" depth="0" file="/nav/channel_detail.xml" style="contentnav" />
-
- <h2>Channel License</h2>
-
- <div class="page-summary">
- <p>
- The following license agreement must be accepted for each system
- subscribed to this channel.
- </p>
-
- <pre>{channel_license}</pre>
-
-</div>
-
-</rhn-channel-license-details>
- </grail-canvas-template>
-</pxt-passthrough>
-
diff --git a/web/html/network/systems/details/channel_license.pxt b/web/html/network/systems/details/channel_license.pxt
deleted file mode 100644
index 234530b..0000000
--- a/web/html/network/systems/details/channel_license.pxt
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
- <pxt-use class="Grail::Frame" />
- <pxt-use class="Sniglets::ChannelLicense" />
- <pxt-use class="Sniglets::Users" />
- <pxt-use class="Sniglets::Servers" />
-
- <pxt-use class="Sniglets::HTML" />
-
- <grail-canvas-template base="/templates/c.pxt" mode="main_canvas">
-<pxt-formvar>
- <pxt-include-late file="/network/components/systems/system_details_toolbar.pxi" />
-</pxt-formvar>
-
- <rhn-navi-nav prefix="system_details" depth="0" file="/nav/system_detail.xml" style="contentnav" />
-
-
-<rhn-channel-license-dialog>
- <h2>End User License Agreement for <strong>{channel_name}</strong></h2>
-
- <div class="page-summary">
- <p>You must agree to the following EULA before you may subscribe the selected systems to this channel:</p>
- <br />
- <pre>{channel_license}</pre>
- <br />
- </div>
-
-<pxt-include-late file="/network/components/message_queues/local.pxi" />
-
- <pxt-form method="POST">
- <div align="right">
- <hr />
- <input type="submit" name="cancel" value="Cancel" />
- <input type="submit" name="accept" value="Accept" />
- <input type="hidden" name="pxt:trap" value="rhn:channel_license_dialog_cb" />
- <input type="hidden" name="sdc" value="1" />
- <input type="hidden" name="cid" value="{channel_id}" />
- {additional_channels}
- <pxt-hidden name="sid" />
- </div>
- </pxt-form>
-</rhn-channel-license-dialog>
-
- </grail-canvas-template>
-</pxt-passthrough>
diff --git a/web/html/network/systems/ssm/channels/alter_subscriptions_conf.pxt b/web/html/network/systems/ssm/channels/alter_subscriptions_conf.pxt
deleted file mode 100644
index b45e4d0..0000000
--- a/web/html/network/systems/ssm/channels/alter_subscriptions_conf.pxt
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf8"?>
-<pxt-passthrough>
- <pxt-use class="Grail::Frame" />
- <pxt-use class="Sniglets::ListUtils" />
- <pxt-use class="Sniglets::Channel" />
- <pxt-use class="Sniglets::Lists" />
- <pxt-use class="Sniglets::HTML" />
-
-
- <grail-canvas-template base="/templates/c.pxt" mode="main_canvas">
-
- <h1><img src="/img/rhn-icon-system_group.gif" alt="system set" /> System Set Manager <rhn-help href="s1-sm-systems.jsp#s2-sm-ssm" /></h1>
-
- <rhn-navi-nav prefix="system_set_manager" depth="0"
- file="/nav/ssm.xml" style="contentnav" />
-
-
-<h2>Alter Channel Subscriptions Confirmation</h2>
-
-<p>Below is a per system summary of the channel subscription changes
-that will occur.</p>
-
-<rhn-listview class="Sniglets::ListView::SystemList" mode="ssm_channel_change_conf">
- <empty_list_message>
- No systems would be affected by your channel subscription choices.
- </empty_list_message>
-
- <column name="Name" label="server_name" align="left"/>
-
- <column name="To Subscribe" label="channels_to_subscribe" align="left"/>
- <column name="To Unsubscribe" label="channels_to_unsubscribe"
- align="left"/>
-
- <action name="Change Subscriptions" label="ssm_change_channel_subscriptions" />
-</rhn-listview>
-
-
- </grail-canvas-template>
-
-</pxt-passthrough>
diff --git a/web/modules/rhn/RHN/Access/Channel.pm b/web/modules/rhn/RHN/Access/Channel.pm
index 245c357..dcdad72 100644
--- a/web/modules/rhn/RHN/Access/Channel.pm
+++ b/web/modules/rhn/RHN/Access/Channel.pm
@@ -30,7 +30,6 @@ sub register_acl_handlers {
$acl->register_handler(channel_exists => \&channel_exists);
$acl->register_handler(channel_accessible => \&channel_accessible);
$acl->register_handler(base_channel => \&channel_is_base);
- $acl->register_handler(channel_licensed => \&channel_is_licensed);
$acl->register_handler(channel_eoled => \&channel_eoled);
$acl->register_handler(org_owns_cloned_channels => \&org_owns_cloned_channels);
$acl->register_handler(org_channel_setting => \&org_channel_setting);
@@ -163,17 +162,6 @@ sub channel_is_proxy {
return 1;
}
-sub channel_is_licensed {
- my $pxt = shift;
-
- my $cid = $pxt->param('cid');
- throw 'no cid param' unless $cid;
-
- return 0 unless (RHN::Channel->license_path($cid));
-
- return 1;
-}
-
sub channel_subscribable {
my $pxt = shift;
diff --git a/web/modules/rhn/RHN/DB/Channel.pm b/web/modules/rhn/RHN/DB/Channel.pm
index bd14e1d..3ba753e 100644
--- a/web/modules/rhn/RHN/DB/Channel.pm
+++ b/web/modules/rhn/RHN/DB/Channel.pm
@@ -147,25 +147,6 @@ sub is_protected {
return ($self->channel_access() eq 'protected') ? 1 : 0;
}
-sub license_path {
- my $self = shift;
- my $cid;
-
- if (ref $self) {
- $cid = $self->id;
- }
- else {
- $cid = shift;
- }
-
- undef $self;
- die "No channel id" unless defined $cid;
-
- my $dbh = RHN::DB->connect;
-
- return $dbh->call_function('rhn_channel.get_license_path', $cid);
-}
-
sub parent {
my $self = shift;
my $channel = shift;
@@ -343,7 +324,6 @@ sub proxy_channels_by_version {
return @{$proxy_chans_by_version{$params{version}}};
}
-
sub has_downloads {
my $class = shift;
my $cid = shift;
diff --git a/web/modules/rhn/RHN/DB/DataSource/xml/Channel_queries.xml b/web/modules/rhn/RHN/DB/DataSource/xml/Channel_queries.xml
index ad7fb93..5167e45 100644
--- a/web/modules/rhn/RHN/DB/DataSource/xml/Channel_queries.xml
+++ b/web/modules/rhn/RHN/DB/DataSource/xml/Channel_queries.xml
@@ -341,7 +341,6 @@ ORDER BY rhn_channel.channel_priority(ACh.parent_or_self_id), ACh.parent_or_self
<mode name="token_channels_tree">
<query params="org_id">
SELECT ACh.channel_name NAME, ACh.channel_id ID, ACh.channel_depth AS DEPTH,
- rhn_channel.get_license_path(ACh.channel_id) LICENSE_PATH,
NVL(C.org_id, 0) ORG_ID, C.parent_channel,
(SELECT CF.label
FROM rhnChannelFamilyMembers CFM,
@@ -406,10 +405,8 @@ SELECT DISTINCT C.id,
C.label,
C.name,
C.summary,
- CFL.channel_family_id AS HAS_LICENSE,
C.gpg_key_url
- FROM rhnChannelFamilyLicense CFL,
- rhnChannelFamilyMembers CFM,
+ FROM rhnChannelFamilyMembers CFM,
rhnChannel C,
rhnUserChannel UC
WHERE UC.user_id = :user_id
@@ -419,7 +416,6 @@ SELECT DISTINCT C.id,
AND C.id = CFM.channel_id
AND C.parent_channel IS NOT NULL
AND NOT EXISTS (SELECT 1 FROM rhnServerChannel WHERE server_id = :server_id AND channel_id = C.id)
- AND CFM.channel_family_id = CFL.channel_family_id (+)
</query>
</mode>
diff --git a/web/modules/rhn/RHN/DB/Server.pm b/web/modules/rhn/RHN/DB/Server.pm
index 1bde1f5..e1d7880 100644
--- a/web/modules/rhn/RHN/DB/Server.pm
+++ b/web/modules/rhn/RHN/DB/Server.pm
@@ -1843,20 +1843,6 @@ sub remove_entitlement {
return;
}
-sub channel_license_consent {
- my $self = shift;
- my $user_id = shift;
- my $channel_id = shift;
-
-
- my $dbh = RHN::DB->connect;
-
- $dbh->call_procedure('rhn_channel.license_consent', $channel_id, $user_id, $self->id);
-
- # used in transaction...
- return $dbh;
-}
-
############################
# Server package functions
diff --git a/web/modules/rhn/RHN/DB/ServerActions.pm b/web/modules/rhn/RHN/DB/ServerActions.pm
index ffe0007..89ff3d8 100644
--- a/web/modules/rhn/RHN/DB/ServerActions.pm
+++ b/web/modules/rhn/RHN/DB/ServerActions.pm
@@ -22,42 +22,6 @@ use RHN::DB ();
use Params::Validate qw/:all/;
Params::Validate::validation_options(strip_leading => "-");
-sub channel_license_consent_for_set {
- my $class = shift;
- my $set = shift;
- my $channel_id = shift;
- my $user_id = shift;
- my $transaction = shift;
-
- my $query = <<EOQ;
-INSERT INTO rhnChannelFamilyLicenseConsent (channel_family_id, user_id, server_id)
-SELECT CFM.channel_family_id, ?, SC.server_id
- FROM rhnChannelFamilyLicense CFL,
- rhnChannelFamilyMembers CFM,
- rhnServerChannel SC,
- rhnChannel C,
- rhnSet ST
- WHERE ST.user_id = ?
- AND ST.label = ?
- AND C.id = ?
- AND ST.element = SC.server_id
- AND SC.channel_id = C.parent_channel
- AND C.id = CFM.channel_id
- AND CFM.channel_family_id = CFL.channel_family_id
- AND CFL.license_path IS NOT NULL
- AND NOT EXISTS (SELECT user_id FROM rhnChannelFamilyLicenseConsent WHERE channel_family_id = CFM.channel_family_id AND server_id = SC.server_id)
-EOQ
-
- my $dbh = RHN::DB->connect();
- my $sth = $dbh->prepare($query);
-
- $sth->execute($user_id, $user_id, $set->label, $channel_id);
-
- $dbh->commit unless $transaction;
-
- return $dbh;
-}
-
sub assign_set_to_group {
my $class = shift;
my $set = shift;
diff --git a/web/modules/sniglets/Sniglets/ActivationKeys.pm b/web/modules/sniglets/Sniglets/ActivationKeys.pm
index 7b49c8e..15753ca 100644
--- a/web/modules/sniglets/Sniglets/ActivationKeys.pm
+++ b/web/modules/sniglets/Sniglets/ActivationKeys.pm
@@ -125,7 +125,7 @@ sub good_token_channels {
my $all_channels = $ds->execute_query(-org_id => $org_id);
#filter out channels which require a license agreement:
- my @channel_list = grep { not defined $_->{LICENSE_PATH} } @{$all_channels};
+ my @channel_list = @{$all_channels};
#filter out proxy and satellite channels:
@channel_list = grep { ($_->{CHANNEL_FAMILY_LABEL} ne 'rhn-satellite')
diff --git a/web/modules/sniglets/Sniglets/ChannelLicense.pm b/web/modules/sniglets/Sniglets/ChannelLicense.pm
deleted file mode 100644
index 73526cd..0000000
--- a/web/modules/sniglets/Sniglets/ChannelLicense.pm
+++ /dev/null
@@ -1,346 +0,0 @@
-#
-# Copyright (c) 2008--2010 Red Hat, Inc.
-#
-# This software is licensed to you under the GNU General Public License,
-# version 2 (GPLv2). There is NO WARRANTY for this software, express or
-# implied, including the implied warranties of MERCHANTABILITY or FITNESS
-# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
-# along with this software; if not, see
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
-#
-# Red Hat trademarks are not licensed under GPLv2. No permission is
-# granted to use or replicate Red Hat trademarks that are incorporated
-# in this software or its documentation.
-#
-
-use strict;
-
-package Sniglets::ChannelLicense;
-
-use PXT::Utils;
-use RHN::Exception;
-use RHN::ServerActions;
-
-use File::Spec;
-
-sub register_tags {
- my $class = shift;
- my $pxt = shift;
-
- $pxt->register_tag("rhn-channel-license-dialog", \&channel_license_dialog);
- $pxt->register_tag("rhn-channel-license-details", \&channel_license_details);
-}
-
-sub register_callbacks {
- my $class = shift;
- my $pxt = shift;
-
- $pxt->register_callback("rhn:channel_license_dialog_cb", \&channel_license_dialog_cb);
-}
-
-sub get_license {
- my $channel = shift;
-
- my $license_path = File::Spec->catfile(PXT::Config->get('channel_licenses_path'), $channel->license_path);
-
-
- PXT::Debug->log(7, "license path: $license_path");
-
-# warn "license_path: '$license_path'\n";
-# warn "no_upwards results: " . join(', ', File::Spec::Unix->no_upwards($license_path));
-# warn "is_absolute_path: " . File::Spec::Unix->file_name_is_absolute($license_path);
-
- if ($license_path =~ m{\.\./}) {
- throw "DON'T PUT ../'s IN THE CHANNEL LICENSE PATH! License path: $license_path";
- }
-
- if (! -e $license_path) {
- throw "channel license missing: " . $license_path;
- }
-
- open MYFILE, ($license_path) || throw "could not open file: " . $license_path;
-
- my $f = join('', <MYFILE>);
-
- close MYFILE;
-
- return $f;
-}
-
-sub channel_license_details {
- my $pxt = shift;
- my %params = @_;
-
- my %subst;
- my $block = $params{__block__};
-
- $subst{channel_id} = $pxt->param('cid');
- throw "no cid" unless (defined $subst{channel_id});
-
- my $channel = RHN::Channel->lookup(-id => $subst{channel_id});
- throw "no channel" unless ($channel);
- $subst{channel_name} = $channel->name();
-
- $subst{channel_license} = get_license($channel);
- throw "no license" unless (defined $subst{channel_license});
-
- return PXT::Utils->perform_substitutions($block, \%subst);
-}
-
-sub channel_license_dialog {
- my $pxt = shift;
- my %params = @_;
-
- my $block = $params{__block__};
-
- my $cid = $pxt->param('current_channel');
-
- if (not $cid and $pxt->dirty_param('cdc')) {
- $cid = $pxt->param('cid');
- }
-
- throw "no cid" unless ($cid);
-
- my $channel = RHN::Channel->lookup(-id => $cid);
- throw "no channel" unless ($channel);
-
- my $channel_name = $channel->name;
-
- if (not $pxt->user->verify_channel_subscribe($cid)) {
- my $error_msg = <<EOM;
-You no longer have subscription permission to the $channel_name channel.
-EOM
- $pxt->push_message(local_alert => $error_msg);
-
- my $sid = $pxt->param('sid');
-
- if ($sid) {
- $pxt->redirect("/network/systems/details/channels.pxt?sid=$sid");
- }
- elsif ($pxt->dirty_param('cdc')) {
- $pxt->redirect("/network/software/channels/details.pxt?cid=$cid");
- }
-
- $pxt->redirect("/network/systems/ssm/channels/index.pxt");
- }
-
- my $license = get_license($channel) || '';
-
- my @additional_channels = $pxt->param('additional_channel');
- my $additional_channels_str = '';
-
- if (@additional_channels) {
- $additional_channels_str = PXT::HTML->hidden(-name => 'current_channel', -value => $additional_channels[0]);
-
- if (@additional_channels > 1) {
- foreach my $xtra_cid (@additional_channels[1..-1]) {
- $additional_channels_str .= "\n" . PXT::HTML->hidden(-name => "additional_channel", -value => $xtra_cid);
- }
- }
- }
-
- my %subs;
-
- $subs{channel_license} = $license;
- $subs{channel_name} = $channel->name;
- $subs{channel_id} = $cid;
-
- PXT::Utils->escapeHTML_multi(\%subs);
-
- $subs{additional_channels} = $additional_channels_str; # don't escape me
-
- $block = PXT::Utils->perform_substitutions($block, \%subs);
- return $block;
-}
-
-sub channel_license_dialog_cb {
- my $pxt = shift;
-
- my $sid = $pxt->param('sid');
- my $system_set;
- my $server;
- my $channel_set;
- my $system_entitlement;
-
- if ($sid) {
- $server = RHN::Server->lookup(-id => $sid);
- $system_entitlement = $server->is_entitled;
- }
- else {
- my $set_label = $pxt->dirty_param('set_label') || 'system_list';
- $system_set = RHN::Set->new($set_label, $pxt->user->id);
- }
-
- my $cid = $pxt->param('cid');
- throw "no channel id to subscribe to..." unless ($cid);
- my $channel = RHN::Channel->lookup(-id => $cid);
- throw "no channel" unless ($channel);
-
- my $channel_name = $channel->name;
-
- if (not $pxt->user->verify_channel_subscribe($cid)) {
- my $error_msg = <<EOM;
-You no longer have subscription permission to the $channel_name channel.
-EOM
- $pxt->push_message(local_alert => $error_msg);
-
- if ($sid) {
- $pxt->redirect("/network/systems/details/channels.pxt?sid=$sid");
- }
- elsif ($pxt->dirty_param('cdc')) {
- $pxt->redirect("/network/software/channels/details.pxt?cid=$cid");
- }
-
- $pxt->redirect("/network/systems/ssm/channels/index.pxt");
- }
-
-
- if ($pxt->dirty_param('accept')) {
-
- eval {
- my $transaction;
-
- if ($server) {
- $transaction = $server->channel_license_consent($pxt->user->id, $channel->id, $transaction);
- $transaction = $server->subscribe_to_channel($channel->label, $transaction);
-
- # hrm. w/out heavily rearchitecting eula's, gotta snapshot each acceptance...
- if ($server->has_feature('ftr_snapshotting')) {
- $transaction = RHN::Server->snapshot_server(-server_id => $server->id,
- -reason => "Channel subscription alterations",
- -transaction => $transaction);
- }
-
- }
- else {
-
- # handle stupid case of multiple licenses, hitting cancel for one, going back, and accepting...
- if ($pxt->dirty_param('ssm')) {
-
- $channel_set = RHN::Set->new('channel_list', $pxt->user->id);
-
- unless ($channel_set->contains($cid)) {
- $channel_set->add("$cid|1");
- $channel_set->commit;
- }
- }
-
- $transaction = RHN::ServerActions->channel_license_consent_for_set($system_set, $channel->id, $pxt->user->id, $transaction);
-
- # in this case, don't actually subscribe to the channel, this will be handled later.
- # might have to worry about giving consent w/out subscribing to channel.
- #$transaction = RHN::ServerActions->subscribe_set_to_channel($system_set, $channel->id, $transaction);
- }
-
- $transaction->commit;
-
- if ($server) {
- $pxt->push_message(site_info => "<strong>" . $server->name . "</strong> subscribed to <strong>" . $channel->name . "</strong>");
- }
- };
-
-
- if ($@) {
- my $E = $@;
- PXT::Debug->log(9, "error: $E");
- if (ref $E and catchable($E)) {
- if ($E->is_rhn_exception('channel_family_no_subscriptions')) {
- $pxt->push_message(local_alert => "This assignment would exceed your allowed subscriptions in one or more channels.");
- return;
- }
- elsif ($E->constraint_value eq 'RHN_CFL_CONSENT_CF_S_UQ'){
- # consent was given to the channel family for the server through another channel...
- # do everything except ignore the license consent stuff
- PXT::Debug->log(7, "passing through consent because consent was already given for " . $channel->id);
-
- eval {
- if ($server) {
- $server->subscribe_to_channel($channel->label);
-
- if ($server->has_feature('ftr_snapshotting')) {
- RHN::Server->snapshot_server(-server_id => $server->id,
- -reason => "Channel subscription alterations",
- );
- }
-
- }
- else {
- if ($pxt->dirty_param('ssm')) {
-
- $channel_set = RHN::Set->new('channel_list', $pxt->user->id);
-
- unless ($channel_set->contains($cid)) {
- $channel_set->add("$cid|1");
- $channel_set->commit;
- }
- }
- RHN::ServerActions->channel_license_consent_for_set($system_set, $channel->id, $pxt->user->id);
- }
- };
-
- if ($@) {
-
- my $E = $@;
-
- # this is happening with people trying to subscribe to k12ltsp channel + general edu channel...
- if (ref $E and catchable($E)) {
- if ($E->is_rhn_exception('channel_family_no_subscriptions')) {
- $pxt->push_message(local_alert => "Could not subscribe to " . $channel->name . "; insufficient channel entitlements");
- }
- }
- else {
- die $@;
- }
- }
- }
- else {
- throw $E;
- }
- }
- else {
- PXT::Debug->log_dump(7, $E);
- die $E;
- }
- }
- }
- elsif ($pxt->dirty_param('cancel')) {
-
- PXT::Debug->log(7, "cancel...");
-
- if ($pxt->dirty_param('cdc')) {
- $pxt->redirect("/rhn/channels/TargetSystems.do?cid=$cid");
- }
-
- if ($system_set) {
- # remove the current channel from the channel list
-
- $channel_set = RHN::Set->new('channel_list', $pxt->user->id);
-
- $channel_set->remove("$cid|1");
- $channel_set->commit;
- }
- }
-
- PXT::Debug->log(7, "are we done?");
-
- # canceled, if there aren't any other eulas to deal with, return to system channel list?
- if (not $pxt->param('current_channel')) {
- if ($server) {
- $pxt->redirect("/network/systems/details/channels.pxt?sid=$sid");
- }
- elsif ($pxt->dirty_param('ssm')) {
- $pxt->redirect("/network/systems/ssm/channels/alter_subscriptions_conf.pxt");
- }
- elsif ($pxt->dirty_param('cdc')) {
- $pxt->redirect(sprintf("/network/software/channels/subscribe_confirm.pxt?cid=%d&set_label=%s", $pxt->param('cid'), $pxt->dirty_param('set_label')));
- }
- else {
- die "shouldn't have gotten here...";
- }
- }
- else {
- warn "current channel: " . $pxt->param('current_channel');
- }
-}
-
-1;
13 years, 11 months
Changes to 'refs/tags/spacewalk-backend-1.1.22-1'
by Miroslav Suchý
Tag 'spacewalk-backend-1.1.22-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-06-18 14:51 +0000
Tagging package [spacewalk-backend] version [1.1.22-1] in directory [backend/].
Changes since spacewalk-java-1.1.13-1:
Jan Pazdziora (6):
For PostgreSQL, call it db-name instead of db-sid. Also use different default port.
For PostgreSQL, only put in parameter to DBI connect string if they were specified.
Port was missing in invocation of rhn-populate-database.pl for PostgreSQL.
PostgreSQL can use local connection just fine, no need for host to be specified.
For PostgreSQL, add support for connects to nondefault port; also, avoid using shell.
We invoke the rhn-populate-database.pl via print_progress which does the logging.
Miroslav Suchý (8):
remove shebang from module
remove shebang from module
remove shebang from module
remove shebang from module
fix rpmlint warning
fix rpmlint warning
fix rpmlint warning
Automatic commit of package [spacewalk-backend] release [1.1.22-1].
---
backend/common/rhnCache.py | 2
backend/common/rhnFlags.py | 2
backend/common/rhn_posix.py | 1
backend/common/rhn_timer.py | 1
backend/spacewalk-backend.spec | 50 +++++++-----
rel-eng/packages/spacewalk-backend | 2
spacewalk/admin/rhn-populate-database.pl | 63 +++++++--------
spacewalk/setup/lib/Spacewalk/Setup.pm | 124 ++++++++++++++++++++++---------
8 files changed, 148 insertions(+), 97 deletions(-)
---
13 years, 11 months
backend/spacewalk-backend.spec rel-eng/packages
by Miroslav Suchý
backend/spacewalk-backend.spec | 13 ++++++++++++-
rel-eng/packages/spacewalk-backend | 2 +-
2 files changed, 13 insertions(+), 2 deletions(-)
New commits:
commit 7eafac4811eb3b0c3272d67b31909b8dc55598f7
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 16:51:08 2010 +0200
Automatic commit of package [spacewalk-backend] release [1.1.22-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index ef3b197..53e8de0 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 1.1.21
+Version: 1.1.22
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -632,6 +632,17 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Fri Jun 18 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.1.22-1
+- fix rpmlint warning (msuchy(a)redhat.com)
+- fix rpmlint warning (msuchy(a)redhat.com)
+- fix rpmlint warning (msuchy(a)redhat.com)
+- remove shebang from module (msuchy(a)redhat.com)
+- remove shebang from module (msuchy(a)redhat.com)
+- remove shebang from module (msuchy(a)redhat.com)
+- remove shebang from module (msuchy(a)redhat.com)
+- fixed wording for incompatible checksum error (michael.mraka(a)redhat.com)
+- l10n: Updates to Russian (ru) translation (ypoyarko(a)fedoraproject.org)
+
* Wed Jun 09 2010 Justin Sherrill <jsherril(a)redhat.com> 1.1.21-1
- 600323 - fixing checksums KeyError with rhnpush and channel association
(jsherril(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 2b35ab5..6ab6115 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-1.1.21-1 backend/
+1.1.22-1 backend/
13 years, 11 months
7 commits - backend/common backend/spacewalk-backend.spec
by Miroslav Suchý
backend/common/rhnCache.py | 2 --
backend/common/rhnFlags.py | 2 --
backend/common/rhn_posix.py | 1 -
backend/common/rhn_timer.py | 1 -
backend/spacewalk-backend.spec | 37 +++++++++++++++++++------------------
5 files changed, 19 insertions(+), 24 deletions(-)
New commits:
commit 43dc06df726fdefa92be245d1d4e9429ec5379eb
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 16:45:11 2010 +0200
fix rpmlint warning
addressing:
spacewalk-backend.noarch: E: non-standard-dir-perm /var/log/rhn 0770L
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index e277c21..ef3b197 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -326,7 +326,7 @@ rm -f %{rhnconf}/rhnSecret.py*
%{rhnroot}/common/rhnTranslate.py*
%{rhnroot}/common/UserDictCase.py*
%{rhnroot}/common/RPC_Base.py*
-%attr(770,root,apache) %dir %{_var}/log/rhn
+%dir %{_var}/log/rhn
# config files
%attr(750,root,apache) %dir %{rhnconf}/default
%attr(640,root,apache) %{rhnconf}/default/rhn.conf
commit cabbb0dce7c0239d3593fe682f56aa4ba6ecb153
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 16:41:29 2010 +0200
fix rpmlint warning
addressing:
spacewalk-backend.noarch: W: obsolete-not-provided rhns-common
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 0149923..e277c21 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -30,6 +30,7 @@ Requires(pre): httpd
Obsoletes: rhns-common < 5.3.0
Obsoletes: rhns < 5.3.0
Provides: rhns = 1:%{version}-%{release}
+Provides: rhns-common = 1:%{version}-%{release}
%description
Generic program files needed by the Spacewalk server machines.
commit fcf53e772331be6165edb6b4d8f8f6a1e4f1ad06
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 16:32:29 2010 +0200
fix rpmlint warning
addressing:
spacewalk-backend.noarch: W: self-obsoletion rhns < 5.3.0 obsoletes rhns = 1.1.21-1
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 4f57d4a..0149923 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -29,7 +29,7 @@ Requires(pre): httpd
# against installations on other releases using conflicts...
Obsoletes: rhns-common < 5.3.0
Obsoletes: rhns < 5.3.0
-Provides: rhns = %{version}-%{release}
+Provides: rhns = 1:%{version}-%{release}
%description
Generic program files needed by the Spacewalk server machines.
@@ -41,7 +41,7 @@ Group: Applications/Internet
Requires(pre): %{name} = %{version}-%{release}
Requires: python(:DBAPI:oracle)
Obsoletes: rhns-sql < 5.3.0
-Provides: rhns-sql = %{version}-%{release}
+Provides: rhns-sql = 1:%{version}-%{release}
%description sql
This package contains the basic code that provides SQL connectivity for the Spacewalk
@@ -53,7 +53,7 @@ Group: Applications/Internet
Requires(pre): %{name}-sql = %{version}-%{release}
Requires: PyPAM
Obsoletes: rhns-server < 5.3.0
-Provides: rhns-server = %{version}-%{release}
+Provides: rhns-server = 1:%{version}-%{release}
%if 0%{?rhel} && 0%{?rhel} < 6
Requires: mod_python
@@ -75,7 +75,7 @@ Requires: %{name}-server = %{version}-%{release}
Obsoletes: rhns-server-xmlrpc < 5.3.0
Obsoletes: rhns-xmlrpc < 5.3.0
Provides: rhns-server-xmlrpc = %{version}-%{release}
-Provides: rhns-xmlrpc = %{version}-%{release}
+Provides: rhns-xmlrpc = 1:%{version}-%{release}
%description xmlrpc
These are the files required for running the /XMLRPC handler, which
@@ -87,7 +87,7 @@ Summary: Handler for /APPLET
Group: Applications/Internet
Requires: %{name}-server = %{version}-%{release}
Obsoletes: rhns-applet < 5.3.0
-Provides: rhns-applet = %{version}-%{release}
+Provides: rhns-applet = 1:%{version}-%{release}
%description applet
These are the files required for running the /APPLET handler, which
@@ -99,8 +99,8 @@ Group: Applications/Internet
Requires: %{name}-server = %{version}-%{release}
Obsoletes: rhns-server-app < 5.3.0
Obsoletes: rhns-app < 5.3.0
-Provides: rhns-server-app = %{version}-%{release}
-Provides: rhns-app = %{version}-%{release}
+Provides: rhns-server-app = 1:%{version}-%{release}
+Provides: rhns-app = 1:%{version}-%{release}
%description app
These are the files required for running the /APP handler.
@@ -112,8 +112,8 @@ Group: Applications/Internet
Requires: %{name}-server = %{version}-%{release}
Obsoletes: rhns-server-xp < 5.3.0
Obsoletes: rhns-xp < 5.3.0
-Provides: rhns-server-xp = %{version}-%{release}
-Provides: rhns-xp = %{version}-%{release}
+Provides: rhns-server-xp = 1:%{version}-%{release}
+Provides: rhns-xp = 1:%{version}-%{release}
%description xp
These are the files required for running the /XP handler.
@@ -124,7 +124,7 @@ Summary: Handler for /SAT
Group: Applications/Internet
Requires: %{name}-server = %{version}-%{release}
Obsoletes: rhns-sat < 5.3.0
-Provides: rhns-sat = %{version}-%{release}
+Provides: rhns-sat = 1:%{version}-%{release}
%description iss
%{name} contains the basic code that provides server/backend
@@ -163,7 +163,7 @@ Summary: Common files for the Configuration Management project
Group: Applications/Internet
Requires: %{name}-server = %{version}-%{release}
Obsoletes: rhns-config-files-common < 5.3.0
-Provides: rhns-config-files-common = %{version}-%{release}
+Provides: rhns-config-files-common = 1:%{version}-%{release}
%description config-files-common
Common files required by the Configuration Management project
@@ -173,7 +173,7 @@ Summary: Handler for /CONFIG-MANAGEMENT
Group: Applications/Internet
Requires: %{name}-config-files-common = %{version}-%{release}
Obsoletes: rhns-config-files < 5.3.0
-Provides: rhns-config-files = %{version}-%{release}
+Provides: rhns-config-files = 1:%{version}-%{release}
%description config-files
This package contains the server-side code for configuration management.
@@ -183,7 +183,7 @@ Summary: Handler for /CONFIG-MANAGEMENT-TOOL
Group: Applications/Internet
Requires: %{name}-config-files-common = %{version}-%{release}
Obsoletes: rhns-config-files-tool < 5.3.0
-Provides: rhns-config-files-tool = %{version}-%{release}
+Provides: rhns-config-files-tool = 1:%{version}-%{release}
%description config-files-tool
This package contains the server-side code for configuration management tool.
@@ -193,7 +193,7 @@ Summary: Server-side listener for rhn-pkgupload
Group: Applications/Internet
Requires: %{name}-server = %{version}-%{release}
Obsoletes: rhns-upload-server < 5.3.0
-Provides: rhns-upload-server = %{version}-%{release}
+Provides: rhns-upload-server = 1:%{version}-%{release}
%description upload-server
Server-side listener for rhn-pkgupload
@@ -203,7 +203,7 @@ Summary: Listener for rhnpush (non-XMLRPC version)
Group: Applications/Internet
Requires: %{name}-server = %{version}-%{release}
Obsoletes: rhns-package-push-server < 5.3.0
-Provides: rhns-package-push-server = %{version}-%{release}
+Provides: rhns-package-push-server = 1:%{version}-%{release}
%description package-push-server
Listener for rhnpush (non-XMLRPC version)
@@ -229,7 +229,7 @@ Requires: rhnlib >= 2.5.22
%endif
Obsoletes: rhns-satellite-tools < 5.3.0
Obsoletes: spacewalk-backend-satellite-tools <= 0.2.7
-Provides: rhns-satellite-tools = %{version}-%{release}
+Provides: rhns-satellite-tools = 1:%{version}-%{release}
%description tools
Various utilities for the Red Hat Network Satellite Server.
@@ -239,7 +239,7 @@ Summary: Red Hat Network XML data exporter
Group: Applications/Internet
Requires: %{name}-server = %{version}-%{release}
Obsoletes: rhns-xml-export-libs < 5.3.0
-Provides: rhns-xml-export-libs = %{version}-%{release}
+Provides: rhns-xml-export-libs = 1:%{version}-%{release}
%description xml-export-libs
Libraries required by various exporting tools
commit 370233938e2a9f1d183b37c59ac31a5ddedf3870
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 16:27:56 2010 +0200
remove shebang from module
spacewalk-backend.noarch: E: non-executable-script /usr/share/rhn/common/rhn_timer.py 0664L /usr/bin/python
diff --git a/backend/common/rhn_timer.py b/backend/common/rhn_timer.py
index 2eb3945..a49ad29 100644
--- a/backend/common/rhn_timer.py
+++ b/backend/common/rhn_timer.py
@@ -1,4 +1,3 @@
-#!/usr/bin/python
#
# Copyright (c) 2008 Red Hat, Inc.
#
commit 656fc53fffc90c5248d62ff9b10ca9a102daefc2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 16:27:14 2010 +0200
remove shebang from module
spacewalk-backend.noarch: E: non-executable-script /usr/share/rhn/common/rhn_posix.py 0664L /usr/bin/python
diff --git a/backend/common/rhn_posix.py b/backend/common/rhn_posix.py
index 3ad3ecc..9021653 100644
--- a/backend/common/rhn_posix.py
+++ b/backend/common/rhn_posix.py
@@ -1,4 +1,3 @@
-#!/usr/bin/python
#
# This module provides the constants that used to be part of the
# now-deprecated posixfile module
commit e0962257da5513c0a42e32cd2f31b257cb3ebd23
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 16:26:27 2010 +0200
remove shebang from module
addressing spacewalk-backend.noarch: E: non-executable-script /usr/share/rhn/common/rhnCache.py 0664L /usr/bin/python
diff --git a/backend/common/rhnCache.py b/backend/common/rhnCache.py
index a618b86..c09865c 100644
--- a/backend/common/rhnCache.py
+++ b/backend/common/rhnCache.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-#
# Copyright (c) 2008--2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
commit 54b34776d8ae45a0ecdf437905227fbe3365e6ac
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 16:25:23 2010 +0200
remove shebang from module
addressing:
spacewalk-backend.noarch: E: non-executable-script /usr/share/rhn/common/rhnFlags.py 0664L /usr/bin/python
diff --git a/backend/common/rhnFlags.py b/backend/common/rhnFlags.py
index d86402f..28bac1a 100644
--- a/backend/common/rhnFlags.py
+++ b/backend/common/rhnFlags.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-#
# Copyright (c) 2008 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
13 years, 11 months
spacewalk/setup
by Jan Pazdziora
spacewalk/setup/lib/Spacewalk/Setup.pm | 1 -
1 file changed, 1 deletion(-)
New commits:
commit 5bd7a191374b1c7e28ec90973eb949d5e1c819bc
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Jun 18 15:15:32 2010 +0200
We invoke the rhn-populate-database.pl via print_progress which does the logging.
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index 01c8ff1..b0019ed 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -824,7 +824,6 @@ sub postgresql_populate_db {
sprintf('--host=%s', @{$answers}{'db-host'}),
sprintf('--port=%s', @{$answers}{'db-port'}),
sprintf("--schema-deploy-file=$sat_schema_deploy"),
- sprintf("--log=$logfile"),
sprintf('--nofork'),
sprintf('--postgresql'),
);
13 years, 11 months
2 commits - spacewalk/admin
by Jan Pazdziora
spacewalk/admin/rhn-populate-database.pl | 63 +++++++++++++------------------
1 file changed, 28 insertions(+), 35 deletions(-)
New commits:
commit 9cf97b0c4e4ad4a2773d041b5f9e34451fe8e157
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Jun 18 15:04:30 2010 +0200
For PostgreSQL, add support for connects to nondefault port; also, avoid using shell.
diff --git a/spacewalk/admin/rhn-populate-database.pl b/spacewalk/admin/rhn-populate-database.pl
index dda2303..7e98d11 100755
--- a/spacewalk/admin/rhn-populate-database.pl
+++ b/spacewalk/admin/rhn-populate-database.pl
@@ -29,13 +29,15 @@ use IPC::Open3;
use Spacewalk::Setup;
use Symbol qw(gensym);
-my $usage = "usage: $0 --host=<databaseHost> --user=<username> --password=<password> --database=<databaseName> --schema-deploy-file=<filename>"
+my $usage = "usage: $0 [ --host=<databaseHost> [ --port=<port> ] ] --database=<databaseName> \\\n"
+ . " --user=<username> --password=<password> --schema-deploy-file=<filename> \\\n"
. " [ --log=<logfile> ] [ --clear-db ] [ --nofork ] [ --postgresql ] [ --help ]\n";
my $user = '';
my $password = '';
my $database = '';
my $host = '';
+my $port = '';
my $schema_deploy_file = '';
my $log_file;
@@ -44,7 +46,8 @@ my $nofork = 0;
my $postgresql = 0;
my $help = '';
-GetOptions("host=s" => \$host, "user=s" => \$user, "password=s" => \$password,
+GetOptions("host=s" => \$host, "port=s" => \$port,
+ "user=s" => \$user, "password=s" => \$password,
"database=s" => \$database, "schema-deploy-file=s" => \$schema_deploy_file,
"log=s" => \$log_file, "help" => \$help, "clear-db" => \$clear_db,
"postgresql" => \$postgresql, nofork => \$nofork);
@@ -105,42 +108,33 @@ if ($clear_db) {
RHN::SatInstall->clear_db();
}
-# Only used for PostgreSQL:
-my $populate_cmd = "";
-# Only used for Oracle:
-my $dsn = sprintf('%s/%s@%s', $user, $password, $database);
+my @command;
if ($postgresql) {
- print "*** Installing PostgreSQL schema.\n";
- chdir("/usr/share/spacewalk/schema/postgresql/");
- $populate_cmd = "PGPASSWORD=$password psql -U $user -h $host -d $database -v ON_ERROR_STOP= -f $schema_deploy_file";
-}
-else {
- print "*** Installing Oracle schema.\n";
- $populate_cmd = "sqlplus $dsn \@$schema_deploy_file";
- chdir;
+ print "*** Installing PostgreSQL schema from [$schema_deploy_file].\n";
+ chdir("/usr/share/spacewalk/schema/postgresql/");
+ @command = ( 'psql', '-U', $user, '-d', $database, '-v', 'ON_ERROR_STOP=', '-f', $schema_deploy_file );
+ if (defined $host) {
+ push @command, '-h', $host;
+ if (defined $port) {
+ push @command, '-p', $port;
+ }
+ }
+ $ENV{PGPASSWORD} = $password;
+} else {
+ print "*** Installing Oracle schema from [$schema_deploy_file].\n";
+ @command = ( 'sqlplus', "$user/$password\@$database", "\@$schema_deploy_file" );
}
if (defined $log_file) {
- local *LOGFILE;
- open(LOGFILE, ">", $log_file) or die "Error writing log file '$log_file': $OS_ERROR";
- if (Spacewalk::Setup::have_selinux()) {
- system('/sbin/restorecon', $log_file) == 0 or die "Error running restorecon on $log_file.";
- }
- if ($postgresql) {
- $pid = open3(gensym, ">&LOGFILE", ">&LOGFILE", $populate_cmd);
- }
- else {
- $pid = open3(gensym, ">&LOGFILE", ">&LOGFILE", 'sqlplus', $dsn, "\@$schema_deploy_file");
- }
-}
-else {
- if ($postgresql) {
- $pid = open3(gensym, ">&STDOUT", ">&STDERR", $populate_cmd);
- }
- else {
- $pid = open3(gensym, ">&STDOUT", ">&STDERR", 'sqlplus', $dsn, "\@$schema_deploy_file");
- }
+ local *LOGFILE;
+ open(LOGFILE, ">", $log_file) or die "Error writing log file '$log_file': $OS_ERROR";
+ if (Spacewalk::Setup::have_selinux()) {
+ system('/sbin/restorecon', $log_file) == 0 or die "Error running restorecon on $log_file.";
+ }
+ $pid = open3(gensym, ">&LOGFILE", ">&LOGFILE", @command);
+} else {
+ $pid = open3(gensym, ">&STDOUT", ">&STDERR", @command);
}
waitpid($pid, 0);
commit 0efe07d20345531883609ea91d04a77df074825c
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Jun 18 14:48:39 2010 +0200
PostgreSQL can use local connection just fine, no need for host to be specified.
diff --git a/spacewalk/admin/rhn-populate-database.pl b/spacewalk/admin/rhn-populate-database.pl
index 1b9fb18..dda2303 100755
--- a/spacewalk/admin/rhn-populate-database.pl
+++ b/spacewalk/admin/rhn-populate-database.pl
@@ -50,8 +50,7 @@ GetOptions("host=s" => \$host, "user=s" => \$user, "password=s" => \$password,
"postgresql" => \$postgresql, nofork => \$nofork);
if ($help
- or not ($user and $password and $database and $schema_deploy_file)
- or ($postgresql and not $host)) {
+ or not ($user and $password and $database and $schema_deploy_file)) {
die $usage;
}
13 years, 11 months
3 commits - spacewalk/setup
by Jan Pazdziora
spacewalk/setup/lib/Spacewalk/Setup.pm | 123 +++++++++++++++++++++++----------
1 file changed, 88 insertions(+), 35 deletions(-)
New commits:
commit 07d1b21d5fd56635e9a47c4d553fa7fbcb71c392
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Jun 18 12:05:15 2010 +0200
Port was missing in invocation of rhn-populate-database.pl for PostgreSQL.
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index a14fdc3..01c8ff1 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -822,6 +822,7 @@ sub postgresql_populate_db {
sprintf('--password=%s', @{$answers}{'db-password'}),
sprintf('--database=%s', @{$answers}{'db-name'}),
sprintf('--host=%s', @{$answers}{'db-host'}),
+ sprintf('--port=%s', @{$answers}{'db-port'}),
sprintf("--schema-deploy-file=$sat_schema_deploy"),
sprintf("--log=$logfile"),
sprintf('--nofork'),
commit 3018b96fb6c34687bdde497f1349bd6a61be8cc9
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Jun 18 12:04:27 2010 +0200
For PostgreSQL, only put in parameter to DBI connect string if they were specified.
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index f1904b8..a14fdc3 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -1356,41 +1356,50 @@ EOQ
}
sub get_dbh {
- my $answers = shift;
+ my $answers = shift;
- my ($database, $username, $password, $sid, $host, $port) = @{$answers}{qw/db-backend db-user db-password db-sid db-host db-port/};
+ my $dbh_attributes = {
+ RaiseError => 1,
+ PrintError => 0,
+ Taint => 0,
+ AutoCommit => 0,
+ };
- my $dbh;
- if ($database eq "oracle") {
- $dbh = DBI->connect("dbi:Oracle:$sid", $username, $password,
- {
- RaiseError => 1,
- PrintError => 0,
- Taint => 0,
- AutoCommit => 0,
- }
- );
- }
- elsif ($database eq "postgresql") {
- $dbh = DBI->connect("DBI:Pg:dbname=$sid;host=$host;port=$port", $username, $password,
- {
- RaiseError => 1,
- PrintError => 0,
- Taint => 0,
- AutoCommit => 0,
- }
- );
- }
+ my $backend = $answers->{'db-backend'};
+ if ($backend eq 'oracle') {
+ my $dbh = DBI->connect("dbi:Oracle:$answers->{'db-sid'}",
+ $answers->{'db-user'},
+ $answers->{'db-password'},
+ $dbh_attributes);
+
+ # Bugzilla 466747: On s390x, stty: standard input: Bad file descriptor
+ # For some reason DBI mistakenly sets FD_CLOEXEC on a stdin file descriptor
+ # here. This made it impossible for us to succesfully call `stty -echo`
+ # later in the code. Following two lines work around the problem.
- # Bugzilla 466747: On s390x, stty: standard input: Bad file descriptor
- # For some reason DBI mistakenly sets FD_CLOEXEC on a stdin file descriptor
- # here. This made it impossible for us to succesfully call `stty -echo`
- # later in the code. Following two lines work around the problem.
+ my $flags = fcntl(STDIN, F_GETFD, 0);
+ fcntl(STDIN, F_SETFD, $flags & ~FD_CLOEXEC);
- my $flags = fcntl(STDIN, F_GETFD, 0);
- fcntl(STDIN, F_SETFD, $flags & ~FD_CLOEXEC);
+ return $dbh;
+ }
+
+ if ($backend eq 'postgresql') {
+ my $dsn = "dbi:Pg:dbname=$answers->{'db-name'}";
+ if ($answers->{'db-host'} ne '') {
+ $dsn .= ";host=$answers->{'db-host'}";
+ if ($answers->{'db-port'} ne '') {
+ $dsn .= ";port=$answers->{'db-port'}";
+ }
+ }
+ my $dbh = DBI->connect($dsn,
+ $answers->{'db-user'},
+ $answers->{'db-password'},
+ $dbh_attributes);
+
+ return $dbh;
+ }
- return $dbh;
+ die "Unknown db-backend [$backend]\n";
}
# Find the default tablespace name for the given (oracle) user.
commit 4d5f2509052893001a3505ac0cbf16895045b466
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Jun 17 15:58:54 2010 +0200
For PostgreSQL, call it db-name instead of db-sid. Also use different default port.
diff --git a/spacewalk/setup/lib/Spacewalk/Setup.pm b/spacewalk/setup/lib/Spacewalk/Setup.pm
index d3b210c..f1904b8 100644
--- a/spacewalk/setup/lib/Spacewalk/Setup.pm
+++ b/spacewalk/setup/lib/Spacewalk/Setup.pm
@@ -649,7 +649,7 @@ sub set_progress_callback {
alarm 1;
}
-sub get_database_answers {
+sub oracle_get_database_answers {
my $opts = shift;
my $answers = shift;
@@ -695,6 +695,49 @@ sub get_database_answers {
return;
}
+sub postgresql_get_database_answers {
+ my $opts = shift;
+ my $answers = shift;
+
+ ask(
+ -noninteractive => $opts->{"non-interactive"},
+ -question => "Hostname (leave empty for local)",
+ -test => sub { 1 },
+ -answer => \$answers->{'db-host'});
+
+ if ($answers->{'db-host'} ne '') {
+ ask(
+ -noninteractive => $opts->{"non-interactive"},
+ -question => "Port",
+ -test => qr/\d+/,
+ -default => 5432,
+ -answer => \$answers->{'db-port'});
+ } else {
+ $answers->{'db-port'} = '';
+ }
+
+ ask(
+ -noninteractive => $opts->{"non-interactive"},
+ -question => "Database",
+ -test => qr/\S+/,
+ -answer => \$answers->{'db-name'});
+
+ ask(
+ -noninteractive => $opts->{"non-interactive"},
+ -question => "Username",
+ -test => qr/\S+/,
+ -answer => \$answers->{'db-user'});
+
+ ask(
+ -noninteractive => $opts->{"non-interactive"},
+ -question => "Password",
+ -test => qr/\S+/,
+ -answer => \$answers->{'db-password'},
+ -password => 1);
+
+ return;
+}
+
############################
# PostgreSQL Specific Code #
@@ -709,7 +752,7 @@ sub postgresql_setup_db {
my $connected;
while (not $connected) {
- get_database_answers($opts, $answers);
+ postgresql_get_database_answers($opts, $answers);
my $dbh;
@@ -720,7 +763,7 @@ sub postgresql_setup_db {
if ($@) {
print Spacewalk::Setup::loc("Could not connect to the database. Your connection information may be incorrect. Error: %s\n", $@);
- delete @{$answers}{qw/db-protocol db-host db-port db-user db-sid db-password/};
+ delete @{$answers}{qw/db-host db-port db-name db-user db-password/};
}
else {
$connected = 1;
@@ -777,7 +820,7 @@ sub postgresql_populate_db {
my @opts = ('/usr/bin/rhn-populate-database.pl',
sprintf('--user=%s', @{$answers}{'db-user'}),
sprintf('--password=%s', @{$answers}{'db-password'}),
- sprintf('--database=%s', @{$answers}{'db-sid'}),
+ sprintf('--database=%s', @{$answers}{'db-name'}),
sprintf('--host=%s', @{$answers}{'db-host'}),
sprintf("--schema-deploy-file=$sat_schema_deploy"),
sprintf("--log=$logfile"),
@@ -993,7 +1036,7 @@ sub oracle_setup_db_connection {
my $connected;
while (not $connected) {
- get_database_answers($opts, $answers);
+ oracle_get_database_answers($opts, $answers);
my $address = join(",", @{$answers}{qw/db-protocol db-host db-port/});
13 years, 11 months
Changes to 'refs/tags/spacewalk-java-1.1.13-1'
by Miroslav Suchý
Tag 'spacewalk-java-1.1.13-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-06-18 12:40 +0000
Tagging package [spacewalk-java] version [1.1.13-1] in directory [java/].
Changes since rhn-client-tools-1.1.8-1:
Miroslav Suchý (1):
Automatic commit of package [spacewalk-java] release [1.1.13-1].
---
java/spacewalk-java.spec | 21 ++++++++++++++++++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 21 insertions(+), 2 deletions(-)
---
13 years, 11 months
Changes to 'refs/tags/rhn-client-tools-1.1.8-1'
by Miroslav Suchý
Tag 'rhn-client-tools-1.1.8-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-06-18 12:40 +0000
Tagging package [rhn-client-tools] version [1.1.8-1] in directory [client/rhel/rhn-client-tools/].
Changes since spacewalk-setup-1.1.2-1:
Jan Pazdziora (24):
ReadLine nor ReadMode not used in spacewalk-setup, removing.
Getopt::Long not used in spacewalk-setup, removing.
Method available_channels_with_license not called anywhere, removing as dead code.
Methods clear_channel_families not called anywhere, removing as dead code.
Removal of PXT::SoapRequest made deserialize unused, removing.
Method get_channel_families from spacewalk-setup (the bin) not used, removing.
Since RHN::DB::Search was removed, get_query_body is unused, removing.
Methods active_image and inactive_image do not seem to be invoked, removing.
Method list_groups no longer seems to be used, removing.
Method relationships is no longer called, removing.
Method schema_version no longer used, removing.
Method set_fields does not seem to be invoked, removing.
Method unused_entitlements no longer called, removing.
Do implicit imports.
Removing need_oracle_9i_10g_upgrade from spacewalk-setup, we have it in Spacewalk::Setup as well.
Removing as_checksum_string from spacewalk-setup (Sat::Cert), we have it in RHN::Cert.
Removing as_checksum_string and check_required_fields from spacewalk-setup (Sat::Cert), we have them in RHN::Cert.
current_generation in spacewalk-setup (Sat::Cert) not used, removing.
Removal of clear_channel_families made clear_field in bin/spacewalk-setup unused, removing.
set_channel_family does not seem to be used in spacewalk-setup (Sat::Cert), removing.
Constants SCHEMAS_DIR and DEFAULT_RHN_CONF_LOCATION not used in spacewalk-setup and Spacewalk::Setup, removing.
No invocation of external programs with one string, no need to have $cmdargs.
Oops, DEFAULT_RHN_CONF_LOCATION is actually used and referenced with full qualification.
Make the Setting up database ... message show the backend information to make it clearer what database we attempt to work with.
Justin Sherrill (1):
585176 - changing the behavior of the SSM package upgrade screen to handle system and their packages for upgrade invidually, so only packages needed on a system will be installed. This means that each system is scheduled individually, but at least it is correct
Michael Mraka (1):
fixed wording for incompatible checksum error
Miroslav Suchý (13):
implement <label> for form fields - general.jsp
fix syntax error
implement <label> for form fields - bootstrap.jsp
implement <label> for form fields - monitoring.jsp
implement <label> for form fields - restart.jsp
implement <label> for form fields - filter-form.jspf
implement <label> for form fields - probe-edit.jsp
implement <label> for form fields - orgcreate.jsp
implement <label> for form fields - edit.jsp
implement <label> for form fields - activationkeys/details.jspf
implement <label> for form fields - user/create/usercreate.jsp
implement <label> for form fields - sdc/details.jsp
Automatic commit of package [rhn-client-tools] release [1.1.8-1].
---
backend/satellite_tools/disk_dumper/dumper.py | 5
client/rhel/rhn-client-tools/rhn-client-tools.spec | 5
client/rhel/rhn-client-tools/src/up2date_client/rhncli.py | 8
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ssm/SchedulePackageUpgradeAction.java | 34 +--
java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesAction.java | 17 -
java/code/src/com/redhat/rhn/frontend/events/SsmUpgradePackagesEvent.java | 36 +--
java/code/src/com/redhat/rhn/manager/action/ActionManager.java | 14 -
java/code/webapp/WEB-INF/pages/admin/config/bootstrap.jsp | 36 +--
java/code/webapp/WEB-INF/pages/admin/config/general.jsp | 44 ++--
java/code/webapp/WEB-INF/pages/admin/config/monitoring.jsp | 8
java/code/webapp/WEB-INF/pages/admin/config/restart.jsp | 4
java/code/webapp/WEB-INF/pages/admin/monitoring/config/notification/filter-form.jspf | 49 ++--
java/code/webapp/WEB-INF/pages/admin/monitoring/config/probe-edit.jsp | 20 -
java/code/webapp/WEB-INF/pages/admin/multiorg/orgcreate.jsp | 38 +--
java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp | 92 ++++----
java/code/webapp/WEB-INF/pages/common/fragments/activationkeys/details.jspf | 28 +-
java/code/webapp/WEB-INF/pages/systems/sdc/details.jsp | 52 ++---
java/code/webapp/WEB-INF/pages/user/create/usercreate.jsp | 28 +-
rel-eng/packages/rhn-client-tools | 2
spacewalk/setup/bin/spacewalk-setup | 103 ----------
spacewalk/setup/lib/Spacewalk/Setup.pm | 18 -
web/modules/pxt/PXT/Trace.pm | 13 -
web/modules/rhn/RHN/DB/Channel.pm | 67 ------
web/modules/rhn/RHN/DB/ContactGroup.pm | 19 -
web/modules/rhn/RHN/DB/Org.pm | 19 -
web/modules/rhn/RHN/DB/SatInstall.pm | 34 ---
web/modules/rhn/RHN/DataSource.pm | 7
web/modules/rhn/RHN/SatelliteCert.pm | 6
web/modules/rhn/RHN/SimpleStruct.pm | 8
web/modules/sniglets/Sniglets/Navi/Node.pm | 2
30 files changed, 275 insertions(+), 541 deletions(-)
---
13 years, 11 months
14 commits - client/rhel java/code java/spacewalk-java.spec rel-eng/packages
by Miroslav Suchý
client/rhel/rhn-client-tools/rhn-client-tools.spec | 5
client/rhel/rhn-client-tools/src/up2date_client/rhncli.py | 8
java/code/webapp/WEB-INF/pages/admin/config/bootstrap.jsp | 36 +--
java/code/webapp/WEB-INF/pages/admin/config/general.jsp | 44 ++--
java/code/webapp/WEB-INF/pages/admin/config/monitoring.jsp | 8
java/code/webapp/WEB-INF/pages/admin/config/restart.jsp | 4
java/code/webapp/WEB-INF/pages/admin/monitoring/config/notification/filter-form.jspf | 49 ++---
java/code/webapp/WEB-INF/pages/admin/monitoring/config/probe-edit.jsp | 20 +-
java/code/webapp/WEB-INF/pages/admin/multiorg/orgcreate.jsp | 38 ++--
java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp | 92 +++++-----
java/code/webapp/WEB-INF/pages/common/fragments/activationkeys/details.jspf | 28 +--
java/code/webapp/WEB-INF/pages/systems/sdc/details.jsp | 52 ++---
java/code/webapp/WEB-INF/pages/user/create/usercreate.jsp | 28 +--
java/spacewalk-java.spec | 21 ++
rel-eng/packages/rhn-client-tools | 2
rel-eng/packages/spacewalk-java | 2
16 files changed, 229 insertions(+), 208 deletions(-)
New commits:
commit c6e3ac4069904e4294f31cf86e00d7d1b05e6fa6
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 14:40:59 2010 +0200
Automatic commit of package [spacewalk-java] release [1.1.13-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 04a69d3..9a7894f 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -19,7 +19,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 1.1.12
+Version: 1.1.13
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -321,6 +321,25 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Fri Jun 18 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.1.13-1
+- implement <label> for form fields - sdc/details.jsp (msuchy(a)redhat.com)
+- implement <label> for form fields - user/create/usercreate.jsp
+ (msuchy(a)redhat.com)
+- implement <label> for form fields - activationkeys/details.jspf
+ (msuchy(a)redhat.com)
+- implement <label> for form fields - edit.jsp (msuchy(a)redhat.com)
+- implement <label> for form fields - orgcreate.jsp (msuchy(a)redhat.com)
+- implement <label> for form fields - probe-edit.jsp (msuchy(a)redhat.com)
+- implement <label> for form fields - filter-form.jspf (msuchy(a)redhat.com)
+- implement <label> for form fields - restart.jsp (msuchy(a)redhat.com)
+- implement <label> for form fields - monitoring.jsp (msuchy(a)redhat.com)
+- implement <label> for form fields - bootstrap.jsp (msuchy(a)redhat.com)
+- implement <label> for form fields - general.jsp (msuchy(a)redhat.com)
+- 585176 - changing the behavior of the SSM package upgrade screen to handle
+ system and their packages for upgrade invidually, so only packages needed on
+ a system will be installed. This means that each system is scheduled
+ individually, but at least it is correct (jsherril(a)redhat.com)
+
* Thu Jun 17 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.1.12-1
- Made the duplicate compares page do confirm delete differently
(paji(a)redhat.com)
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index e81a753..eee955c 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-1.1.12-1 java/
+1.1.13-1 java/
commit c5c8601608aea5893f79e64453782b22879dfa50
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 14:40:33 2010 +0200
Automatic commit of package [rhn-client-tools] release [1.1.8-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index 9064605..7afc17c 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -4,7 +4,7 @@ Group: System Environment/Base
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
URL: https://fedorahosted.org/spacewalk
Name: rhn-client-tools
-Version: 1.1.7
+Version: 1.1.8
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -280,6 +280,9 @@ make -f Makefile.rhn-client-tools test
%endif
%changelog
+* Fri Jun 18 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.1.8-1
+- fix syntax error (msuchy(a)redhat.com)
+
* Thu Jun 17 2010 Miroslav Suchý <msuchy(a)redhat.com> 1.1.7-1
- l10n: Updates to Chinese (China) (zh_CN) translation
(leahliu(a)fedoraproject.org)
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index e3e11da..731ee13 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-1.1.7-1 client/rhel/rhn-client-tools/
+1.1.8-1 client/rhel/rhn-client-tools/
commit f070d7a926b77c87faed49025affe26f4b9e834a
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 14:37:20 2010 +0200
implement <label> for form fields - sdc/details.jsp
diff --git a/java/code/webapp/WEB-INF/pages/systems/sdc/details.jsp b/java/code/webapp/WEB-INF/pages/systems/sdc/details.jsp
index a493084..041ddb1 100644
--- a/java/code/webapp/WEB-INF/pages/systems/sdc/details.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/sdc/details.jsp
@@ -12,16 +12,16 @@
<html:hidden property="submitted" value="true"/>
<table class="details">
<tr>
- <th><bean:message key="sdc.details.edit.profilename"/></th>
- <td><html:text property="system_name" maxlength="128" size="40" /></td>
+ <th><label for="system_name"><bean:message key="sdc.details.edit.profilename"/></label></th>
+ <td><html:text property="system_name" maxlength="128" size="40" styleId="system_name"/></td>
</tr>
<tr>
- <th><bean:message key="sdc.details.edit.baseentitlement"/></th>
+ <th><label for="baseentitlement"><bean:message key="sdc.details.edit.baseentitlement"/></label></th>
<td>
<c:choose>
<c:when test="${!base_entitlement_permanent}">
<rhn:require acl="user_role(org_admin)">
- <html:select property="base_entitlement">
+ <html:select property="base_entitlement" styleId="baseentitlement">
<html:options collection="base_entitlement_options" property="value" labelProperty="label"/>
</html:select>
</rhn:require>
@@ -44,8 +44,8 @@
</c:when>
<c:otherwise>
<c:forEach items="${addon_entitlements}" var="entitlement">
- <html:checkbox property="${entitlement.entitlement.label}"/> <c:out value="${entitlement.entitlement.humanReadableLabel}"/>
- <strong>(${entitlement.availbleEntitlements} <bean:message key="sdc.channels.edit.available"/>)</strong> <br/>
+ <html:checkbox property="${entitlement.entitlement.label}" styleId="${entitlement.entitlement.label}"/> <label for="${entitlement.entitlement.label}"><c:out value="${entitlement.entitlement.humanReadableLabel}"/>
+ <strong>(${entitlement.availbleEntitlements} <bean:message key="sdc.channels.edit.available"/>)</strong></label> <br/>
</c:forEach>
</c:otherwise>
</c:choose>
@@ -62,46 +62,46 @@
<bean:message key="sdc.details.edit.notifications.unentitled"/>
</c:when>
<c:otherwise>
- <html:checkbox property="receive_notifications"/> <bean:message key="sdc.details.edit.updates"/><br/>
- <html:checkbox property="include_in_daily_summary"/> <bean:message key="sdc.details.edit.summary"/>
+ <html:checkbox property="receive_notifications" styleId="receive_notifications"/> <label for="receive_notifications"><bean:message key="sdc.details.edit.updates"/></label><br/>
+ <html:checkbox property="include_in_daily_summary" styleId="summary"/> <label for="summary"><bean:message key="sdc.details.edit.summary"/></label>
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
- <th><bean:message key="sdc.details.edit.autoerrataupdate"/></th>
+ <th><label for="autoerrataupdate"><bean:message key="sdc.details.edit.autoerrataupdate"/></label></th>
<td>
<c:choose>
<c:when test="${system.baseEntitlement == null}">
<bean:message key="sdc.details.edit.autoupdate.unentitled"/>
</c:when>
<c:otherwise>
- <html:checkbox property="auto_update"/> <bean:message key="sdc.details.edit.autoupdate"/>
+ <html:checkbox property="auto_update" styleId="autoerrataupdate"/> <label for="autoerrataupdate"><bean:message key="sdc.details.edit.autoupdate"/></label>
</c:otherwise>
</c:choose>
</td>
</tr>
<tr>
- <th><bean:message key="sdc.details.edit.description"/></th>
- <td><html:textarea property="description" cols="40" rows="6"/></td>
+ <th><label for="description"><bean:message key="sdc.details.edit.description"/></label></th>
+ <td><html:textarea property="description" cols="40" rows="6" styleId="description"/></td>
</tr>
<tr>
- <th><bean:message key="sdc.details.edit.address"/></th>
- <td><html:text property="address1" maxlength="128" size="30" /> <br/>
+ <th><label for="address"><bean:message key="sdc.details.edit.address"/></label></th>
+ <td><html:text property="address1" maxlength="128" size="30" styleId="address"/> <br/>
<html:text property="address2" maxlength="128" size="30" /></td>
</tr>
<tr>
- <th><bean:message key="sdc.details.edit.city"/></th>
- <td><html:text property="city" maxlength="128" size="20" /></td>
+ <th><label for="city"><bean:message key="sdc.details.edit.city"/></label></th>
+ <td><html:text property="city" maxlength="128" size="20" styleId="city"/></td>
</tr>
<tr>
- <th><bean:message key="sdc.details.edit.state"/></th>
- <td><html:text property="state" maxlength="60" size="20" /></td>
+ <th><label for="state"><bean:message key="sdc.details.edit.state"/></label></th>
+ <td><html:text property="state" maxlength="60" size="20" styleId="state"/></td>
</tr>
<tr>
- <th><bean:message key="sdc.details.edit.country"/></th>
+ <th><label for="country"><bean:message key="sdc.details.edit.country"/></label></th>
<td>
- <html:select property="country">
+ <html:select property="country" styleId="country">
<html:options collection="countries"
property="value"
labelProperty="label" />
@@ -109,16 +109,16 @@
</td>
</tr>
<tr>
- <th><bean:message key="sdc.details.edit.building"/></th>
- <td><html:text property="building" maxlength="128" size="16" /></td>
+ <th><label for="building"><bean:message key="sdc.details.edit.building"/></label></th>
+ <td><html:text property="building" maxlength="128" size="16" styleId="building"/></td>
</tr>
<tr>
- <th><bean:message key="sdc.details.edit.room"/></th>
- <td><html:text property="room" maxlength="32" size="16" /></td>
+ <th><label for="room"><bean:message key="sdc.details.edit.room"/></label></th>
+ <td><html:text property="room" maxlength="32" size="16" styleId="room"/></td>
</tr>
<tr>
- <th><bean:message key="sdc.details.edit.rack"/></th>
- <td><html:text property="rack" maxlength="64" size="10" /></td>
+ <th><label for="rack"><bean:message key="sdc.details.edit.rack"/></label></th>
+ <td><html:text property="rack" maxlength="64" size="10" styleId="rack"/></td>
</tr>
</table>
commit 011e7f54b09acb85c63d73c59b95fb3770127794
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 14:09:04 2010 +0200
implement <label> for form fields - user/create/usercreate.jsp
diff --git a/java/code/webapp/WEB-INF/pages/user/create/usercreate.jsp b/java/code/webapp/WEB-INF/pages/user/create/usercreate.jsp
index 41a0dc3..529066c 100644
--- a/java/code/webapp/WEB-INF/pages/user/create/usercreate.jsp
+++ b/java/code/webapp/WEB-INF/pages/user/create/usercreate.jsp
@@ -37,33 +37,33 @@
<table class="details" align="center">
<tr>
- <th><rhn:required-field key="desiredlogin"/>:</th>
+ <th><label for="login"><rhn:required-field key="desiredlogin"/>:</label></th>
<td>
- <html:text property="login" size="15" maxlength="${loginLength}"/>
+ <html:text property="login" size="15" maxlength="${loginLength}" styleId="login"/>
</td>
</tr>
<tr>
- <th><bean:message key="desiredpass" />
- <span name="password-asterisk" class="required-form-field">*</span>:</th>
+ <th><label for="desiredpass"><bean:message key="desiredpass" />
+ <span name="password-asterisk" class="required-form-field">*</span>:</th></label>
<td>
<html:password property="desiredpassword" size="15" maxlength="${passwordLength}"/>
</td>
</tr>
<tr>
- <th><bean:message key="confirmpass" />
- <span name="password-asterisk" class="required-form-field">*</span>:</th>
+ <th><label for="confirmpass"><bean:message key="confirmpass" />
+ <span name="password-asterisk" class="required-form-field">*</span>:</label></th>
<td>
- <html:password property="desiredpasswordConfirm" size="15" maxlength="${passwordLength}"/>
+ <html:password property="desiredpasswordConfirm" size="15" maxlength="${passwordLength}" styleId="confirmpass"/>
</td>
</tr>
<c:if test="${displaypam == 'true' && account_type != 'create_sat'}">
<tr>
- <th><bean:message key="usercreate.jsp.pam"/></th>
+ <th><label for="pam"><bean:message key="usercreate.jsp.pam"/></label></th>
<td>
<c:choose>
<c:when test="${displaypamcheckbox == 'true'}">
- <html:checkbox property="usepam" onclick="toggleVisibilityByName('password-asterisk')"/>
- <bean:message key="usercreate.jsp.pam.instructions"/> <br/>
+ <html:checkbox property="usepam" onclick="toggleVisibilityByName('password-asterisk')" styleId="pam"/>
+ <label for="pam"><bean:message key="usercreate.jsp.pam.instructions"/></label> <br/>
<strong><span style="font-size: 10px">
<bean:message key="usercreate.jsp.pam.instructions.note"/>
</span></strong>
@@ -80,7 +80,7 @@
<h2><bean:message key="usercreate.accountInfo" /></h2>
<table class="details" align="center">
<tr>
- <th><rhn:required-field key="usercreate.names"/>:</th>
+ <th><label for="firstNames"><rhn:required-field key="usercreate.names"/>:</th></label>
<td>
<html:select property="prefix">
<html:options collection="availablePrefixes"
@@ -88,15 +88,15 @@
labelProperty="label" />
</html:select>
- <html:text property="firstNames" size="15" maxlength="${firstNameLength}"/>
+ <html:text property="firstNames" size="15" maxlength="${firstNameLength}" styleId="firstNames"/>
<html:text property="lastName" size="15" maxlength="${lastNameLength}"/>
</td>
</tr>
<tr>
- <th><rhn:required-field key="email"/>:</th>
+ <th><label for="email"><rhn:required-field key="email"/>:</label></th>
<td>
- <html:text property="email" size="20" maxlength="${emailLength}"/>
+ <html:text property="email" size="20" maxlength="${emailLength}" styleId="email"/>
</td>
</tr>
<html:hidden property="account_type" value="${account_type}" />
commit 9e41bfa078a316f18a13dd78309e6875ad2136c2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 13:47:47 2010 +0200
implement <label> for form fields - activationkeys/details.jspf
diff --git a/java/code/webapp/WEB-INF/pages/common/fragments/activationkeys/details.jspf b/java/code/webapp/WEB-INF/pages/common/fragments/activationkeys/details.jspf
index ffb369a..1cf2bc3 100644
--- a/java/code/webapp/WEB-INF/pages/common/fragments/activationkeys/details.jspf
+++ b/java/code/webapp/WEB-INF/pages/common/fragments/activationkeys/details.jspf
@@ -16,10 +16,10 @@
<table class="details">
<tr>
<th>
- <bean:message key="kickstart.activationkeys.jsp.description"/>
+ <label for="description"><bean:message key="kickstart.activationkeys.jsp.description"/></label>
</th>
<td>
- <html:text property="description"/><br/>
+ <html:text property="description" styleId="description"/><br/>
<rhn:tooltip>
<bean:message key="activation-key.jsp.edit-description-tooltip"
arg0 = "${requestScope.blankDescription}"/>
@@ -28,11 +28,11 @@
</tr>
<tr>
<th>
- <bean:message key="kickstart.activationkeys.jsp.key"/>:
+ <label for="key"><bean:message key="kickstart.activationkeys.jsp.key"/>:</label>
</th>
<td>
<c:if test="${not requestScope.unprefixed}">${requestScope.prefix}</c:if>
- <html:text property="key"/><br/>
+ <html:text property="key" styleId="key"/><br/>
<c:choose>
<c:when test = "${not requestScope.unprefixed}">
<rhn:tooltip key="activation-key.jsp.blank.auto-generator.prefix-notice"/>
@@ -49,19 +49,19 @@
</tr>
<tr>
<th>
- <bean:message key="kickstart.activationkeys.jsp.usagelimit"/>:
+ <label for="usageLimit"><bean:message key="kickstart.activationkeys.jsp.usagelimit"/>:</label>
</th>
<td>
- <html:text property="usageLimit"/><br/>
+ <html:text property="usageLimit" styleId="usageLimit"/><br/>
<rhn:tooltip key="activation-key.jsp.blank.unlimited-use"/>
</td>
</tr>
<tr>
<th>
- <bean:message key="activation-key.jsp.base-channels"/>:
+ <label for="selectedChannel"><bean:message key="activation-key.jsp.base-channels"/>:</label>
</th>
<td>
- <html:select property="selectedChannel">
+ <html:select property="selectedChannel" styleId="selectedChannel">
<html:options collection="possibleChannels"
property="value"
labelProperty="label" />
@@ -81,8 +81,8 @@
</th>
<td>
<c:forEach items="${possibleEntitlements}" var="item">
- <html:multibox property="selectedEntitlements" disabled="${item.disabled}">
- <c:out value="${item.value}"/>
+ <html:multibox property="selectedEntitlements" disabled="${item.disabled}" styleId="${item.value}">
+ <label for="${item.value}"><c:out value="${item.value}"/></label>
</html:multibox>
<c:out value="${item.label}"/>
<br />
@@ -93,13 +93,13 @@
<c:if test="${not requestScope.create}">
<tr>
<th>
- <bean:message key="activation-key.jsp.enable-config-auto-deploy"/>:
+ <label for="enable-config-auto-deploy"><bean:message key="activation-key.jsp.enable-config-auto-deploy"/>:</label>
</th>
<td>
<rhn:require acl="token_has_entitlement(provisioning_entitled)"
mixins="com.redhat.rhn.common.security.acl.ActivationKeyAclHandler">
- <html:checkbox property="autoDeploy"/><br/>
+ <html:checkbox property="autoDeploy" styleId="enable-config-auto-deploy" /><br/>
<rhn:tooltip key="activation-key.jsp.config-auto-deploy-tooltip"/>
</rhn:require>
<rhn:require acl="not token_has_entitlement(provisioning_entitled)"
@@ -115,10 +115,10 @@
</c:if>
<tr>
<th>
- <bean:message key="activation-key.jsp.universal-default"/>:
+ <label for="universal"><bean:message key="activation-key.jsp.universal-default"/>:</label>
</th>
<td>
- <html:checkbox property="universal"/><br/>
+ <html:checkbox property="universal" styleId="universal" /><br/>
<rhn:tooltip key="activation-key.jsp.edit.universal-default-tooltip"/>
</td>
</tr>
commit a0df7d3894e6d815c545ab64c43ba5f9ab4316d8
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 13:37:01 2010 +0200
implement <label> for form fields - edit.jsp
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 cc1f02a..d7aef0f 100644
--- a/java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp
+++ b/java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp
@@ -28,20 +28,20 @@
<table class="details">
<tr>
<th nowrap="nowrap">
- <rhn:required-field key="channel.edit.jsp.name"/>:
+ <label for="name"><rhn:required-field key="channel.edit.jsp.name"/>:</label>
</th>
<td class="small-form">
- <html:text property="name" maxlength="256" size="48"/>
+ <html:text property="name" maxlength="256" size="48" styleId="name"/>
</td>
</tr>
<tr>
<th nowrap="nowrap">
- <rhn:required-field key="channel.edit.jsp.label"/>:
+ <label for="label"><rhn:required-field key="channel.edit.jsp.label"/>:</label>
</th>
<td class="small-form">
<c:choose>
<c:when test='${empty param.cid}'>
- <html:text property="label" maxlength="128" size="32" />
+ <html:text property="label" maxlength="128" size="32" styleId="label" />
</c:when>
<c:otherwise>
<c:out value="${channel_label}"/>
@@ -52,12 +52,12 @@
</tr>
<tr>
<th nowrap="nowrap">
- <bean:message key="channel.edit.jsp.parent"/>:
+ <label for="parent"><bean:message key="channel.edit.jsp.parent"/>:</label>
</th>
<td class="small-form">
<c:choose>
<c:when test='${empty param.cid}'>
- <html:select property="parent">
+ <html:select property="parent" styleId="parent">
<html:options collection="parentChannels"
property="value"
labelProperty="label" />
@@ -72,12 +72,12 @@
</tr>
<tr>
<th nowrap="nowrap">
- <bean:message key="channel.edit.jsp.parentarch"/>:
+ <label for="parentarch"><bean:message key="channel.edit.jsp.parentarch"/>:</label>
</th>
<td class="small-form">
<c:choose>
<c:when test='${empty param.cid}'>
- <html:select property="arch">
+ <html:select property="arch" styleId="parentarch">
<html:options collection="channelArches"
property="value"
labelProperty="label" />
@@ -93,7 +93,7 @@
</tr>
<tr>
<th nowrap="nowrap">
- <bean:message key="channel.edit.jsp.checksum"/>:
+ <label for="checksum"><bean:message key="channel.edit.jsp.checksum"/>:</label>
</th>
<td class="small-form">
<html:select property="checksum">
@@ -106,18 +106,18 @@
</tr>
<tr>
<th nowrap="nowrap">
- <rhn:required-field key="channel.edit.jsp.summary"/>:
+ <label for="summary"><rhn:required-field key="channel.edit.jsp.summary"/>:</label>
</th>
<td class="small-form">
- <html:text property="summary" maxlength="500" size="40" />
+ <html:text property="summary" maxlength="500" size="40" styleId="summary" />
</td>
</tr>
<tr>
<th nowrap="nowrap">
- <bean:message key="channel.edit.jsp.description"/>:
+ <label for="description"><bean:message key="channel.edit.jsp.description"/>:</label>
</th>
<td class="small-form">
- <html:textarea property="description" cols="40" rows="6"/>
+ <html:textarea property="description" cols="40" rows="6" styleId="description"/>
</td>
</tr>
</table>
@@ -127,18 +127,18 @@
<table class="details">
<tr>
<th>
- <bean:message key="channel.edit.jsp.repourl"/>:
+ <label for="yum_repo"><bean:message key="channel.edit.jsp.repourl"/>:</label>
</th>
<td>
- <html:text property="yum_repo" maxlength="512" size="64" />
+ <html:text property="yum_repo" maxlength="512" size="64" styleId="yum_repo"/>
</td>
</tr>
<tr>
<th>
- <bean:message key="channel.edit.jsp.repolabel"/>:
+ <label for="repolabel"><bean:message key="channel.edit.jsp.repolabel"/>:</label>
</th>
<td>
- <html:text property="repo_label" maxlength="64" size="20" />
+ <html:text property="repo_label" maxlength="64" size="20" styleId="repolabel" />
</td>
</tr>
<c:if test='${not empty param.cid}'>
@@ -158,10 +158,10 @@
</c:if>
<tr>
<th>
- <bean:message key="channel.edit.jsp.sync"/>:
+ <label for="sync_repo"><bean:message key="channel.edit.jsp.sync"/>:</label>
</th>
<td>
- <html:checkbox property="sync_repo" />
+ <html:checkbox property="sync_repo" styleId="sync_repo"/>
</td>
</tr>
</table>
@@ -170,10 +170,10 @@
<table class="details">
<tr>
<th nowrap="nowrap">
- <bean:message key="channel.edit.jsp.maintainername"/>:
+ <label for="maintainer_name"><bean:message key="channel.edit.jsp.maintainername"/>:</label>
</th>
<td class="small-form">
- <html:text property="maintainer_name" maxlength="128" size="40" />
+ <html:text property="maintainer_name" maxlength="128" size="40" styleId="maintainer_name"/>
</td>
</tr>
<tr>
@@ -183,21 +183,21 @@
<td class="small-form">
<table>
<tr>
- <td><bean:message key="channel.edit.jsp.emailaddress"/>:</td>
- <td><html:text property="maintainer_email" size="20" /></td>
+ <td><label for="maintainer_email"><bean:message key="channel.edit.jsp.emailaddress"/>:</label></td>
+ <td><html:text property="maintainer_email" size="20" styleId="maintainer_email"/></td>
</tr><tr>
- <td><bean:message key="channel.edit.jsp.phonenumber"/>:</td>
- <td><html:text property="maintainer_phone" size="20" /></td>
+ <td><label for="maintainer_phone"><bean:message key="channel.edit.jsp.phonenumber"/>:</label></td>
+ <td><html:text property="maintainer_phone" size="20" styleId="maintainer_phone"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<th nowrap="nowrap">
- <bean:message key="channel.edit.jsp.supportpolicy"/>:
+ <label for="support_policy"><bean:message key="channel.edit.jsp.supportpolicy"/>:</label>
</th>
<td class="small-form">
- <html:textarea property="support_policy" cols="40" rows="6" />
+ <html:textarea property="support_policy" cols="40" rows="6" styleId="support_policy"/>
</td>
</tr>
</table>
@@ -210,11 +210,11 @@
<td class="small-form">
<table>
<tr>
- <td><html:radio property="per_user_subscriptions" value="all" /></td>
- <td><bean:message key="channel.edit.jsp.allusers"/></td>
+ <td><html:radio property="per_user_subscriptions" value="all" styleId="allusers" /></td>
+ <td><label for="allusers"><bean:message key="channel.edit.jsp.allusers"/></label></td>
</tr><tr>
- <td><html:radio property="per_user_subscriptions" value="selected" /></td>
- <td><bean:message key="channel.edit.jsp.selectedusers"/></td>
+ <td><html:radio property="per_user_subscriptions" value="selected" styleId="selectedusers" /></td>
+ <td><label for="selectedusers"><bean:message key="channel.edit.jsp.selectedusers"/></label></td>
</tr>
</table>
</td>
@@ -226,18 +226,18 @@
<td class="small-form">
<table>
<tr>
- <td><html:radio property="org_sharing" value="private" /></td>
- <td><bean:message key="channel.edit.jsp.private"
- arg0="/rhn/multiorg/Organizations.do"/></td>
+ <td><html:radio property="org_sharing" value="private" styleId="private"/></td>
+ <td><label for="private"><bean:message key="channel.edit.jsp.private"
+ arg0="/rhn/multiorg/Organizations.do"/></label></td>
</tr><tr>
- <td><html:radio property="org_sharing" value="protected" /></td>
- <td><bean:message key="channel.edit.jsp.protected"
- arg0="/rhn/multiorg/Organizations.do"/>
+ <td><html:radio property="org_sharing" value="protected" styleId="protected" /></td>
+ <td><label for="protected"><bean:message key="channel.edit.jsp.protected"
+ arg0="/rhn/multiorg/Organizations.do"/></label>
</td>
</tr><tr>
- <td><html:radio property="org_sharing" value="public" /></td>
- <td><bean:message key="channel.edit.jsp.public"
- arg0="/rhn/multiorg/Organizations.do"/></td>
+ <td><html:radio property="org_sharing" value="public" styleId="public"/></td>
+ <td><label for="public"><bean:message key="channel.edit.jsp.public"
+ arg0="/rhn/multiorg/Organizations.do"/></label></td>
</tr>
</table>
</td>
@@ -247,26 +247,26 @@
<table class="details">
<tr>
<th nowrap="nowrap">
- <bean:message key="channel.edit.jsp.gpgkeyurl"/>:
+ <label for="gpgkeyurl"><bean:message key="channel.edit.jsp.gpgkeyurl"/>:</label>
</th>
<td class="small-form">
- <html:text property="gpg_key_url" maxlength="256" size="40" />
+ <html:text property="gpg_key_url" maxlength="256" size="40" styleId="gpgkeyurl"/>
</td>
</tr>
<tr>
<th nowrap="nowrap">
- <bean:message key="channel.edit.jsp.gpgkeyid"/>:
+ <label for="gpgkeyid"><bean:message key="channel.edit.jsp.gpgkeyid"/>:</label>
</th>
<td class="small-form">
- <html:text property="gpg_key_id" maxlength="8" size="8"/><br />Ex: DB42A60E
+ <html:text property="gpg_key_id" maxlength="8" size="8" styleId="gpgkeyid"/><br />Ex: DB42A60E
</td>
</tr>
<tr>
<th nowrap="nowrap">
- <bean:message key="channel.edit.jsp.gpgkeyfingerprint"/>:
+ <label for="gpgkeyfingerprint"><bean:message key="channel.edit.jsp.gpgkeyfingerprint"/>:</label>
</th>
<td class="small-form">
- <html:text property="gpg_key_fingerprint" maxlength="50" size="60"/><br />
+ <html:text property="gpg_key_fingerprint" maxlength="50" size="60" styleId="gpgkeyfingerprint"/><br />
Ex: CA20 8686 2BD6 9DFC 65F6 ECC4 2191 80CD DB42 A60E
</td>
</tr>
commit 18f467bddb10b95fdbb125e814f46046c1008ebd
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 10:42:51 2010 +0200
implement <label> for form fields - orgcreate.jsp
diff --git a/java/code/webapp/WEB-INF/pages/admin/multiorg/orgcreate.jsp b/java/code/webapp/WEB-INF/pages/admin/multiorg/orgcreate.jsp
index 3cb90e5..82288c7 100644
--- a/java/code/webapp/WEB-INF/pages/admin/multiorg/orgcreate.jsp
+++ b/java/code/webapp/WEB-INF/pages/admin/multiorg/orgcreate.jsp
@@ -17,8 +17,8 @@
<h2><bean:message key="orgdetails.jsp.header"/></h2>
<table class="details" align="center">
<tr>
- <th width="25%"><rhn:required-field key="org.name.jsp"/>:</th>
- <td><html:text property="orgName" maxlength="128" size="40" />
+ <th width="25%"><label for="orgName"><rhn:required-field key="org.name.jsp"/>:</label></th>
+ <td><html:text property="orgName" maxlength="128" size="40" styleId="orgName" />
<br>
<span class="small-text"><strong><bean:message key="tip" /></strong>
<bean:message key="org.name.length.tip" /></span>
@@ -31,9 +31,9 @@
<bean:message key="orgcreate.header2"/>
</p>
<tr>
- <th><rhn:required-field key="desiredlogin"/>:</th>
+ <th><label for="login"><rhn:required-field key="desiredlogin"/>:</label></th>
<td>
- <html:text property="login" size="15" maxlength="45"/>
+ <html:text property="login" size="15" maxlength="45" styleId="login" />
<br>
<span class="small-text"><strong><bean:message key="tip" /></strong>
<bean:message key="org.login.tip" arg0="${rhn:getConfig('web.min_user_len')}" /><br>"
@@ -42,26 +42,26 @@
</td>
</tr>
<tr>
- <th><bean:message key="desiredpass" />
- <span name="password-asterisk" class="required-form-field">*</span>:</th>
+ <th><label for="desiredpass"><bean:message key="desiredpass" />
+ <span name="password-asterisk" class="required-form-field">*</span>:</label></th>
<td>
- <html:password property="desiredpassword" size="15" maxlength="32"/>
+ <html:password property="desiredpassword" size="15" maxlength="32" styleId="desiredpass" />
</td>
</tr>
<tr>
- <th><bean:message key="confirmpass" />
- <span name="password-asterisk" class="required-form-field">*</span>:</th>
+ <th><label for="confirmpass"><bean:message key="confirmpass" />
+ <span name="password-asterisk" class="required-form-field">*</span>:</label></th>
<td>
- <html:password property="desiredpasswordConfirm" size="15" maxlength="32"/>
+ <html:password property="desiredpasswordConfirm" size="15" maxlength="32" styleId="confirmpass"/>
</td>
</tr>
<tr>
- <th><bean:message key="usercreate.jsp.pam"/></th>
+ <th><label for="pam"><bean:message key="usercreate.jsp.pam"/></label></th>
<td>
<c:choose>
<c:when test="${displaypamcheckbox == 'true'}">
- <html:checkbox property="usepam" onclick="toggleVisibilityByName('password-asterisk')"/>
- <bean:message key="usercreate.jsp.pam.instructions"/> <br/>
+ <html:checkbox property="usepam" onclick="toggleVisibilityByName('password-asterisk')" styleId="pam"/>
+ <label for="pam"><bean:message key="usercreate.jsp.pam.instructions"/></label> <br/>
<strong><span style="font-size: 10px">
<bean:message key="usercreate.jsp.pam.instructions.note"/>
</span></strong>
@@ -73,13 +73,13 @@
</td>
</tr>
<tr>
- <th><rhn:required-field key="email"/>:</th>
+ <th><label for="email"><rhn:required-field key="email"/>:</label></th>
<td>
- <html:text property="email" size="45" maxlength="128"/>
+ <html:text property="email" size="45" maxlength="128" styleId="email" />
</td>
</tr>
<tr>
- <th><rhn:required-field key="firstNames"/>:</th>
+ <th><label for="firstNames"><rhn:required-field key="firstNames"/>:</label></th>
<td>
<html:select property="prefix">
@@ -87,13 +87,13 @@
property="value"
labelProperty="label" />
</html:select>
- <html:text property="firstNames" size="45" maxlength="128"/>
+ <html:text property="firstNames" size="45" maxlength="128" styleId="firstNames"/>
</td>
</tr>
<tr>
- <th><rhn:required-field key="lastName"/>:</th>
+ <th><label for="lastName"><rhn:required-field key="lastName"/>:</label></th>
<td>
- <html:text property="lastName" size="45" maxlength="128"/>
+ <html:text property="lastName" size="45" maxlength="128" styleId="lastName"/>
</td>
</tr>
<tr>
commit ed48edf2e8568672eff884a622c9147018b7611c
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 10:25:07 2010 +0200
implement <label> for form fields - probe-edit.jsp
diff --git a/java/code/webapp/WEB-INF/pages/admin/monitoring/config/probe-edit.jsp b/java/code/webapp/WEB-INF/pages/admin/monitoring/config/probe-edit.jsp
index 3339183..c6f298a 100644
--- a/java/code/webapp/WEB-INF/pages/admin/monitoring/config/probe-edit.jsp
+++ b/java/code/webapp/WEB-INF/pages/admin/monitoring/config/probe-edit.jsp
@@ -50,18 +50,18 @@ function refreshNotifFields() {
</tr>
</c:if>
<tr>
- <th><bean:message key="probeedit.jsp.description" /></th>
- <td colspan="3"><html:text property="description" maxlength="100" size="50" /></td>
+ <th><label for="description"><bean:message key="probeedit.jsp.description" /></label></th>
+ <td colspan="3"><html:text property="description" maxlength="100" size="50" styleId="description"/></td>
</tr>
<tr>
- <th><bean:message key="probeedit.jsp.notification" /></th>
- <td colspan="3"><html:checkbox onclick="refreshNotifFields()" property="notification" /></td>
+ <th><label for="notification"><bean:message key="probeedit.jsp.notification" /></label></th>
+ <td colspan="3"><html:checkbox onclick="refreshNotifFields()" property="notification" styleId="notification"/></td>
</tr>
<tr>
- <th><bean:message key="probeedit.jsp.notifmin" /></th>
+ <th><label for="notifmin"><bean:message key="probeedit.jsp.notifmin" /></label></th>
<td colspan="3">
<html:select property="notification_interval_min"
- disabled="${not probeEditForm.map.notification}">
+ disabled="${not probeEditForm.map.notification}" styleId="notifmin">
<html:options collection="intervals"
property="value"
labelProperty="label" />
@@ -69,9 +69,9 @@ function refreshNotifFields() {
</td>
</tr>
<tr>
- <th><bean:message key="probeedit.jsp.notifmethod" /></th>
+ <th><label for="notifmethod"><bean:message key="probeedit.jsp.notifmethod" /></label></th>
<td colspan="3"><html:select property="contact_group_id"
- disabled="${not probeEditForm.map.notification}">
+ disabled="${not probeEditForm.map.notification}" styleId="notifmethod">
<html:options collection="contactGroups"
property="value"
labelProperty="label" />
@@ -79,9 +79,9 @@ function refreshNotifFields() {
</td>
</tr>
<tr>
- <th><bean:message key="probeedit.jsp.checkinterval" /></th>
+ <th><label for="checkinterval"><bean:message key="probeedit.jsp.checkinterval" /></label></th>
<td colspan="3">
- <html:select property="check_interval_min">
+ <html:select property="check_interval_min" styleId="checkinterval">
<html:options collection="intervals"
property="value"
labelProperty="label" />
commit 4716242ab6b9fa49b90cb6a4989e776cc5500393
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 10:18:57 2010 +0200
implement <label> for form fields - filter-form.jspf
diff --git a/java/code/webapp/WEB-INF/pages/admin/monitoring/config/notification/filter-form.jspf b/java/code/webapp/WEB-INF/pages/admin/monitoring/config/notification/filter-form.jspf
index b2cedd7..23ada5d 100644
--- a/java/code/webapp/WEB-INF/pages/admin/monitoring/config/notification/filter-form.jspf
+++ b/java/code/webapp/WEB-INF/pages/admin/monitoring/config/notification/filter-form.jspf
@@ -53,18 +53,18 @@ function showDestination() {
<table class="details">
<tr>
<th>
- <rhn:required-field key="filter-form.jspf.description"/>
+ <label for="description"><rhn:required-field key="filter-form.jspf.description"/></label>
</th>
<td>
- <html:text property="description" maxlength="25" size="25" />
+ <html:text property="description" maxlength="25" size="25" styleId="description"/>
</td>
</tr>
<tr>
<th>
- <bean:message key="filter-form.jspf.filterType"/>
+ <label for="filterType"><bean:message key="filter-form.jspf.filterType"/></label>
</th>
<td>
- <html:select property="filterType" onchange="showDestination()">
+ <html:select property="filterType" onchange="showDestination()" styleId="filterType" >
<html:options collection="filterTypes"
property="name"
labelProperty="longName" />
@@ -73,18 +73,18 @@ function showDestination() {
</tr>
<tr id="destination" title="<bean:message key="filter-form.jspf.destination_help"/>">
<th>
- <bean:message key="filter-form.jspf.destination"/>
+ <label for="destination"><bean:message key="filter-form.jspf.destination"/></label>
</th>
<td>
- <html:text property="destination" maxlength="255" size="60" /><br/>
+ <html:text property="destination" maxlength="255" size="60" styleId="destination" /><br/>
</td>
</tr>
<tr>
<th>
- <bean:message key="filter-form.jspf.scope"/>
+ <label for="scope"><bean:message key="filter-form.jspf.scope"/></label>
</th>
<td>
- <html:select property="scope" style="width: 100%" onchange="selectScope()">
+ <html:select property="scope" style="width: 100%" onchange="selectScope()" styleId="scope" >
<html:options collection="scopes"
property="value"
labelProperty="label" />
@@ -93,10 +93,10 @@ function showDestination() {
</tr>
<tr id="scope-orgs">
<th>
- <bean:message key="filter-form.jspf.orgs"/>
+ <label for="scope-orgs"><bean:message key="filter-form.jspf.orgs"/></label>
</th>
<td>
- <html:select size="5" multiple="true" style="width: 100%" property="org">
+ <html:select size="5" multiple="true" style="width: 100%" property="org" styleId="scope-orgs">
<html:options collection="org"
property="id"
labelProperty="name" />
@@ -105,10 +105,10 @@ function showDestination() {
</tr>
<tr id="scope-scouts">
<th>
- <bean:message key="filter-form.jspf.scouts"/>
+ <label for="scouts"><bean:message key="filter-form.jspf.scouts"/></label>
</th>
<td>
- <html:select size="5" multiple="true" style="width: 100%" property="scout">
+ <html:select size="5" multiple="true" style="width: 100%" property="scout" styleId="scouts">
<html:options collection="scout"
property="id"
labelProperty="description" />
@@ -117,10 +117,10 @@ function showDestination() {
</tr>
<tr id="scope-probes">
<th>
- <bean:message key="filter-form.jspf.probes"/>
+ <label for="probes"><bean:message key="filter-form.jspf.probes"/></label>
</th>
<td>
- <html:select size="5" multiple="true" style="width: 100%" property="probe">
+ <html:select size="5" multiple="true" style="width: 100%" property="probe" styleId="probes">
<html:options collection="probe"
property="id"
labelProperty="label" />
@@ -139,10 +139,10 @@ function showDestination() {
</tr>
<tr>
<th>
- <bean:message key="filter-form.jspf.contact_groups"/>
+ <label for="contact_groups"><bean:message key="filter-form.jspf.contact_groups"/></label>
</th>
<td>
- <html:select size="5" multiple="true" style="width: 100%" property="contact_groups">
+ <html:select size="5" multiple="true" style="width: 100%" property="contact_groups" styleId="contact_groups">
<html:option value="all" key="filter-form.jspf.all_contact_groups" style="font-style: italic"/>
<html:options collection="contact_groups"
property="recid"
@@ -152,10 +152,10 @@ function showDestination() {
</tr>
<tr>
<th>
- <bean:message key="filter-form.jspf.output_match"/>
+ <label for="output_match"><bean:message key="filter-form.jspf.output_match"/></label>
</th>
<td>
- <html:text property="output_match" maxlength="255" size="60" /><br/><html:checkbox property="output_match_case"><bean:message key="filter-form.jspf.output_match_case"/></html:checkbox><br/>
+ <html:text property="output_match" maxlength="255" size="60" styleId="output_match"/><br/><html:checkbox property="output_match_case" styleId="output_match_case"><bean:message key="filter-form.jspf.output_match_case"/></html:checkbox><br/>
<bean:message key="filter-form.jspf.output_match_help"/>
</td>
</tr>
@@ -163,8 +163,8 @@ function showDestination() {
<th>
<bean:message key="filter-form.jspf.scheduletype"/></th>
<td>
- <html:radio onclick="toggleRecurringFields()" property="recurring" value="false" /><bean:message key="filter-form.jspf.singleuse"/>
- <html:radio onclick="toggleRecurringFields()" property="recurring" value="true" /><bean:message key="filter-form.jspf.recurring"/>
+ <html:radio onclick="toggleRecurringFields()" property="recurring" value="false" styleId="recurring-false"/><label for="recurring-false"><bean:message key="filter-form.jspf.singleuse"/></label>
+ <html:radio onclick="toggleRecurringFields()" property="recurring" value="true" styleId="recurring-true" /><label for="recurring-true"><bean:message key="filter-form.jspf.recurring"/></label>
</td>
</tr>
<tr>
@@ -182,10 +182,9 @@ function showDestination() {
</td>
</tr>
<tr>
- <th><rhn:required-field key="filter-form.jspf.recurring_duration"/></th>
+ <th><label for="recurring_duration"><rhn:required-field key="filter-form.jspf.recurring_duration"/></label></th>
<td>
-
- <html:text property="recurring_duration" maxlength="2" size="2" />
+ <html:text property="recurring_duration" maxlength="2" size="2" styleId="recurring_duration" />
<html:select property="duration_type">
<html:options collection="duration_types"
property="value"
@@ -194,9 +193,9 @@ function showDestination() {
</td>
</tr>
<tr>
- <th><bean:message key="filter-form.jspf.recurring_frequency"/></th>
+ <th><label for="recurring_frequency"><bean:message key="filter-form.jspf.recurring_frequency"/></label></th>
<td>
- <html:select disabled="true" property="recurring_frequency">
+ <html:select disabled="true" property="recurring_frequency" styleId="recurring_frequency">
<html:options collection="frequency_types"
property="value"
labelProperty="label" />
commit e9ff9be6c72da85471c8a699882964051daafe58
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 09:50:12 2010 +0200
implement <label> for form fields - restart.jsp
diff --git a/java/code/webapp/WEB-INF/pages/admin/config/restart.jsp b/java/code/webapp/WEB-INF/pages/admin/config/restart.jsp
index c7981a4..3db7b9d 100644
--- a/java/code/webapp/WEB-INF/pages/admin/config/restart.jsp
+++ b/java/code/webapp/WEB-INF/pages/admin/config/restart.jsp
@@ -29,10 +29,10 @@
<table class="details">
<tr>
<th>
- <bean:message key="restart.jsp.restart_satellite"/>
+ <label for="restart"><bean:message key="restart.jsp.restart_satellite"/></label>
</th>
<td>
- <html:checkbox property="restart" />
+ <html:checkbox property="restart" styleId="restart" />
</td>
</tr>
commit 11a6361d6400155144d9055b64cd668f4340ca9f
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 09:48:31 2010 +0200
implement <label> for form fields - monitoring.jsp
diff --git a/java/code/webapp/WEB-INF/pages/admin/config/monitoring.jsp b/java/code/webapp/WEB-INF/pages/admin/config/monitoring.jsp
index 43b31a3..10b2298 100644
--- a/java/code/webapp/WEB-INF/pages/admin/config/monitoring.jsp
+++ b/java/code/webapp/WEB-INF/pages/admin/config/monitoring.jsp
@@ -28,16 +28,16 @@
<table class="details">
<tr>
<th>
- <bean:message key="general.jsp.monitoring_scout"/>
+ <label for="is_monitoring_scout"><bean:message key="general.jsp.monitoring_scout"/></label>
</th>
<td>
- <html:checkbox property="is_monitoring_scout" />
+ <html:checkbox property="is_monitoring_scout" styleId="is_monitoring_scout" />
</td>
</tr>
<c:forEach items="${configList}" var="config">
<tr>
- <th>${config.description}</th>
- <td><input type="text" size="30" name="${config.name}" value="${config.value}" maxlength="255" /></td>
+ <th><label for="${config.name}">${config.description}</label></th>
+ <td><input type="text" size="30" name="${config.name}" value="${config.value}" maxlength="255" styleId="${config.name}" /></td>
</tr>
</c:forEach>
commit c263d001acbdc6b64878067d97803d056bb4bb37
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 09:44:57 2010 +0200
implement <label> for form fields - bootstrap.jsp
diff --git a/java/code/webapp/WEB-INF/pages/admin/config/bootstrap.jsp b/java/code/webapp/WEB-INF/pages/admin/config/bootstrap.jsp
index adefc68..cb037fa 100644
--- a/java/code/webapp/WEB-INF/pages/admin/config/bootstrap.jsp
+++ b/java/code/webapp/WEB-INF/pages/admin/config/bootstrap.jsp
@@ -25,74 +25,74 @@
<table class="details">
<tr>
<th>
- <rhn:required-field key="bootstrap.jsp.hostname"/>:
+ <label for="hostname"><rhn:required-field key="bootstrap.jsp.hostname"/>:</label>
</th>
<td>
- <html:text size="32" property="hostname" />
+ <html:text size="32" property="hostname" styleId="hostname" />
</td>
</tr>
<tr>
<th>
- <rhn:required-field key="bootstrap.jsp.ssl-cert"/>:
+ <label for="ssl-cert"><rhn:required-field key="bootstrap.jsp.ssl-cert"/>:</label>
</th>
<td>
- <html:text size="32" property="ssl-cert" />
+ <html:text size="32" property="ssl-cert" styleId="ssl-cert" />
</td>
</tr>
<tr>
<th>
- <bean:message key="bootstrap.jsp.ssl"/>
+ <label for="ssl"><bean:message key="bootstrap.jsp.ssl"/></label>
</th>
<td>
- <html:checkbox property="ssl" />
+ <html:checkbox property="ssl" styleId="ssl" />
</td>
</tr>
<tr>
<th>
- <bean:message key="bootstrap.jsp.gpg"/>
+ <label for="gpg"><bean:message key="bootstrap.jsp.gpg"/></label>
</th>
<td>
- <html:checkbox property="gpg" />
+ <html:checkbox property="gpg" styleId="gpg" />
</td>
</tr>
<tr>
<th>
- <bean:message key="bootstrap.jsp.allow-config-actions"/>
+ <label for="allow-config-actions"><bean:message key="bootstrap.jsp.allow-config-actions"/></label>
</th>
<td>
- <html:checkbox property="allow-config-actions" />
+ <html:checkbox property="allow-config-actions" styleId="allow-config-actions"/>
</td>
</tr>
<tr>
<th>
- <bean:message key="bootstrap.jsp.allow-remote-commands"/>
+ <label for="allow-remote-commands"><bean:message key="bootstrap.jsp.allow-remote-commands"/></label>
</th>
<td>
- <html:checkbox property="allow-remote-commands"/>
+ <html:checkbox property="allow-remote-commands" styleId="allow-remote-commands" />
</td>
</tr>
<tr>
<th>
- <bean:message key="bootstrap.jsp.http-proxy"/>
+ <label for="http-proxy"><bean:message key="bootstrap.jsp.http-proxy"/></label>
</th>
<td>
- <html:text size="32" property="http-proxy" />
+ <html:text size="32" property="http-proxy" styleId="http-proxy" />
</td>
</tr>
<tr>
<th>
- <bean:message key="bootstrap.jsp.http-proxy-username"/>
+ <label for="http-proxy-username"><bean:message key="bootstrap.jsp.http-proxy-username"/></label>
</th>
<td>
- <html:text size="32" property="http-proxy-username" />
+ <html:text size="32" property="http-proxy-username" styleId="http-proxy-username" />
</td>
</tr>
<tr>
<th>
- <bean:message key="bootstrap.jsp.http-proxy-password"/>
+ <label for="http-proxy-password"><bean:message key="bootstrap.jsp.http-proxy-password"/></label>
</th>
<td>
- <html:text size="32" property="http-proxy-password" />
+ <html:text size="32" property="http-proxy-password" styleId="http-proxy-password" />
</td>
</tr>
commit 18f37edf004d8fde09a759abb6f35f8b035e6df2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Jun 18 09:34:57 2010 +0200
fix syntax error
addressing:
SyntaxError: ('invalid syntax', ('rhncli.py', 96, 15, ' sys.exit(2))\n'))
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py b/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py
index 186fedb..2749252 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhncli.py
@@ -92,8 +92,8 @@ class RhnCli(object):
"Verify that the time on this system is correct.\n"))
sys.exit(1)
except SSL.SysCallError, socket.error:
- sys.stderr.write("OpenSSL.SSL.SysCallError: %s\n" % str(e)
- sys.exit(2))
+ sys.stderr.write("OpenSSL.SSL.SysCallError: %s\n" % str(e))
+ sys.exit(2)
except crypto.Error, e:
sys.stderr.write(_("There was a SSL crypto error: %s\n") % e)
except SystemExit, e:
@@ -105,8 +105,8 @@ class RhnCli(object):
sys.stderr.write("%s\n" % e)
sys.exit(1)
except xmlrpclib.ProtocolError, e:
- sys.stderr.write("XMLRPC ProtocolError: %s\n" % str(e)
- sys.exit(3))
+ sys.stderr.write("XMLRPC ProtocolError: %s\n" % str(e))
+ sys.exit(3)
def initialize(self):
(self.options, self.args) = self.optparser.parse_args()
commit 9663b8691f2d57e2ea69a33e08daa04d0a21fce5
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Jun 17 17:54:24 2010 +0200
implement <label> for form fields - general.jsp
diff --git a/java/code/webapp/WEB-INF/pages/admin/config/general.jsp b/java/code/webapp/WEB-INF/pages/admin/config/general.jsp
index 1fb5eed..1396df1 100644
--- a/java/code/webapp/WEB-INF/pages/admin/config/general.jsp
+++ b/java/code/webapp/WEB-INF/pages/admin/config/general.jsp
@@ -24,91 +24,91 @@
<table class="details">
<tr>
<th>
- <rhn:required-field key="general.jsp.admin_email"/>
+ <label for="admin_email"><rhn:required-field key="general.jsp.admin_email"/></label>
</th>
<td>
- <html:text property="traceback_mail" size="32" />
+ <html:text property="traceback_mail" size="32" styleId="admin_email" />
</td>
</tr>
<tr>
<th>
- <rhn:required-field key="general.jsp.hostname"/>
+ <label for="hostname"><rhn:required-field key="general.jsp.hostname"/></label>
</th>
<td>
- <html:text property="server|jabber_server" size="32" />
+ <html:text property="server|jabber_server" size="32" styleId="hostname" />
</td>
</tr>
<tr>
<th>
- <bean:message key="general.jsp.proxy"/>
+ <label for="proxy"><bean:message key="general.jsp.proxy"/></label>
</th>
<td>
- <html:text property="server|satellite|http_proxy" size="32" />
+ <html:text property="server|satellite|http_proxy" size="32" styleId="proxy" />
</td>
</tr>
<tr>
<th>
- <bean:message key="general.jsp.proxy_username"/>
+ <label for="proxy_user"><bean:message key="general.jsp.proxy_username"/></label>
</th>
<td>
- <html:text property="server|satellite|http_proxy_username" size="32" />
+ <html:text property="server|satellite|http_proxy_username" size="32" styleId="proxy_user" />
</td>
</tr>
<tr>
<th>
- <bean:message key="general.jsp.proxy_password"/>
+ <label for="proxy_password"><bean:message key="general.jsp.proxy_password"/></label>
</th>
<td>
- <html:password property="server|satellite|http_proxy_password" size="32" />
+ <html:password property="server|satellite|http_proxy_password" size="32" styleId="proxy_password" />
</td>
</tr>
<tr>
<th>
- <bean:message key="general.jsp.proxy_password_confirm"/>
+ <label for="proxy_password_confirm"><bean:message key="general.jsp.proxy_password_confirm"/></label>
</th>
<td>
<html:password property="server|satellite|http_proxy_password_confirm"
- size="32" />
+ size="32" styleId="proxy_password_confirm" />
</td>
</tr>
<tr>
<th>
- <bean:message key="general.jsp.mount_point"/>
+ <label for="mount_point"><bean:message key="general.jsp.mount_point"/></label>
</th>
<td>
- <html:text property="mount_point" size="32" />
+ <html:text property="mount_point" size="32" styleId="mount_point" />
</td>
</tr>
<tr>
<th>
- <bean:message key="general.jsp.defaultTo_ssl"/>
+ <label for="ssl_available"><bean:message key="general.jsp.defaultTo_ssl"/></label>
</th>
<td>
- <html:checkbox property="web|ssl_available" />
+ <html:checkbox property="web|ssl_available" styleId="ssl_available" />
</td>
</tr>
<tr>
<th>
- <bean:message key="general.jsp.solaris"/>
+ <label for="solaris"><bean:message key="general.jsp.solaris"/></label>
</th>
<td>
- <html:checkbox property="web|enable_solaris_support" />
+ <html:checkbox property="web|enable_solaris_support" styleId="solaris" />
</td>
</tr>
<tr>
<th>
- <bean:message key="general.jsp.disconnected"/>
+ <label for="disconnected"><bean:message key="general.jsp.disconnected"/></label>
</th>
<td>
- <html:checkbox property="disconnected" />
+ <html:checkbox property="disconnected" styleId="disconnected" />
</td>
</tr>
<tr>
<th>
- <bean:message key="general.jsp.monitoring_backend"/>
+ <label for="is_monitoring_backend"><bean:message key="general.jsp.monitoring_backend"/></label>
</th>
<td>
- <html:checkbox property="web|is_monitoring_backend" />
+ <html:checkbox property="web|is_monitoring_backend" styleId="is_monitoring_backend" />
</td>
</tr>
</table>
13 years, 11 months