backend/server/rhnSQL/driver_postgresql.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 0243928ac2eedd5bb7eb84097231834388a4abd9
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Jun 25 13:15:03 2013 +0200
support numerals only for db-name, db-user and db-password
Numeric only DB credentials are parsed from rhn.conf as integers.
diff --git a/backend/server/rhnSQL/driver_postgresql.py
b/backend/server/rhnSQL/driver_postgresql.py
index 525fd88..8d3fdf7 100644
--- a/backend/server/rhnSQL/driver_postgresql.py
+++ b/backend/server/rhnSQL/driver_postgresql.py
@@ -159,11 +159,11 @@ class Database(sql_base.Database):
def connect(self, reconnect=1):
try:
if self.host is None:
- self.dbh = psycopg2.connect(database=self.database, user=self.username,
- password=self.password)
+ self.dbh = psycopg2.connect(database=str(self.database),
user=str(self.username),
+ password=str(self.password))
else:
- self.dbh = psycopg2.connect(database=self.database, user=self.username,
- password=self.password, host=self.host,
port=self.port)
+ self.dbh = psycopg2.connect(database=str(self.database),
user=str(self.username),
+ password=str(self.password), host=self.host,
port=self.port)
# convert all DECIMAL types to float (let Python to choose one)
DEC2INTFLOAT =
psycopg2.extensions.new_type(psycopg2._psycopg.DECIMAL.values,
'DEC2INTFLOAT',
decimal2intfloat)