@instance_synchronized
    def get_console_output(self, instance_name):
        console_log_paths = self._pathutils.get_vm_console_log_paths(
            instance_name)

        try:
            log = b''
            # Start with the oldest console log file.
            for log_path in console_log_paths[::-1]:
                if os.path.exists(log_path):
                    with open(log_path, 'rb') as fp:
                        log += fp.read()
            return log
        except __HOLE__ as err:
            raise exception.ConsoleLogOutputException(
                instance_id=instance_name, reason=six.text_type(err))
dataset/ETHPy150Open openstack/compute-hyperv/hyperv/nova/serialconsoleops.py/SerialConsoleOps.get_console_output