v7.1.1: Fix server launch error related to hostname

This commit is contained in:
Administrator 2022-09-29 15:21:49 +00:00
parent 7158b6953c
commit 8cd2644c0c
3 changed files with 13 additions and 3 deletions

View File

@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [7.1.1 - 2022-09-29]
### Changed
- Fixed hostname related bug when launching a server.
## [7.1.0 - 2022-09-27]
### Added

View File

@ -2,4 +2,4 @@
__all__ = ["api", "api_client", "exceptions"]
__version__ = "7.1.0"
__version__ = "7.1.1"

View File

@ -284,8 +284,12 @@ def get_machine_info(hostname: str) -> Dict[str, Any]:
def pretty_machine_info(info: Dict[str, Any]) -> str:
msg = "Hostname: {}\n".format(info["vm_hostname"])
msg += "Machine ID (keep this secret!): {}\n".format(info["machine_id"])
msg = "Machine ID (keep this secret!): {}\n".format(info["machine_id"])
if "vm_hostname" in info:
msg += "Hostname: {}\n".format(info["vm_hostname"])
elif "hostname" in info:
msg += "Hostname: {}\n".format(info["hostname"])
if "ipv6" in info["network_interfaces"][0]:
msg += "IPv6: {}\n".format(info["network_interfaces"][0]["ipv6"])
if "ipv4" in info["network_interfaces"][0]: