diff --git a/CHANGELOG.md b/CHANGELOG.md index 25638cd..fb25dd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ 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). +## [6.0.0] - 2025-06-19 + +### Changed + +- Changed the names of some endpoints for consistency between oglive and OS +- Changed label in the windows installer + ## [5.9.0] - 2025-06-16 ### Added diff --git a/linux/debian/changelog b/linux/debian/changelog index cb44f78..638dee5 100644 --- a/linux/debian/changelog +++ b/linux/debian/changelog @@ -1,3 +1,10 @@ +ogagent (6.0.0-1) stable; urgency=medium + + * Unify API methods for poweroff, reboot and run script + * Change label in the windows installer + + -- OpenGnsys developers Fri, 20 Jun 2025 10:03:15 +0200 + ogagent (5.9.0-1) stable; urgency=medium * Add changes for oggit diff --git a/src/VERSION b/src/VERSION index b3d91f9..09b254e 100644 --- a/src/VERSION +++ b/src/VERSION @@ -1 +1 @@ -5.9.0 +6.0.0 diff --git a/src/opengnsys/RESTApi.py b/src/opengnsys/RESTApi.py index 541ed49..ff21a67 100644 --- a/src/opengnsys/RESTApi.py +++ b/src/opengnsys/RESTApi.py @@ -209,7 +209,7 @@ class REST(object): r.raise_for_status() ct = r.headers['Content-Type'] - if 'application/json' != ct: + if len(ct) < 16 or 'application/json' != ct[0:16]: raise Exception (f'response content-type is not "application/json" but "{ct}"') r = json.loads(r.content) # Using instead of r.json() to make compatible with old requests lib versions except requests.exceptions.RequestException as e: diff --git a/src/opengnsys/ipc.py b/src/opengnsys/ipc.py index d1a61ea..077d6c3 100644 --- a/src/opengnsys/ipc.py +++ b/src/opengnsys/ipc.py @@ -165,6 +165,9 @@ class ClientProcessor(threading.Thread): logger.debug('Got invalid message from request: {}, state: {}'.format(buf, state)) except socket.error as e: # If no data is present, no problem at all, pass to check messages + if '[WinError 10054]' in str(e): + ## windows: client disconnected + self.running = False pass except Exception as e: tb = traceback.format_exc() diff --git a/src/opengnsys/linux/OGAgentService.py b/src/opengnsys/linux/OGAgentService.py index 76bfbb8..a9cd75c 100755 --- a/src/opengnsys/linux/OGAgentService.py +++ b/src/opengnsys/linux/OGAgentService.py @@ -71,6 +71,13 @@ class OGAgentSvc(Daemon, CommonService): # example try: while self.isAlive: + client_died=False + if os.path.exists ('/tmp/ogagentuser_died'): + os.unlink ('/tmp/ogagentuser_died') + client_died=True + if client_died: + self.notifyLogout (b'') + # In milliseconds, will break self.doWait(1000) except (KeyboardInterrupt, SystemExit) as e: diff --git a/src/opengnsys/service.py b/src/opengnsys/service.py index 7b4b969..f9b4292 100644 --- a/src/opengnsys/service.py +++ b/src/opengnsys/service.py @@ -198,16 +198,6 @@ class CommonService(object): Invoked to wait a bit CAN be OVERRIDDEN """ - client_died=False - if os.path.exists ('/windows/temp/ogagentuser_died'): - os.unlink ('/windows/temp/ogagentuser_died') - client_died=True - elif os.path.exists ('/tmp/ogagentuser_died'): - os.unlink ('/tmp/ogagentuser_died') - client_died=True - if client_died: - self.notifyLogout (b'') - time.sleep(float(miliseconds) / 1000) def notifyStop(self): diff --git a/src/opengnsys/windows/OGAgentService.py b/src/opengnsys/windows/OGAgentService.py index d42c144..7529b38 100644 --- a/src/opengnsys/windows/OGAgentService.py +++ b/src/opengnsys/windows/OGAgentService.py @@ -106,6 +106,13 @@ class OGAgentSvc(win32serviceutil.ServiceFramework, CommonService): # ********************* try: while self.isAlive: + client_died=False + if os.path.exists ('/windows/temp/ogagentuser_died'): + os.unlink ('/windows/temp/ogagentuser_died') + client_died=True + if client_died: + self.notifyLogout (b'') + # Pumps & processes any waiting messages pythoncom.PumpWaitingMessages() win32event.WaitForSingleObject(self.hWaitStop, 1000)