From 58b7f0d406ab43baa7ad139597d199d7f53d0239 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Tue, 15 Oct 2024 10:54:59 +0200 Subject: [PATCH] refs #945 put more info in ogAdmClient/status, make reply async --- .../modules/server/ogAdmClient/__init__.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/opengnsys/modules/server/ogAdmClient/__init__.py b/src/opengnsys/modules/server/ogAdmClient/__init__.py index 8e87d7a..c9e0344 100644 --- a/src/opengnsys/modules/server/ogAdmClient/__init__.py +++ b/src/opengnsys/modules/server/ogAdmClient/__init__.py @@ -306,15 +306,26 @@ class ogAdmClientWorker (ogLiveWorker): logger.info ('onActivation ok') - @check_secret - def process_status (self, path, get_params, post_params, server): + def do_status (self, post_params): + cfg = self.LeeConfiguracion() thr_status = {} for k in self.thread_list: thr_status[k] = { 'running': self.thread_list[k]['running'], 'result': self.thread_list[k]['result'], } - return thr_status + return { + 'nfn': 'RESPUESTA_status', + 'mac': '12:23:34:45:56:67', + 'ip': self.IPlocal, + 'cfg': cfg, + 'threads': thr_status, + } + + @check_secret + def process_status (self, path, get_params, post_params, server): + logger.debug ('in process_status, path "{}" get_params "{}" post_params "{}" server "{}"'.format (path, get_params, post_params, server)) + return self._long_running_job ('status', self.do_status, args=(post_params,)) @check_secret def process_popup (self, path, get_params, post_params, server):