diff --git a/CHANGELOG.md b/CHANGELOG.md index 9013514..e652486 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/sporestack/__init__.py b/src/sporestack/__init__.py index 908cb1e..75bb105 100644 --- a/src/sporestack/__init__.py +++ b/src/sporestack/__init__.py @@ -2,4 +2,4 @@ __all__ = ["api", "api_client", "exceptions"] -__version__ = "7.1.0" +__version__ = "7.1.1" diff --git a/src/sporestack/cli.py b/src/sporestack/cli.py index c654236..7f7f153 100644 --- a/src/sporestack/cli.py +++ b/src/sporestack/cli.py @@ -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]: