backend/common/rhnException.py | 1
backend/server/rhnChannel.py | 38 ----------------------------------
backend/server/rhnPackageUpload.py | 14 ------------
backend/server/rhnSQL/sql_lib.py | 10 --------
backend/server/rhnUser.py | 23 --------------------
backend/server/test/misc_functions.py | 10 --------
6 files changed, 1 insertion(+), 95 deletions(-)
New commits:
commit 6978bcc3247cc8d6fd3f28cc200a40cd7cd8ddec
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Oct 26 16:30:36 2010 +0200
Removing function create_user from test.
diff --git a/backend/server/test/misc_functions.py
b/backend/server/test/misc_functions.py
index 120b121..1da2651 100644
--- a/backend/server/test/misc_functions.py
+++ b/backend/server/test/misc_functions.py
@@ -281,16 +281,6 @@ def new_server(user, org_id):
serv.save()
return serv
-def create_user(username, password, email=None, org_id=None, org_password=None):
- #reserved = rhnUser.reserve_user( username, password )
- #newuser = rhnUser.new_user( username, password, email, org_id, org_password )
- u = rhnUser.User( username, password )
- u.set_org_id( org_id )
- u.save()
- u.contact['password'] = password
- u.save()
- return u
-
class Counter:
_counter = 0
def value(self):
commit 24f64c6ff151738f37a1f3856bfd2ddd407fdc71
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Oct 26 16:29:30 2010 +0200
After removal of __check_unique_email_db, fault 102 is not longer used.
diff --git a/backend/common/rhnException.py b/backend/common/rhnException.py
index b1dc99a..e94e648 100644
--- a/backend/common/rhnException.py
+++ b/backend/common/rhnException.py
@@ -204,7 +204,6 @@ maximum membership exceeded"),
# 100-109: e-mail and uuid related faults
100: _("Maximum e-mail length violation."),
101: _("Changing e-mail address is not supported."),
- 102: _("Unique e-mail address check failed."),
105: _("This system has been previously registered."),
106: _("Invalid username"),
commit 32a0b53f39077d717d5085fc50d5cf8bb0463171
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Oct 26 16:27:52 2010 +0200
Method check_unique_email (and __check_unique_email_db) not used anywhere, removing.
diff --git a/backend/server/rhnUser.py b/backend/server/rhnUser.py
index a929b64..ec845bd 100644
--- a/backend/server/rhnUser.py
+++ b/backend/server/rhnUser.py
@@ -669,23 +669,6 @@ def check_email(email):
# XXX More to come (check the format is indeed foo(a)bar.baz
return email
-def check_unique_email(email):
- return __check_unique_email_db(email)
-
-def __check_unique_email_db(email):
- h = rhnSQL.prepare("""
- select 1
- from web_user_personal_info
- where email = :email
- """)
- h.execute(email=email)
- row = h.fetchone_dict()
- if row:
- # e-mail already exists
- raise rhnFault(102,
- _("A user with the supplied e-mail address (%s)\n"
- " is already registered with Red Hat Network") % email)
-
# Validates the given key against the current or old password
# If encrypted_password is false, it compares key with pwd1 and pwd2
# If encrypted_password is true, it compares the encrypted key
commit 858effb8087d78de357e3485237b37f0f9b10e12
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Oct 26 16:26:03 2010 +0200
Exception PackageConflictError was only used in check_package_exists, removing.
diff --git a/backend/server/rhnPackageUpload.py b/backend/server/rhnPackageUpload.py
index 3f4b821..ff0dc66 100644
--- a/backend/server/rhnPackageUpload.py
+++ b/backend/server/rhnPackageUpload.py
@@ -323,6 +323,3 @@ def load_package(package_stream):
class AlreadyUploadedError(Exception):
pass
-class PackageConflictError(Exception):
- pass
-
commit eda85f78fa8f2a5039de351f67aa50db8b28bced
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Oct 26 16:24:35 2010 +0200
Removal of spacewalk-backend-upload-server makes check_package_exists unused,
removing.
diff --git a/backend/server/rhnPackageUpload.py b/backend/server/rhnPackageUpload.py
index 51377cc..3f4b821 100644
--- a/backend/server/rhnPackageUpload.py
+++ b/backend/server/rhnPackageUpload.py
@@ -326,14 +326,3 @@ class AlreadyUploadedError(Exception):
class PackageConflictError(Exception):
pass
-def check_package_exists(package_path, package_checksum_type, package_checksum,
force=0):
- if not os.path.exists(package_path):
- return
- # File exists, same checksum?
- checksum = getFileChecksum(package_checksum_type, package_path)
- if package_checksum == checksum and not force:
- raise AlreadyUploadedError(package_path)
- if force:
- return
- raise PackageConflictError(package_path, package_checksum_type, checksum)
-
commit 58ea776054356a80dc32d62dcddfd356d4bd0243
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Oct 26 16:22:58 2010 +0200
Method channels_for_org not called, removing as dead code.
diff --git a/backend/server/rhnChannel.py b/backend/server/rhnChannel.py
index 2f1b29c..ae097ef 100644
--- a/backend/server/rhnChannel.py
+++ b/backend/server/rhnChannel.py
@@ -679,44 +679,6 @@ def get_base_channel(server_id, none_ok = 0):
return None
return __stringify(ret)
-# list the available channels for an org_id
-# We DO NOT want to cache this one because we depend on getting
-# accurate information and the caching would only introduce more
-# overhead on an otherwise very fast query
-def channels_for_org(org_id):
- if not org_id:
- org_id = ''
- org_id = string.strip(str(org_id))
- log_debug(3, org_id)
-
- # select channels this org can access
- h = rhnSQL.prepare("""
- select
- ca.label arch,
- c.id,
- c.parent_channel,
- c.org_id,
- c.label,
- c.name,
- c.summary,
- c.description,
- to_char(c.last_modified, 'YYYYMMDDHH24MISS') last_modified
- from
- rhnChannelArch ca
- rhnChannel c,
- rhnChannelPermissions cp
- where
- cp.org_id = :org_id
- and cp.channel_id = c.id
- and c.channel_arch_id = ca.id
- """)
- h.execute(org_id = org_id)
- ret = h.fetchall_dict()
- if not ret:
- return []
- # stringify for xmlrpc return
- return __stringify(ret)
-
def channels_for_server(server_id):
"""channel info list for all channels accessible by this server.
commit 432e42b20c86ea23e9efec69e5243c09587b405e
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Oct 26 16:18:31 2010 +0200
Method build_sql_args is not called, removing.
diff --git a/backend/server/rhnSQL/sql_lib.py b/backend/server/rhnSQL/sql_lib.py
index 358b084..529d2ee 100644
--- a/backend/server/rhnSQL/sql_lib.py
+++ b/backend/server/rhnSQL/sql_lib.py
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2008 Red Hat, Inc.
+# 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
@@ -32,14 +32,6 @@ from spacewalk.common.rhnTranslate import _
## FUNCTIONS
################
-# build a list of :pN arguments and a dictionary for complex SQL selects
-def build_sql_args(l):
- args = map(lambda a: "p%d" % a, range(len(l)))
- ret_dict = {}
- ret_str = string.join(map(lambda a: ":%s" % a, args), ", ")
- map(ret_dict.update, map(lambda a, b: { a: b }, args, l))
- return ret_str, ret_dict
-
# This statement builds a sql statement for an insert
# of 'items' into "table" indexed by "hash_name"
def build_sql_insert(table, hash_name, items):
commit 20c7a650a2ec17c3caa317052dc234b36a3c7d4d
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Tue Oct 26 16:16:46 2010 +0200
Method auth_org_access is not used in our code, removing as dead code.
diff --git a/backend/server/rhnUser.py b/backend/server/rhnUser.py
index b379843..a929b64 100644
--- a/backend/server/rhnUser.py
+++ b/backend/server/rhnUser.py
@@ -386,12 +386,6 @@ def auth_username_password(username, password):
return user
-# placeholder for future OCS user <-> org access checks
-def auth_org_access(user_obj, org_id):
- if user_obj.contact["org_id"] != org_id:
- raise rhnFault(42)
-
-
def session_reload(session_string):
log_debug(4, session_string)
session = rhnSession.load(session_string)