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:
@@ -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}'")
|
||||
|
Reference in New Issue
Block a user