示例#1
0
    def _update_old_records_notification_list(self, session):
        # Get notification_expiration_sec from config

        conf_dict = self.rc_config.get_value('recover_starter')
        notification_expiration_sec = int(
            conf_dict.get('notification_expiration_sec'))

        now = datetime.datetime.now()
        # Get border time
        border_time = now - datetime.timedelta(
            seconds=notification_expiration_sec)

        msg = "Do get_old_records_notification."
        LOG.info(msg)
        result = dbapi.get_old_records_notification(session, border_time)
        msg = "Succeeded in get_old_records_notification. " \
            + "Return_value = " + str(result)
        LOG.info(msg)

        for row in result:
            msg = "Do delete_expired_notification."
            LOG.info(msg)
            dbapi.delete_expired_notification(session, datetime.datetime.now(),
                                              datetime.datetime.now(), row.id)
            msg = "Succeeded in delete_expired_notification."
            LOG.info(msg)
示例#2
0
    def _update_old_records_notification_list(self, session):
        # Get notification_expiration_sec from config
        conf_dict = self.rc_config.get_value('recover_starter')
        notification_expiration_sec = int(
            conf_dict.get('notification_expiration_sec'))

        now = datetime.datetime.now()
        # Get border time
        border_time = now - datetime.timedelta(
            seconds=notification_expiration_sec)
        self.rc_util.syslogout_ex("RecoveryControllerl_0047", syslog.LOG_INFO)
        result = dbapi.get_old_records_notification(session, border_time)

        for row in result:
            dbapi.delete_expired_notification(session, datetime.datetime.now(),
                                              datetime.datetime.now(), row.id)
示例#3
0
    def _update_old_records_notification_list(self, session):
        # Get notification_expiration_sec from config
        conf_dict = self.rc_config.get_value('recover_starter')
        notification_expiration_sec = int(conf_dict.get(
            'notification_expiration_sec'))

        now = datetime.datetime.now()
        # Get border time
        border_time = now - datetime.timedelta(
            seconds=notification_expiration_sec)
        self.rc_util.syslogout_ex("RecoveryControllerl_0047", syslog.LOG_INFO)
        result = dbapi.get_old_records_notification(session, border_time)

        for row in result:
            dbapi.delete_expired_notification(
                session,
                datetime.datetime.now(),
                datetime.datetime.now(),
                row.id)
示例#4
0
    def _update_old_records_notification_list(self, session):
        # Get notification_expiration_sec from config

        conf_dict = self.rc_config.get_value("recover_starter")
        notification_expiration_sec = int(conf_dict.get("notification_expiration_sec"))

        now = datetime.datetime.now()
        # Get border time
        border_time = now - datetime.timedelta(seconds=notification_expiration_sec)

        msg = "Do get_old_records_notification."
        LOG.info(msg)
        result = dbapi.get_old_records_notification(session, border_time)
        msg = "Succeeded in get_old_records_notification. " + "Return_value = " + str(result)
        LOG.info(msg)

        for row in result:
            msg = "Do delete_expired_notification."
            LOG.info(msg)
            dbapi.delete_expired_notification(session, datetime.datetime.now(), datetime.datetime.now(), row.id)
            msg = "Succeeded in delete_expired_notification."
            LOG.info(msg)