mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 07:23:47 +02:00
parent
acd5c992ba
commit
98ac295e2e
@ -34,6 +34,7 @@ log = logging.getLogger(__name__)
|
||||
from ...base_vm import BaseVM
|
||||
from ..dynamips_error import DynamipsError
|
||||
from ..nios.nio_udp import NIOUDP
|
||||
from ....utils.glob import glob_escape
|
||||
|
||||
from gns3server.utils.asyncio import wait_run_in_executor
|
||||
|
||||
@ -337,13 +338,13 @@ class Router(BaseVM):
|
||||
if self._auto_delete_disks:
|
||||
# delete nvram and disk files
|
||||
project_dir = os.path.join(self.project.module_working_directory(self.manager.module_name.lower()))
|
||||
files = glob.glob(os.path.join(project_dir, "{}_i{}_disk[0-1]".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(project_dir, "{}_i{}_slot[0-1]".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(project_dir, "{}_i{}_nvram".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(project_dir, "{}_i{}_flash[0-1]".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(project_dir, "{}_i{}_rom".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(project_dir, "{}_i{}_bootflash".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(project_dir, "{}_i{}_ssa").format(self.platform, self.dynamips_id))
|
||||
files = glob.glob(os.path.join(glob_escape(project_dir), "{}_i{}_disk[0-1]".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(glob_escape(project_dir), "{}_i{}_slot[0-1]".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(glob_escape(project_dir), "{}_i{}_nvram".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(glob_escape(project_dir), "{}_i{}_flash[0-1]".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(glob_escape(project_dir), "{}_i{}_rom".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(glob_escape(project_dir), "{}_i{}_bootflash".format(self.platform, self.dynamips_id)))
|
||||
files += glob.glob(os.path.join(glob_escape(project_dir), "{}_i{}_ssa").format(self.platform, self.dynamips_id))
|
||||
for file in files:
|
||||
try:
|
||||
log.debug("Deleting file {}".format(file))
|
||||
|
@ -41,6 +41,7 @@ from ..nios.nio_udp import NIOUDP
|
||||
from ..nios.nio_tap import NIOTAP
|
||||
from ..nios.nio_generic_ethernet import NIOGenericEthernet
|
||||
from ..base_vm import BaseVM
|
||||
from ...utils.glob import glob_escape
|
||||
from .ioucon import start_ioucon
|
||||
import gns3server.utils.asyncio
|
||||
|
||||
@ -486,10 +487,10 @@ class IOUVM(BaseVM):
|
||||
"""
|
||||
|
||||
destination = os.path.join(self.working_dir, "nvram_{:05d}".format(self.application_id))
|
||||
for file_path in glob.glob(os.path.join(self.working_dir, "nvram_*")):
|
||||
for file_path in glob.glob(os.path.join(glob_escape(self.working_dir), "nvram_*")):
|
||||
shutil.move(file_path, destination)
|
||||
destination = os.path.join(self.working_dir, "vlan.dat-{:05d}".format(self.application_id))
|
||||
for file_path in glob.glob(os.path.join(self.working_dir, "vlan.dat-*")):
|
||||
for file_path in glob.glob(os.path.join(glob_escape(self.working_dir), "vlan.dat-*")):
|
||||
shutil.move(file_path, destination)
|
||||
|
||||
@asyncio.coroutine
|
||||
|
Loading…
Reference in New Issue
Block a user