'Wait for the host to come back from a reboot. This is a generic
implementation based entirely on wait_up and wait_down.'

def wait_for_restart(self, timeout=DEFAULT_REBOOT_TIMEOUT, down_timeout=WAIT_DOWN_REBOOT_TIMEOUT, down_warning=WAIT_DOWN_REBOOT_WARNING, log_failure=True, old_boot_id=None, **dargs):

    if (not self.wait_down(timeout=down_timeout, warning_timer=down_warning, old_boot_id=old_boot_id)):
        if log_failure:
            self.record('ABORT', None, 'reboot.verify', 'shut    down    failed')
        raise error.AutoservShutdownError('Host    did    not    shut    down')
    if self.wait_up(timeout):
        self.record('GOOD', None, 'reboot.verify')
        self.reboot_followup(**dargs)
    else:
        self.record('ABORT', None, 'reboot.verify', 'Host    did    not    return    from    reboot')
        raise error.AutoservRebootError('Host    did    not    return    from    reboot')
