# Copyright (c) 2025 Kim Jarvis TPF Software Services S.A. kim.jarvis@tpfsystems.com # This software is licensed under the MIT License. See the LICENSE file for details.#fromreemote.commandimportCommand
[docs]classGet_host:"""A reemote command object for retrieving the hostname. When used within the reemote framework, this class creates and executes a command to fetch the hostname of the target system. It is designed to be instantiated and its `execute` method yielded from a reemote task. Example: host = yield Get_host().execute() print(f"The hostname is: {host}") """def__repr__(self):returnf"Get_host()"@staticmethodasyncdef_get_host_callback(host_info,global_info,command,cp,caller):returnhost_info["host"]defexecute(self):r=yieldCommand(f"{self}",local=True,callback=self._get_host_callback,caller=self)