1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-20 07:18:07 +00:00

Merge branch '1.5' into 2.0

Conflicts:
	gns3server/handlers/api/compute/iou_handler.py
This commit is contained in:
grossmj 2016-06-09 19:35:59 -06:00
commit e46171b826
2 changed files with 8 additions and 8 deletions

View File

@ -1060,6 +1060,14 @@ class IOUVM(BaseNode):
else: else:
startup_config = startup_config.replace("%h", self._name) startup_config = startup_config.replace("%h", self._name)
f.write(startup_config) f.write(startup_config)
vlan_file = os.path.join(self.working_dir, "vlan.dat-{:05d}".format(self.application_id))
if os.path.exists(vlan_file):
try:
os.remove(vlan_file)
except OSError as e:
log.error("Could not delete VLAN file '{}': {}".format(vlan_file, e))
except OSError as e: except OSError as e:
raise IOUError("Can't write startup-config file '{}': {}".format(startup_config_path, e)) raise IOUError("Can't write startup-config file '{}': {}".format(startup_config_path, e))

View File

@ -70,10 +70,6 @@ class IOUHandler:
if name == "private_config_content" and (vm.private_config_content and len(vm.private_config_content) > 0): if name == "private_config_content" and (vm.private_config_content and len(vm.private_config_content) > 0):
continue continue
setattr(vm, name, value) setattr(vm, name, value)
if "startup_config_content" in request.json:
vm.startup_config = request.json.get("startup_config_content")
if "private_config_content" in request.json:
vm.private_config = request.json.get("private_config_content")
response.set_status(201) response.set_status(201)
response.json(vm) response.json(vm)
@ -119,10 +115,6 @@ class IOUHandler:
for name, value in request.json.items(): for name, value in request.json.items():
if hasattr(vm, name) and getattr(vm, name) != value: if hasattr(vm, name) and getattr(vm, name) != value:
setattr(vm, name, value) setattr(vm, name, value)
if "startup_config_content" in request.json:
vm.startup_config = request.json.get("startup_config_content")
if "private_config_content" in request.json:
vm.private_config = request.json.get("private_config_content")
vm.updated() vm.updated()
response.json(vm) response.json(vm)