backend/server/handlers/xmlrpc/registration.py | 40 --------------
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 4 -
schema/spacewalk/common/tables/tables.deps | 2
3 files changed, 1 insertion(+), 45 deletions(-)
New commits:
commit db722bed34f414c573d6de2469f57428c22e03d2
Author: Jan Pazdziora <jpazdziora(a)redhat.com>
Date: Thu Dec 10 15:12:50 2009 +0100
The web_product_valid_numbers table does not exist in Spacewalk 0.7 / Satellite 5.3.
Thus, we delete functions that might ever think of touching
it eventually.
Even if we managed to invoke the validate_reg_num on the server,
it would fail with:
Exception Handler Information
Traceback (most recent call last):
File "/usr/share/rhn/server/apacheRequest.py", line 120, in call_function
response = apply(func, params)
File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 1187,
in validate_reg_num
code = ValidNumber(prodcode)
File "/usr/share/rhn/server/handlers/xmlrpc/registration.py", line 81, in
ValidNumber
h.execute(regnum = reg_num)
File "/usr/share/rhn/server/rhnSQL/sql_base.py", line 161, in execute
return apply(self._execute_wrapper, (self._execute, ) + p, kw)
File "/usr/share/rhn/server/rhnSQL/driver_cx_Oracle.py", line 107, in
_execute_wrapper
raise apply(sql_base.SQLStatementPrepareError, args)
SQLStatementPrepareError: ('ORA-00942: table or view does not exist\n', 942,
'select registered_flag flag from web_product_valid_numbers where reg_number =
:regnum')
diff --git a/backend/server/handlers/xmlrpc/registration.py
b/backend/server/handlers/xmlrpc/registration.py
index 4fdc5cd..4910c6a 100644
--- a/backend/server/handlers/xmlrpc/registration.py
+++ b/backend/server/handlers/xmlrpc/registration.py
@@ -69,22 +69,6 @@ def RegistrationNumber(nr):
return None
return ret
-# checks if a registration number is valid
-def ValidNumber(reg_num):
- reg_num = RegistrationNumber(reg_num)
- if not reg_num:
- return -1
- h = rhnSQL.prepare("""
- select registered_flag flag from web_product_valid_numbers
- where reg_number = :regnum
- """)
- h.execute(regnum = reg_num)
- row = h.fetchone_dict()
- if not row or not row.has_key("flag"):
- return -1
- flag = int(row["flag"])
- return not flag
-
#
# Functions that we will provide for the outside world
#
@@ -117,7 +101,6 @@ class Registration(rhnHandler):
self.functions.append("update_contact_info")
self.functions.append("update_packages")
self.functions.append("update_transactions")
- self.functions.append("validate_reg_num")
self.functions.append("virt_notify")
self.functions.append("welcome_message")
@@ -1212,29 +1195,6 @@ class Registration(rhnHandler):
self.__save_user(user)
return 0
- # Validate a registration number
- def validate_reg_num(self, prodcode):
- log_debug(1, prodcode)
- if not prodcode:
- raise rhnFault(16, _("""
- The product registration code can be found on the
- registration card included with the product"""))
- code = ValidNumber(prodcode)
- if code == 0: # already registered
- raise rhnFault(16, _("""
- The code that you have entered has been already
- registered. Please contact Red Hat Customer Support
- at
http://www.redhat.com/services/tools/installation/
- """))
- elif code == -1:
- raise rhnFault(16, _("""
- Invalid product registration number.
- The product registration code can be found on the
- registration card included with the product. Please
- check carefully that you have entered the correct
- registration number. Invalid: %s""") % prodcode)
- return 0
-
# Updates the RPM transactions
def update_transactions(self, system_id, timestamp, transactions_hash):
log_debug(1)
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index b652356..974b4ba 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -316,10 +316,6 @@ def reserveUser(username, password):
s = rhnserver.RhnServer()
return s.registration.reserve_user(username, password)
-def validateRegNum(regNum):
- s = rhnserver.RhnServer()
- s.registration.validate_reg_num(regNum)
-
def registerUser(username, password, email = None):
s = rhnserver.RhnServer()
diff --git a/schema/spacewalk/common/tables/tables.deps
b/schema/spacewalk/common/tables/tables.deps
index 1128cec..2d9fdcd 100644
--- a/schema/spacewalk/common/tables/tables.deps
+++ b/schema/spacewalk/common/tables/tables.deps
@@ -305,4 +305,4 @@ web_contact :: web_customer
web_user_contact_permission :: web_contact
web_user_site_info :: web_contact web_user_site_type
web_user_personal_info :: web_contact web_user_prefix
-web_customer_product :: rh_product web_product_valid_numbers
+web_customer_product :: rh_product