]> p2p-next.cs.pub.ro Git - cs-p2p-next.git/blobdiff - ppf/new/storage.py
ppf/new: Fix initialization in MySQLDatabaseAccess. Add verification for optional...
[cs-p2p-next.git] / ppf / new / storage.py
index a469595b2f74cb2f38219bd1448a8049214c17ed..6cf68e86aab6f0fc4790bb174a91f2d320c3ee2c 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."""