backend/server/rhnSQL/__init__.py | 1
schema/spacewalk/postgres/packages/rhn_entitlements.pkb | 38 ++++++++--------
2 files changed, 19 insertions(+), 20 deletions(-)
New commits:
commit f0846f730d8a7a1e581f86b0a8d080a7d093cc4f
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Jun 25 14:50:33 2010 +0200
The for does not like NULL which we get for empty ents_to_process.
Addressing
ProgrammingError: ERROR: upper bound of FOR loop cannot be null
CONTEXT: PL/pgSQL function "modify_org_service" line 111 at FOR with
integer loop variable
diff --git a/schema/spacewalk/postgres/packages/rhn_entitlements.pkb
b/schema/spacewalk/postgres/packages/rhn_entitlements.pkb
index 3822b5e..370a481 100644
--- a/schema/spacewalk/postgres/packages/rhn_entitlements.pkb
+++ b/schema/spacewalk/postgres/packages/rhn_entitlements.pkb
@@ -850,7 +850,7 @@ as $$
end loop;
end loop;
else
- for i in 1..array_upper(ents_to_process, 1) loop
+ for i in 1..coalesce(array_upper(ents_to_process, 1), 0) loop
for ent in ents(ents_to_process[i]) loop
delete from rhnOrgEntitlements
where org_id = org_id_in
commit 2fb5c42fa7658a51bcbe1e063f9d439ef86a0f53
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Jun 25 13:59:27 2010 +0200
Remove a debugging print.
diff --git a/backend/server/rhnSQL/__init__.py b/backend/server/rhnSQL/__init__.py
index e7c7df2..dea1bd3 100644
--- a/backend/server/rhnSQL/__init__.py
+++ b/backend/server/rhnSQL/__init__.py
@@ -96,7 +96,6 @@ def initDB(dsn=None, backend=ORACLE, host="localhost",
port=None, username=None,
host = None
port = None
dsn = CFG.DEFAULT_DB
- print "dsn [%s]" % dsn
(username, temp) = dsn.split("/")
(password, dsn) = temp.split("@")
for i in dsn.split(';'):
commit 23300bb8e740f2aa7806946cc07cddda712b2692
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Fri Jun 25 13:57:49 2010 +0200
Array concatenation seems to want array_append.
Addressing
ProgrammingError: ERROR: operator is not unique: character varying[] || unknown
LINE 1: SELECT $1 || 'rhn_virtualization_platform'
^
HINT: Could not choose a best candidate operator. You might need to add explicit type
casts.
QUERY: SELECT $1 || 'rhn_virtualization_platform'
CONTEXT: PL/pgSQL function "modify_org_service" line 65 at assignment
diff --git a/schema/spacewalk/postgres/packages/rhn_entitlements.pkb
b/schema/spacewalk/postgres/packages/rhn_entitlements.pkb
index 225561b..3822b5e 100644
--- a/schema/spacewalk/postgres/packages/rhn_entitlements.pkb
+++ b/schema/spacewalk/postgres/packages/rhn_entitlements.pkb
@@ -775,41 +775,41 @@ as $$
-- worse than the old code...
if service_label_in = 'enterprise' or
service_label_in = 'management' then
- ents_to_process := ents_to_process || 'sw_mgr_enterprise';
+ ents_to_process := array_append(ents_to_process,
'sw_mgr_enterprise');
- roles_to_process := roles_to_process || 'org_admin';
+ roles_to_process := array_append(roles_to_process, 'org_admin');
- roles_to_process := roles_to_process || 'system_group_admin';
+ roles_to_process := array_append(roles_to_process,
'system_group_admin');
- roles_to_process := roles_to_process || 'activation_key_admin';
+ roles_to_process := array_append(roles_to_process,
'activation_key_admin');
- roles_to_process := roles_to_process || 'org_applicant';
+ roles_to_process := array_append(roles_to_process, 'org_applicant');
elsif service_label_in = 'provisioning' then
- ents_to_process := ents_to_process || 'rhn_provisioning';
+ ents_to_process := array_append(ents_to_process,
'rhn_provisioning');
- roles_to_process := roles_to_process || 'system_group_admin';
+ roles_to_process := array_append(roles_to_process,
'system_group_admin');
- roles_to_process := roles_to_process || 'activation_key_admin';
+ roles_to_process := array_append(roles_to_process,
'activation_key_admin');
- roles_to_process := roles_to_process || 'config_admin';
+ roles_to_process := array_append(roles_to_process, 'config_admin');
-- another nasty special case...
if enable_in = 'Y' then
- ents_to_process := ents_to_process || 'sw_mgr_enterprise';
+ ents_to_process := array_append(ents_to_process,
'sw_mgr_enterprise');
end if;
elsif service_label_in = 'monitoring' then
- ents_to_process := ents_to_process || 'rhn_monitor';
+ ents_to_process := array_append(ents_to_process, 'rhn_monitor');
- roles_to_process := roles_to_process || 'monitoring_admin';
+ roles_to_process := array_append(roles_to_process,
'monitoring_admin');
elsif service_label_in = 'virtualization' then
- ents_to_process := ents_to_process || 'rhn_virtualization';
+ ents_to_process := array_append(ents_to_process,
'rhn_virtualization');
- roles_to_process := roles_to_process || 'config_admin';
+ roles_to_process := array_append(roles_to_process, 'config_admin');
elsif service_label_in = 'virtualization_platform' then
- ents_to_process := ents_to_process || 'rhn_virtualization_platform';
- roles_to_process := roles_to_process || 'config_admin';
+ ents_to_process := array_append(ents_to_process,
'rhn_virtualization_platform');
+ roles_to_process := array_append(roles_to_process, 'config_admin');
elsif service_label_in = 'nonlinux' then
- ents_to_process := ents_to_process || 'rhn_nonlinux';
- roles_to_process := roles_to_process || 'config_admin';
+ ents_to_process := array_append(ents_to_process, 'rhn_nonlinux');
+ roles_to_process := array_append(roles_to_process, 'config_admin');
end if;
if enable_in = 'Y' then
Show replies by date