Keep Dynamips logs.

This commit is contained in:
grossmj 2015-02-16 21:30:31 -07:00
parent e6fd471dd5
commit dc4df68c7a
3 changed files with 4 additions and 5 deletions

View File

@ -160,8 +160,6 @@ class Dynamips(BaseManager):
files += glob.glob(os.path.join(project_dir, "ilt_*")) files += glob.glob(os.path.join(project_dir, "ilt_*"))
files += glob.glob(os.path.join(project_dir, "c[0-9][0-9][0-9][0-9]_*_rommon_vars")) files += glob.glob(os.path.join(project_dir, "c[0-9][0-9][0-9][0-9]_*_rommon_vars"))
files += glob.glob(os.path.join(project_dir, "c[0-9][0-9][0-9][0-9]_*_ssa")) files += glob.glob(os.path.join(project_dir, "c[0-9][0-9][0-9][0-9]_*_ssa"))
files += glob.glob(os.path.join(project_dir, "dynamips_log*"))
files += glob.glob(os.path.join(project_dir, "*_log.txt"))
for file in files: for file in files:
try: try:
log.debug("Deleting file {}".format(file)) log.debug("Deleting file {}".format(file))

View File

@ -42,7 +42,7 @@ class Hypervisor(DynamipsHypervisor):
:param host: host/address for this hypervisor :param host: host/address for this hypervisor
""" """
_instance_count = 0 _instance_count = 1
def __init__(self, path, working_dir, host, port): def __init__(self, path, working_dir, host, port):
@ -181,7 +181,7 @@ class Hypervisor(DynamipsHypervisor):
command = [self._path] command = [self._path]
command.extend(["-N1"]) # use instance IDs for filenames command.extend(["-N1"]) # use instance IDs for filenames
command.extend(["-l", "dynamips_log_{}.txt".format(self._port)]) # log file command.extend(["-l", "dynamips_i{}_log.txt".format(self._id)]) # log file
if self._host != "0.0.0.0" and self._host != "::": if self._host != "0.0.0.0" and self._host != "::":
command.extend(["-H", "{}:{}".format(self._host, self._port)]) command.extend(["-H", "{}:{}".format(self._host, self._port)])
else: else:

View File

@ -1494,7 +1494,8 @@ class Router(BaseVM):
""" """
try: try:
reply = yield from self._hypervisor.send("vm extract_config {}".format(self._name))[0].rsplit(' ', 2)[-2:] reply = yield from self._hypervisor.send("vm extract_config {}".format(self._name))
reply = reply[0].rsplit(' ', 2)[-2:]
except IOError: except IOError:
#for some reason Dynamips gets frozen when it does not find the magic number in the NVRAM file. #for some reason Dynamips gets frozen when it does not find the magic number in the NVRAM file.
return None, None return None, None