summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-05-17 12:14:59 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-05-18 11:35:35 +0200
commitb74820a84c7c0b14d421a271a0494fa6103ba031 (patch)
treee7c16b98f20dba9b51cca282f5f5caa2e9a49c59 /ogcp
parentd9fe4dfa41d94e6183ef4b8b31c9baf202333c40 (diff)
Improve MAC formatting
Add ":" separator between each byte in hexadecimal and transform chars to uppercase.
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/views.py3
1 files changed, 2 insertions, 1 deletions
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/')