Compare commits

..

No commits in common. "main" and "logout-ejecutarscript" have entirely different histories.

6 changed files with 4 additions and 47 deletions

View File

@ -6,24 +6,6 @@ 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).
## [8.0.0] - 2025-08-08
### Changed
- Return HTTP 409 on more than one background jobs
## [7.3.3] - 2025-08-07
### Fixed
- wait() for the browser
## [7.3.2] - 2025-08-04
### Fixed
- Fix syntax
## [7.3.1] - 2025-08-04
### Fixed

View File

@ -1,21 +1,3 @@
ogagent (8.0.0-1) stable; urgency=medium
* Return HTTP 409 on more than one background jobs
-- OpenGnsys developers <info@opengnsys.es> Fri, 08 Aug 2025 13:13:33 +0200
ogagent (7.3.3-1) stable; urgency=medium
* wait() for the browser
-- OpenGnsys developers <info@opengnsys.es> Thu, 07 Aug 2025 12:08:39 +0200
ogagent (7.3.2-1) stable; urgency=medium
* Fix syntax
-- OpenGnsys developers <info@opengnsys.es> Mon, 04 Aug 2025 14:36:47 +0200
ogagent (7.3.1-1) stable; urgency=medium
* On user logout, write the user to the log

View File

@ -1 +1 @@
8.0.0
7.3.1

View File

@ -105,7 +105,6 @@ class HTTPServerHandler(BaseHTTPRequestHandler):
self.sendJsonError(500, exceptionToMessage(e))
else:
arg0 = e.args[0]
while isinstance (arg0, Exception): arg0 = arg0.args[0] ## handle nested exceptions
if type (arg0) is str:
logger.debug ('Message processor for "{}" returned exception string "{}"'.format(path[0], str(e)))
self.sendJsonError (500, exceptionToMessage(e))

View File

@ -388,7 +388,7 @@ class OpenGnSysWorker(ServerWorker):
iters += 1
if iters >= 10: break
try: os.unlink ('/tmp/EjecutarScript-jobid')
try: os.unlink ('/tmp/EjecutarScript-jobid'):
except: pass
if job_id is None: return {'op': 'launched'}

View File

@ -210,11 +210,6 @@ class ogLiveWorker(ServerWorker):
def mon (self):
n = 0
while True:
if self.browser_process is not None:
try:
self.browser_process.wait (0.05)
except subprocess.TimeoutExpired:
pass
with self.thread_lock:
for k in self.thread_list:
elem = self.thread_list[k]
@ -404,7 +399,7 @@ class ogLiveWorker(ServerWorker):
if 'ServiceUnknown' in str(e):
logger.warning ('browser is not running, launching a new one')
browser_log_fd = open ('/var/log/launch_browser.log', 'a')
self.browser_process = subprocess.Popen (['/usr/bin/launch_browser', url], stdout=browser_log_fd, stderr=subprocess.STDOUT)
subprocess.Popen (['/usr/bin/launch_browser', url], stdout=browser_log_fd, stderr=subprocess.STDOUT)
browser_log_fd.close()
else:
logger.error (f'Error al cambiar URL: ({e})')
@ -464,7 +459,6 @@ class ogLiveWorker(ServerWorker):
self.pid_q = None ## for passing PIDs around
self.stdout_q = None ## for passing stdout
self.progress_jobs = {}
self.browser_process = None
ogcore_scheme = os.environ.get ('OGAGENTCFG_OGCORE_SCHEME', 'https')
ogcore_ip = os.environ.get ('OGAGENTCFG_OGCORE_IP', '192.168.2.1')
@ -508,7 +502,7 @@ class ogLiveWorker(ServerWorker):
break
if any_job_running:
logger.info ('some job is already running, refusing to launch another one')
raise Exception ({ '_httpcode': 409, '_msg': 'some job is already running, refusing to launch another one' })
return { 'job_id': None, 'message': 'some job is already running, refusing to launch another one' }
job_id = '{}-{}'.format (name, ''.join (random.choice ('0123456789abcdef') for _ in range (8)))
import queue