diff options
| author | Olivier Dony <odo@openerp.com> | 2016-11-08 17:49:35 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2016-11-14 17:11:57 +0100 |
| commit | 265c9f7b06d3ff9d918ea98f28c3bc3449dff075 (patch) | |
| tree | 39bf89b74ad9822fa5313cac085c0f8f1a6ae77d /addons/hw_proxy | |
| parent | d1b0b9e656fa3e9641a7ac834626ebc61ef23376 (diff) | |
[IMP] hw_proxy: add lsusb full output to hw status page
Diffstat (limited to 'addons/hw_proxy')
| -rw-r--r-- | addons/hw_proxy/controllers/main.py | 15 |
1 files changed, 14 insertions, 1 deletions
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 = """ <!DOCTYPE HTML> <html> @@ -102,6 +102,8 @@ class Proxy(http.Controller): <h2>Connected Devices</h2> <p>The list of connected USB devices as seen by the posbox</p> """ + if debug is None: + resp += """(<a href="/hw_proxy/status?debug">debug version</a>)""" devices = commands.getoutput("lsusb").split('\n') count = 0 resp += "<div class='devices'>\n" @@ -117,6 +119,17 @@ class Proxy(http.Controller): resp += "</div>\n</body>\n</html>\n\n" + if debug is not None: + resp += """ + + <h3>Debug version</h3> + <p><tt>lsusb -v</tt> output:</p> + <pre> + %s + </pre> + + """ % subprocess.check_output('lsusb -v', shell=True) + return request.make_response(resp,{ 'Cache-Control': 'no-cache', 'Content-Type': 'text/html; charset=utf-8', |
