From ab35346f24981f80b90810da035bfee1d4003577 Mon Sep 17 00:00:00 2001 From: Arksine Date: Tue, 13 Oct 2020 07:50:18 -0400 Subject: [PATCH] moonraker: Add method to retreive host info Signed-off-by: Eric Callahan --- moonraker/moonraker.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/moonraker/moonraker.py b/moonraker/moonraker.py index 467c82d..58383b1 100644 --- a/moonraker/moonraker.py +++ b/moonraker/moonraker.py @@ -89,8 +89,10 @@ class Server: self._load_plugins(config) def start(self): + hostname, hostport = self.get_host_info() logging.info( - f"Starting Moonraker on ({self.host}, {self.port})") + f"Starting Moonraker on ({self.host}, {hostport}), " + f"Hostname: {hostname}") self.moonraker_app.listen(self.host, self.port) self.server_running = True self.ioloop.spawn_callback(self._connect_klippy) @@ -156,6 +158,10 @@ class Server: return self.remote_methods[method_name] = cb + def get_host_info(self): + hostname = socket.gethostname() + return hostname, self.port + # ***** Klippy Connection ***** async def _connect_klippy(self): if not self.server_running: