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