From 1a38999aef16f130062973226cf9a0f5811de491 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Fri, 13 Jun 2025 10:03:24 +0200 Subject: [PATCH] refs #2208 improve fail condition when no network is detected --- CHANGELOG.md | 6 ++++++ linux/debian/changelog | 6 ++++++ src/VERSION | 2 +- src/opengnsys/modules/server/OpenGnSys/__init__.py | 6 +++++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50ad191..6ad067b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.8.1] - 2025-06-13 + +### Fixed + +- Improve fail condition when no network is detected + ## [5.8.0] - 2025-06-12 ### Changed diff --git a/linux/debian/changelog b/linux/debian/changelog index c95220d..ca291bd 100644 --- a/linux/debian/changelog +++ b/linux/debian/changelog @@ -1,3 +1,9 @@ +ogagent (5.8.1-1) stable; urgency=medium + + * Improve fail condition when no network is detected + + -- OpenGnsys developers Fri, 13 Jun 2025 10:01:43 +0200 + ogagent (5.8.0-1) stable; urgency=medium * When client disconnect, assume that the user logged out diff --git a/src/VERSION b/src/VERSION index 11d9efa..1802e77 100644 --- a/src/VERSION +++ b/src/VERSION @@ -1 +1 @@ -5.8.0 +5.8.1 diff --git a/src/opengnsys/modules/server/OpenGnSys/__init__.py b/src/opengnsys/modules/server/OpenGnSys/__init__.py index 4e93001..438d50a 100644 --- a/src/opengnsys/modules/server/OpenGnSys/__init__.py +++ b/src/opengnsys/modules/server/OpenGnSys/__init__.py @@ -147,7 +147,11 @@ class OpenGnSysWorker(ServerWorker): for t in range(0, 300): try: # Get the first network interface - self.interface = list(operations.getNetworkInfo())[0] + nets = list (operations.getNetworkInfo()) + if 0 == len (nets): + logger.error ('No network interfaces found') + raise Exception ('No network interfaces found') + self.interface = nets[0] except Exception as e: # Wait 1 sec. and retry logger.warn (e)