alfred: use network.mac as ID if present
This commit is contained in:
parent
b3a921347c
commit
26fc2a9aef
2 changed files with 8 additions and 0 deletions
|
@ -23,6 +23,11 @@ class alfred:
|
|||
except KeyError:
|
||||
pass
|
||||
|
||||
try:
|
||||
node_alias['id'] = node['network']['mac']
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
if 'hostname' in node:
|
||||
node_alias['name'] = node['hostname']
|
||||
elif 'name' in node:
|
||||
|
|
|
@ -191,6 +191,9 @@ class NodeDB:
|
|||
if 'firmware' in alias:
|
||||
node.firmware = alias['firmware']
|
||||
|
||||
if 'id' in alias:
|
||||
node.id = alias['id']
|
||||
|
||||
# list of macs
|
||||
# if options['gateway']:
|
||||
# mark_gateways(options['gateway'])
|
||||
|
|
Loading…
Add table
Reference in a new issue