mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-18 07:23:47 +02:00
Save IOS router configs when the user saves a project.
This commit is contained in:
parent
cc9b575b77
commit
46fe973a96
@ -282,6 +282,16 @@ class BaseManager:
|
|||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@asyncio.coroutine
|
||||||
|
def project_committed(self, project):
|
||||||
|
"""
|
||||||
|
Called when a project is committed.
|
||||||
|
|
||||||
|
:param project: Project instance
|
||||||
|
"""
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def delete_vm(self, vm_id):
|
def delete_vm(self, vm_id):
|
||||||
"""
|
"""
|
||||||
|
@ -199,6 +199,19 @@ class Dynamips(BaseManager):
|
|||||||
if device.project.id == project.id:
|
if device.project.id == project.id:
|
||||||
yield from device.hypervisor.set_working_dir(project.module_working_directory(self.module_name.lower()))
|
yield from device.hypervisor.set_working_dir(project.module_working_directory(self.module_name.lower()))
|
||||||
|
|
||||||
|
@asyncio.coroutine
|
||||||
|
def project_committed(self, project):
|
||||||
|
"""
|
||||||
|
Called when a project has been committed.
|
||||||
|
|
||||||
|
:param project: Project instance
|
||||||
|
"""
|
||||||
|
|
||||||
|
# save the configs when the project is committed
|
||||||
|
for vm in self._vms.values():
|
||||||
|
if vm.project.id == project.id:
|
||||||
|
yield from vm.save_configs()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dynamips_path(self):
|
def dynamips_path(self):
|
||||||
"""
|
"""
|
||||||
|
@ -324,6 +324,8 @@ class Project:
|
|||||||
vm = self._vms_to_destroy.pop()
|
vm = self._vms_to_destroy.pop()
|
||||||
yield from vm.delete()
|
yield from vm.delete()
|
||||||
self.remove_vm(vm)
|
self.remove_vm(vm)
|
||||||
|
for module in self.modules():
|
||||||
|
yield from module.instance().project_committed(self)
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def delete(self):
|
def delete(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user