1. Zhang Huangbin
  2. iredapd

Source

iredapd / src / iredapd-rr.py

Diff from to

File src/iredapd-rr.py

 import logging
 import daemon
 
-__version__ = '1.3.6'
+__version__ = '1.3.7'
 
 ACTION_ACCEPT = 'DUNNO'
 ACTION_DEFER = 'DEFER_IF_PERMIT Service temporarily unavailable'
                 if cfg.get('general', 'backend', 'ldap') == 'ldap':
                     modeler = LDAPModeler()
                 else:
-                    modeler = MySQLModeler()
+                    modeler = SQLModeler()
 
                 result = modeler.handle_data(self.map)
                 if result != None:
         channel = apdChannel(conn, remoteaddr)
 
 
-class MySQLModeler:
+class SQLModeler:
     def __init__(self):
         import web
 
 
         self.db = web.database(
             dbn='mysql',
-            host=cfg.get('mysql', 'server', 'localhost'),
-            db=cfg.get('mysql', 'db', 'vmail'),
-            user=cfg.get('mysql', 'user', 'vmail'),
-            pw=cfg.get('mysql', 'password'),
+            host=cfg.get('sql', 'server', 'localhost'),
+            db=cfg.get('sql', 'db', 'vmail'),
+            user=cfg.get('sql', 'user', 'vmail'),
+            pw=cfg.get('sql', 'password'),
         )
 
     def handle_data(self, map):
         if 'sender' in map.keys() and 'recipient' in map.keys():
             # Get plugin module name and convert plugin list to python list type.
-            self.plugins = cfg.get('mysql', 'plugins', '')
+            self.plugins = cfg.get('sql', 'plugins', '')
             self.plugins = [v.strip() for v in self.plugins.split(',')]
 
             # Get sender, recipient.