From b74820a84c7c0b14d421a271a0494fa6103ba031 Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Tue, 17 May 2022 12:14:59 +0200 Subject: Improve MAC formatting Add ":" separator between each byte in hexadecimal and transform chars to uppercase. --- ogcp/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ogcp/views.py b/ogcp/views.py index 36bd216..d68ce25 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -296,7 +296,8 @@ def get_client_mac(): resp = g.server.get('/client/info', payload) client_info = resp.json() mac = client_info.get('mac') - return jsonify(mac) + pretty_mac = (':'.join(mac[i:i+2] for i in range(0, 12, 2))).upper() + return jsonify(pretty_mac) @app.route('/scopes/') -- cgit v1.2.3-18-g5258