From c7f72c7ea496682324bb4f9cd5d7c2cc6b0a557b Mon Sep 17 00:00:00 2001 From: Stefano Alberto Russo <stefano.russo@gmail.com> Date: Tue, 4 Mar 2025 21:50:17 +0100 Subject: [PATCH] Fixed an issue in obtaining the IP of the host from the agent. --- services/webapp/code/rosetta/core_app/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/webapp/code/rosetta/core_app/api.py b/services/webapp/code/rosetta/core_app/api.py index bc8886a..9168c94 100644 --- a/services/webapp/code/rosetta/core_app/api.py +++ b/services/webapp/code/rosetta/core_app/api.py @@ -259,7 +259,10 @@ logger.info('Reporting for task uuid: "{}"'.format(task_uuid)) # Get IP ip = socket.gethostbyname(hostname) if ip == '127.0.1.1': - ip = socket.gethostbyname(hostname+'.local') + try: + ip = socket.gethostbyname(hostname+'.local') + except: + pass logger.info(' - ip: "{}"'.format(ip)) # Get port -- GitLab