Пример #1
0
    def _find_reprocessing_records_vm_list(self, session):
        return_value = []
        result = dbapi.get_all_vm_list_by_progress(session)

        # UUID to see one by one, and look for the re-processing target record
        for row in result:
            result2 = dbapi.get_vm_list_by_uuid_and_progress_sorted(session, row.uuid)

            row_cnt = 0
            for row2 in result2:
                # First row is the re-processing target
                if row_cnt == 0:
                    return_value.append(row2)
                # Update progress that is not the re-processing target
                else:
                    self.rc_util.syslogout_ex("RecoveryControllerStarter_0039", syslog.LOG_INFO)
                    update_val = {
                        "progress": 4,
                        "update_at": datetime.datetime.now(),
                        "delete_at": datetime.datetime.now(),
                    }

                    dbapi.update_vm_list_by_id_dict(session, row2.id, update_val)

                row_cnt += 1

        return return_value
Пример #2
0
    def _find_reprocessing_records_vm_list(self, session):
        return_value = []
        result = dbapi.get_all_vm_list_by_progress(session)

        # UUID to see one by one, and look for the re-processing target record
        for row in result:
            result2 = dbapi.get_vm_list_by_uuid_and_progress_sorted(
                session, row.uuid)

            row_cnt = 0
            for row2 in result2:
                # First row is the re-processing target
                if row_cnt == 0:
                    return_value.append(row2)
                # Update progress that is not the re-processing target
                else:
                    self.rc_util.syslogout_ex("RecoveryControllerStarter_0039",
                                              syslog.LOG_INFO)
                    update_val = {
                        'progress': 4,
                        'update_at': datetime.datetime.now(),
                        'delete_at': datetime.datetime.now()
                    }

                    dbapi.update_vm_list_by_id_dict(session, row2.id,
                                                    update_val)

                row_cnt += 1

        return return_value
Пример #3
0
    def _find_reprocessing_records_vm_list(self, session):
        return_value = []
        msg = "Do get_all_vm_list_by_progress."
        LOG.info(msg)
        result = dbapi.get_all_vm_list_by_progress(session)
        msg = "Succeeded in get_all_vm_list_by_progress. " \
            + "Return_value = " + str(result)
        LOG.info(msg)

        # UUID to see one by one, and look for the re-processing target record
        for row in result:
            msg = "Do get_vm_list_by_uuid_and_progress_sorted."
            LOG.info(msg)
            result2 = dbapi.get_vm_list_by_uuid_and_progress_sorted(
                session,
                row.uuid
            )
            msg = "Succeeded in get_vm_list_by_uuid_and_progress_sorted. " \
                + "Return_value = " + str(result2)
            LOG.info(msg)

            row_cnt = 0
            for row2 in result2:
                # First row is the re-processing target
                if row_cnt == 0:
                    return_value.append(row2)
                # Update progress that is not the re-processing target
                else:
                    update_val = {'progress': 4,
                                  'update_at': datetime.datetime.now(),
                                  'delete_at': datetime.datetime.now()
                                  }

                    msg = "Do update_vm_list_by_id_dict."
                    LOG.info(msg)
                    dbapi.update_vm_list_by_id_dict(
                        session,
                        row2.id,
                        update_val
                    )
                    msg = "Succeeded in update_vm_list_by_id_dict."
                    LOG.info(msg)

                row_cnt += 1

        return return_value