src/pds_doi_service/core/db/doi_database.py
def create_connection(self):
        """Create and return a connection to the SQLite database."""
        if self.m_my_conn is not None:
            logger.warning("There is already an open database connection, closing existing connection.")
            self.close_database()

        logger.info("Connecting to SQLite3 (ver %s) database %s", sqlite3.version, self.m_database_name)

        try:
            self.m_my_conn = sqlite3.connect(self.m_database_name)
        except Error as my_error:
            logger.error("Failed to connect to database, reason: %s", my_error)

        # Make sure Database has proper group permissions set
        st = os.stat(self.m_database_name)
        has_group_rw = bool(st.st_mode & (stat.S_IRGRP | stat.S_IWGRP))

        if not has_group_rw:
            logger.debug("Setting group read/write bits on database %s", self.m_database_name)
            os.chmod(self.m_database_name, st.st_mode | stat.S_IRGRP | stat.S_IWGRP)
Create and return a connection to the SQLite database.
Create and return a connection to the SQLite database.
Create and return a connection to the SQLite database .
def create_connection(self):
        if self.m_my_conn is not None:
            logger.warning("There is already an open database connection, closing existing connection.")
            self.close_database()
        logger.info("Connecting to SQLite3 (ver %s) database %s", sqlite3.version, self.m_database_name)
        try:
            self.m_my_conn = sqlite3.connect(self.m_database_name)
        except Error as my_error:
            logger.error("Failed to connect to database, reason: %s", my_error)
        st = os.stat(self.m_database_name)
        has_group_rw = bool(st.st_mode & (stat.S_IRGRP | stat.S_IWGRP))
        if not has_group_rw:
            logger.debug("Setting group read/write bits on database %s", self.m_database_name)
            os.chmod(self.m_database_name, st.st_mode | stat.S_IRGRP | stat.S_IWGRP)
def create_connection ( self ) : if self . m_my_conn is not None : logger . warning ( "There is already an open database connection, closing existing connection." ) self . close_database ( ) logger . info ( "Connecting to SQLite3 (ver %s) database %s" , sqlite3 . version , self . m_database_name ) try : self . m_my_conn = sqlite3 . connect ( self . m_database_name ) except Error as my_error : logger . error ( "Failed to connect to database, reason: %s" , my_error ) st = os . stat ( self . m_database_name ) has_group_rw = bool ( st . st_mode & ( stat . S_IRGRP | stat . S_IWGRP ) ) if not has_group_rw : logger . debug ( "Setting group read/write bits on database %s" , self . m_database_name ) os . chmod ( self . m_database_name , st . st_mode | stat . S_IRGRP | stat . S_IWGRP )
Create and return a connection to the SQLite database.
Create and return a connection to the SQLite database .
"""Create and return a connection to the SQLite database.""" # Make sure Database has proper group permissions set
self