From 265c9f7b06d3ff9d918ea98f28c3bc3449dff075 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 8 Nov 2016 17:49:35 +0100 Subject: [PATCH] [IMP] hw_proxy: add lsusb full output to hw status page --- addons/hw_proxy/controllers/main.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/addons/hw_proxy/controllers/main.py b/addons/hw_proxy/controllers/main.py index e1024772500..9b83013f0b4 100644 --- a/addons/hw_proxy/controllers/main.py +++ b/addons/hw_proxy/controllers/main.py @@ -54,7 +54,7 @@ class Proxy(http.Controller): return True @http.route('/hw_proxy/status', type='http', auth='none', cors='*') - def status_http(self): + def status_http(self, debug=None, **kwargs): resp = """ @@ -102,6 +102,8 @@ class Proxy(http.Controller):

Connected Devices

The list of connected USB devices as seen by the posbox

""" + if debug is None: + resp += """(debug version)""" devices = commands.getoutput("lsusb").split('\n') count = 0 resp += "
\n" @@ -117,6 +119,17 @@ class Proxy(http.Controller): resp += "
\n\n\n\n" + if debug is not None: + resp += """ + +

Debug version

+

lsusb -v output:

+
+                %s
+                
+ + """ % subprocess.check_output('lsusb -v', shell=True) + return request.make_response(resp,{ 'Cache-Control': 'no-cache', 'Content-Type': 'text/html; charset=utf-8',