'Decorator for wrapping a reboot in a group for status
logging purposes. The reboot_func parameter should be an actual
function that carries out the reboot.'

def log_reboot(self, reboot_func):

    if (self.job and (not hasattr(self, 'RUNNING_LOG_REBOOT'))):
        self.RUNNING_LOG_REBOOT = True
        try:
            self.job.run_reboot(reboot_func, self.get_kernel_ver)
        finally:
            del self.RUNNING_LOG_REBOOT
    else:
        reboot_func()
