mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
Merge branch '3.0' into ssh-console-support
This commit is contained in:
commit
c3d202abc9
@ -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
|
||||
|
||||
@ -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}"')
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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).\
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user