def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None):
    'Reboot a virtual machine, given an instance reference.'
    if (reboot_type == 'SOFT'):
        try:
            soft_reboot_success = self._soft_reboot(instance)
        except libvirt.libvirtError as e:
            LOG.debug('Instance soft reboot failed: %s', e)
            soft_reboot_success = False
        if soft_reboot_success:
            LOG.info(_LI('Instance soft rebooted successfully.'), instance=instance)
            return
        else:
            LOG.warn(_LW('Failed to soft reboot instance. Trying hard reboot.'), instance=instance)
    return self._hard_reboot(context, instance, network_info, block_device_info)
Reboot a virtual machine, given an instance reference.
def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None):
    
    if (reboot_type == 'SOFT'):
        try:
            soft_reboot_success = self._soft_reboot(instance)
        except libvirt.libvirtError as e:
            LOG.debug('Instance soft reboot failed: %s', e)
            soft_reboot_success = False
        if soft_reboot_success:
            LOG.info(_LI('Instance soft rebooted successfully.'), instance=instance)
            return
        else:
            LOG.warn(_LW('Failed to soft reboot instance. Trying hard reboot.'), instance=instance)
    return self._hard_reboot(context, instance, network_info, block_device_info)