mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-24 17:28:08 +00:00
Keep Dynamips stdout log file in the project directory.
This commit is contained in:
parent
75212cda3f
commit
06da40cdcd
@ -21,7 +21,6 @@ Represents a Dynamips hypervisor and starts/stops the associated Dynamips proces
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from gns3server.utils.asyncio import wait_for_process_termination
|
from gns3server.utils.asyncio import wait_for_process_termination
|
||||||
@ -120,10 +119,9 @@ class Hypervisor(DynamipsHypervisor):
|
|||||||
self._command = self._build_command()
|
self._command = self._build_command()
|
||||||
try:
|
try:
|
||||||
log.info("Starting Dynamips: {}".format(self._command))
|
log.info("Starting Dynamips: {}".format(self._command))
|
||||||
|
self._stdout_file = os.path.join(self.working_dir, "dynamips_i{}_stdout.txt".format(self._id))
|
||||||
with tempfile.NamedTemporaryFile(delete=False) as fd:
|
log.info("Dynamips process logging to {}".format(self._stdout_file))
|
||||||
self._stdout_file = fd.name
|
with open(self._stdout_file, "w", encoding="utf-8") as fd:
|
||||||
log.info("Dynamips process logging to {}".format(fd.name))
|
|
||||||
self._process = yield from asyncio.create_subprocess_exec(*self._command,
|
self._process = yield from asyncio.create_subprocess_exec(*self._command,
|
||||||
stdout=fd,
|
stdout=fd,
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
|
Loading…
Reference in New Issue
Block a user