示例#1
0
 def _create_db_connection(self, section):
     return ZDbConn.create_db_connection(
         self.cfg.get(section, "Type"),
         self.cfg.get(section, "Host"),
         self.cfg.get(section, "User"),
         self.cfg.get(section, "Password"),
         self.cfg.get(section, "DB"),
     )
示例#2
0
文件: flrd.py 项目: chenziliang/src
 def _create_db_conn(self):
     db_section = "FLRD"
     db_conn = ZDbConn.create_db_connection(
         self._cfg_parser.get(db_section, "db_type"),
         self._cfg_parser.get(db_section, "db_host"),
         self._cfg_parser.get(db_section, "db_user"),
         self._cfg_parser.get(db_section, "db_password"),
         self._cfg_parser.get(db_section, "db_instance"),
     )
     return db_conn
示例#3
0
 def _create_db_conn(self):
     db_section = 'DATABASE'
     db_conn = None
     try:
         db_conn = ZDbConn.create_db_connection(self._cfg_parser.get(db_section, 'type'),
                                                self._cfg_parser.get(db_section, 'host'),
                                                self._cfg_parser.get(db_section, 'user'),
                                                self._cfg_parser.get(db_section, 'password'),
                                                self._cfg_parser.get(db_section, 'db'))
     except Exception as e:
         exc_type, exc_value, exc_traceback = sys.exc_info()
         logging.error('FLRDClient._create_db_conn encounting error %s' 
                       %(''.join(format_exception(exc_type, exc_value, exc_traceback))))
     return db_conn 
示例#4
0
 def _create_db_connection(self, section):
    return ZDbConn.create_db_connection(self.cfg.get(section, 'Type'), self.cfg.get(section, 'Host'), 
                                        self.cfg.get(section, 'User'), self.cfg.get(section, 'Password'), 
                                        self.cfg.get(section, 'DB'))