diff --git a/gns3server/compute/iou/iou_vm.py b/gns3server/compute/iou/iou_vm.py index 2f9d29d5..2c7e3aee 100644 --- a/gns3server/compute/iou/iou_vm.py +++ b/gns3server/compute/iou/iou_vm.py @@ -1060,6 +1060,14 @@ class IOUVM(BaseNode): else: startup_config = startup_config.replace("%h", self._name) 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: raise IOUError("Can't write startup-config file '{}': {}".format(startup_config_path, e)) diff --git a/gns3server/handlers/api/compute/iou_handler.py b/gns3server/handlers/api/compute/iou_handler.py index 281d6f29..c121c38f 100644 --- a/gns3server/handlers/api/compute/iou_handler.py +++ b/gns3server/handlers/api/compute/iou_handler.py @@ -70,10 +70,6 @@ class IOUHandler: if name == "private_config_content" and (vm.private_config_content and len(vm.private_config_content) > 0): continue 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.json(vm) @@ -119,10 +115,6 @@ class IOUHandler: for name, value in request.json.items(): if hasattr(vm, name) and getattr(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() response.json(vm)