示例#1
0
 def __open_dbms_conn(self):
     """opens a connection to postgresql"""
     try:
         return HelperPg.connect(self.pgsql_conf)
     except psycopg2.Error as e:
         self.logger.error(e)
         raise DocBuilderError("dbms was not connected")
     except KeyError as e:
         self.logger.error(e)
         raise DocBuilderError("slack pgsql configuration")
示例#2
0
def open_dbms_conn(logger, pgsql_conf):
    """opens a connection to postgresql"""

    try:
        return HelperPg.connect(pgsql_conf)
    except psycopg2.Error as e:
        logger.error(e)
        raise Exception("dbms was not connected")
    except KeyError as e:
        logger.error(e)
        raise Exception("slack pgsql configuration")