diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index d112cf54f..98c9a9acf 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -189,7 +189,7 @@ class DockerVM(BaseNode): """ if not is_rfc1123_hostname_valid(new_name): - raise DockerError(f"'{new_name}' is an invalid name to rename Docker container '{self._name}'") + raise DockerError(f"'{new_name}' is an invalid name to rename Docker container '{self._name}'. Allowed characters: letters (a-z, A-Z), digits (0-9), and hyphens (-). The name cannot start or end with a hyphen.") super(DockerVM, DockerVM).name.__set__(self, new_name) @property diff --git a/gns3server/compute/dynamips/nodes/router.py b/gns3server/compute/dynamips/nodes/router.py index 4f0dc5376..e6e750f83 100644 --- a/gns3server/compute/dynamips/nodes/router.py +++ b/gns3server/compute/dynamips/nodes/router.py @@ -1722,7 +1722,7 @@ class Router(BaseNode): """ if not is_ios_hostname_valid(new_name): - raise DynamipsError(f"{new_name} is an invalid name to rename router '{self._name}'") + raise DynamipsError(f"{new_name} is an invalid name to rename router '{self._name}'. Allowed characters: letters (a-z, A-Z), digits (0-9), and hyphens (-). The name must start with a letter, end with a letter or digit, and be 63 characters or fewer.") await self._hypervisor.send(f'vm rename "{self._name}" "{new_name}"') diff --git a/gns3server/compute/iou/iou_vm.py b/gns3server/compute/iou/iou_vm.py index b0bd6aa18..e40b6bdaa 100644 --- a/gns3server/compute/iou/iou_vm.py +++ b/gns3server/compute/iou/iou_vm.py @@ -368,7 +368,7 @@ class IOUVM(BaseNode): """ if not is_ios_hostname_valid(new_name): - raise IOUError(f"'{new_name}' is an invalid name to rename IOU node '{self._name}'") + raise IOUError(f"'{new_name}' is an invalid name to rename IOU node '{self._name}'. Allowed characters: letters (a-z, A-Z), digits (0-9), and hyphens (-). The name must start with a letter, end with a letter or digit, and be 63 characters or fewer.") if self.startup_config_file: content = self.startup_config_content content = re.sub(r"hostname .+$", "hostname " + new_name, content, flags=re.MULTILINE) diff --git a/gns3server/compute/qemu/qemu_vm.py b/gns3server/compute/qemu/qemu_vm.py index fc62829f2..f91177111 100644 --- a/gns3server/compute/qemu/qemu_vm.py +++ b/gns3server/compute/qemu/qemu_vm.py @@ -197,7 +197,7 @@ class QemuVM(BaseNode): """ if not is_rfc1123_hostname_valid(new_name): - raise QemuError(f"'{new_name}' is an invalid name to rename Qemu node '{self._name}'") + raise QemuError(f"'{new_name}' is an invalid name to rename Qemu node '{self._name}'. Allowed characters: letters (a-z, A-Z), digits (0-9), and hyphens (-). The name cannot start or end with a hyphen.") super(QemuVM, QemuVM).name.__set__(self, new_name) @property diff --git a/gns3server/db/repositories/computes.py b/gns3server/db/repositories/computes.py index 6c6f0f930..181b92aa6 100644 --- a/gns3server/db/repositories/computes.py +++ b/gns3server/db/repositories/computes.py @@ -69,7 +69,8 @@ class ComputesRepository(BaseRepository): async def update_compute(self, compute_id: UUID, compute_update: schemas.ComputeUpdate) -> Optional[models.Compute]: update_values = compute_update.model_dump(exclude_unset=True) - update_values["password"] = compute_update.password.get_secret_value() + if compute_update.password is not None: + update_values["password"] = compute_update.password.get_secret_value() query = update(models.Compute).\ where(models.Compute.compute_id == compute_id).\