refs #2281 fix logout on windows
parent
22f7ce0bb9
commit
bb856e5b63
|
@ -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
|
||||
|
|
|
@ -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 <info@opengnsys.es> Fri, 20 Jun 2025 10:03:15 +0200
|
||||
|
||||
ogagent (5.9.0-1) stable; urgency=medium
|
||||
|
||||
* Add changes for oggit
|
||||
|
|
|
@ -1 +1 @@
|
|||
5.9.0
|
||||
6.0.0
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue