1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00

Closes #139: Enable querying by device hostname as well as internal ID

This commit is contained in:
checktheroads
2021-05-29 21:48:59 -07:00
parent ed21382fd0
commit 4c12f13d43
2 changed files with 14 additions and 1 deletions

View File

@@ -378,5 +378,7 @@ class Devices(HyperglassModelExtra):
for device in self.objects:
if device._id == accessor:
return device
elif device.name == accessor:
return device
raise AttributeError(f"No device named '{accessor}'")