ppf/new: Fix initialization in MySQLDatabaseAccess. Add verification for optional...
[cs-p2p-next.git] / ppf / new / storage.py
index a469595..6cf68e8 100644 (file)
@@ -617,9 +617,14 @@ class MySQLDatabaseAccess(DatabaseAccess):
         """Initialize the database attribute of the class.
 
         Use superclass method for initialisation of constructor.
+        Check also for the optional arguments; if they are not, use defaults.
         """
 
         super(MySQLDatabaseAccess, self).__init__(database)
+        if 'host' not in self.database:
+            self.database['host'] = 'localhost'
+        if 'port' not in self.database:
+            self.database['port'] = 3306
 
     def connect(self):
         """Connect to MySQL database."""