alfred.py: Make geo attribute setting more robust
This commit is contained in:
parent
7075d8481c
commit
89e4c63700
|
@ -15,8 +15,10 @@ class alfred:
|
||||||
for key in node:
|
for key in node:
|
||||||
node_alias[key] = node[key]
|
node_alias[key] = node[key]
|
||||||
|
|
||||||
if 'location' in node:
|
try:
|
||||||
node_alias['geo'] = [node['location']['latitude'], node['location']['longitude']]
|
node_alias['geo'] = [node['location']['latitude'], node['location']['longitude']]
|
||||||
|
except (TypeError, KeyError):
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
node_alias['id'] = node['network']['mac']
|
node_alias['id'] = node['network']['mac']
|
||||||
|
|
Loading…
Reference in a new issue