def savePreferences(self): """ Saves the IOU devices preferences. """ templates = [] for template in TemplateManager.instance().templates().values(): if template.template_type() != "iou": templates.append(template) for template_settings in self._iou_devices.values(): templates.append(Template(template_settings)) TemplateManager.instance().updateList(templates)
def savePreferences(self): """ Saves the Ethernet hub preferences. """ templates = [] for template in TemplateManager.instance().templates().values(): if template.template_type() != "ethernet_hub": templates.append(template) for template_settings in self._ethernet_hubs.values(): templates.append(Template(template_settings)) TemplateManager.instance().updateList(templates)
def savePreferences(self): """ Saves the IOS router preferences. """ templates = [] for template in TemplateManager.instance().templates().values(): if template.template_type() != "dynamips": templates.append(template) for template_settings in self._ios_routers.values(): templates.append(Template(template_settings)) TemplateManager.instance().updateList(templates)
def savePreferences(self): """ Saves the VPCS node preferences. """ templates = [] for template in TemplateManager.instance().templates().values(): if template.template_type() != "vpcs": templates.append(template) for template_settings in self._vpcs_nodes.values(): templates.append(Template(template_settings)) TemplateManager.instance().updateList(templates)
def savePreferences(self): """ Saves the QEMU VM preferences. """ templates = [] for template in TemplateManager.instance().templates().values(): if template.template_type() != "qemu": templates.append(template) for template_settings in self._qemu_vms.values(): templates.append(Template(template_settings)) TemplateManager.instance().updateList(templates)
def savePreferences(self): """ Saves the Docker image preferences. """ templates = [] for template in TemplateManager.instance().templates().values(): if template.template_type() != "docker": templates.append(template) for template_settings in self._docker_containers.values(): templates.append(Template(template_settings)) TemplateManager.instance().updateList(templates)
def savePreferences(self): """ Saves the VirtualBox VM preferences. """ templates = [] for template in TemplateManager.instance().templates().values(): if template.template_type() != "virtualbox": templates.append(template) for template_settings in self._virtualbox_vms.values(): templates.append(Template(template_settings)) TemplateManager.instance().updateList(templates)
def _migrateOldContainers(self): """ Migrate local container settings to the controller. """ if self._settings.get("containers"): templates = [] for container in self._settings.get("containers"): container_settings = DOCKER_CONTAINER_SETTINGS.copy() container_settings.update(container) templates.append(Template(container_settings)) TemplateManager.instance().updateList(templates) self._settings["containers"] = [] self._saveSettings()
def _migrateOldVMs(self): """ Migrate local VM settings to the controller. """ if self._settings.get("vms"): templates = [] for vm in self._settings.get("vms"): vm_settings = VMWARE_VM_SETTINGS.copy() vm_settings.update(vm) templates.append(Template(vm_settings)) TemplateManager.instance().updateList(templates) self._settings["vms"] = [] self._saveSettings()
def _migrateOldNodes(self): """ Migrate local node settings to the controller. """ if self._settings.get("nodes"): templates = [] for node in self._settings.get("nodes"): node_settings = VPCS_NODES_SETTINGS.copy() node_settings.update(node) templates.append(Template(node_settings)) TemplateManager.instance().updateList(templates) self._settings["nodes"] = [] self._saveSettings()
def _migrateOldDevices(self): """ Migrate local device settings to the controller. """ if self._settings.get("devices"): templates = [] for device in self._settings.get("devices"): device_settings = IOU_DEVICE_SETTINGS.copy() device_settings.update(device) templates.append(Template(device_settings)) TemplateManager.instance().updateList(templates) self._settings["devices"] = [] self._saveSettings()
def _migrateOldRouters(self): """ Migrate local router settings to the controller. """ if self._settings.get("routers"): templates = [] for router in self._settings.get("routers"): router_settings = IOS_ROUTER_SETTINGS.copy() router_settings.update(router) if not router_settings.get("chassis"): del router_settings["chassis"] templates.append(Template(router_settings)) TemplateManager.instance().updateList(templates) self._settings["routers"] = [] self._saveSettings()