'Reset volume backup status.
:param context: running context
:param backup: The backup object for reset status operation
:param status: The status to be set
:raises InvalidBackup:
:raises BackupVerifyUnsupportedDriver:
:raises AttributeError:'

def reset_status(self, context, backup, status):

    LOG.info('Reset    backup    status    started,    backup_id:    %(backup_id)s,    status:    %(status)s.', {'backup_id': backup.id, 'status': status})
    backup_service_name = self._map_service_to_driver(backup.service)
    LOG.info('Backup    service:    %s.', backup_service_name)
    if (backup_service_name is not None):
        configured_service = self.driver_name
        if (backup_service_name != configured_service):
            err = (_('Reset    backup    status    aborted,    the    backup    service    currently    configured    [%(configured_service)s]    is    not    the    backup    service    that    was    used    to    create    this    backup    [%(backup_service)s].') % {'configured_service': configured_service, 'backup_service': backup_service_name})
            raise exception.InvalidBackup(reason=err)
        try:
            if ((status == fields.BackupStatus.AVAILABLE) and (backup['status'] != fields.BackupStatus.RESTORING)):
                backup_service = self.service.get_backup_driver(context)
                if isinstance(backup_service, driver.BackupDriverWithVerify):
                    backup_service.verify(backup.id)
                    backup.status = status
                    backup.save()
                else:
                    msg = (_('Backup    service    %(configured_service)s    does    not    support    verify.    Backup    id    %(id)s    is    not    verified.    Skipping    verify.') % {'configured_service': self.driver_name, 'id': backup.id})
                    raise exception.BackupVerifyUnsupportedDriver(reason=msg)
            elif ((status == fields.BackupStatus.ERROR) or ((status == fields.BackupStatus.AVAILABLE) and (backup.status == fields.BackupStatus.RESTORING))):
                backup.status = status
                backup.save()
        except exception.InvalidBackup:
            with excutils.save_and_reraise_exception():
                LOG.error('Backup    id    %s    is    not    invalid.    Skipping    reset.', backup.id)
        except exception.BackupVerifyUnsupportedDriver:
            with excutils.save_and_reraise_exception():
                LOG.error('Backup    service    %(configured_service)s    does    not    support    verify.    Backup    id    %(id)s    is    not    verified.    Skipping    verify.', {'configured_service': self.driver_name, 'id': backup.id})
        except AttributeError:
            msg = (_('Backup    service    %(service)s    does    not    support    verify.    Backup    id    %(id)s    is    not    verified.    Skipping    reset.') % {'service': self.driver_name, 'id': backup.id})
            LOG.error(msg)
            raise exception.BackupVerifyUnsupportedDriver(reason=msg)
        try:
            self._cleanup_temp_volumes_snapshots_for_one_backup(context, backup)
        except Exception:
            LOG.exception('Problem    cleaning    temp    volumes    and    snapshots    for    backup    %(bkup)s.', {'bkup': backup.id})
        notifier_info = {'id': backup.id, 'update': {'status': status}}
        notifier = rpc.get_notifier('backupStatusUpdate')
        notifier.info(context, 'backups.reset_status.end', notifier_info)
