summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjm.bardallo <juanmanuel.bardallo@sic.uhu.es>2019-05-14 14:33:16 +0200
committerjm.bardallo <juanmanuel.bardallo@sic.uhu.es>2019-05-14 14:33:16 +0200
commit3218b460596cdc369f9f5dcb0abffe7c773e6bb0 (patch)
treef3f29a98ca45557d57d25b1c3d9ff5f51fab7875
parentd83b86df51d2039029cd01778d55d948b9512e68 (diff)
nuevo procedimiento para intentar matar el browser al cambiar de url
Output y error de los scripts codificados en base64
-rw-r--r--admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py
index 55557104..2d233150 100644
--- a/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py
@@ -38,7 +38,7 @@ import subprocess
import threading
import time
import urllib
-
+import signal
from opengnsys import REST
from opengnsys import operations
from opengnsys.log import logger
@@ -119,6 +119,7 @@ class OpenGnSysWorker(ServerWorker):
logger.debug('Launching browser with URL: {}'.format(url))
if hasattr(self.browser, 'process'):
self.browser['process'].kill()
+ os.kill(self.browser['process'].pid, signal.SIGINT)
self.browser['url'] = url
self.browser['process'] = subprocess.Popen(['browser', '-qws', url])
@@ -146,7 +147,7 @@ class OpenGnSysWorker(ServerWorker):
route = route[len(self.REST.endpoint):]
# Sending results
self.REST.sendMessage(route, {'mac': self.interface.mac, 'ip': self.interface.ip, 'trace': op_id,
- 'status': stat, 'output': out, 'error': err})
+ 'status': stat, 'output': out.encode('base64'), 'error': err.encode('base64')})
# Show latest menu, if OGAgent runs on ogLive
if os_type == 'oglive':
self._launch_browser(menu_url)