alfred: use network.mac as ID if present

This commit is contained in:
Nils Schneider 2014-05-02 10:49:01 +02:00
parent b3a921347c
commit 26fc2a9aef
2 changed files with 8 additions and 0 deletions

View file

@ -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:

View file

@ -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'])