Commit be25600 1 parent cc65d08 commit be25600 Copy full SHA for be25600
File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ def __eq__(self, other):
255
255
def __lt__ (self , other ):
256
256
if isinstance (other , Port ):
257
257
return (self .backend_name , self .devclass , self .port_id ) < \
258
- (self .backend_name , other .devclass , other .port_id )
258
+ (other .backend_name , other .devclass , other .port_id )
259
259
raise TypeError (f"Comparing instances of 'Port' and '{ type (other )} ' "
260
260
"is not supported" )
261
261
@@ -1167,13 +1167,14 @@ def device_id(self) -> str:
1167
1167
def devices (self ) -> List [DeviceInfo ]:
1168
1168
"""Get DeviceInfo objects corresponding to this DeviceAssignment"""
1169
1169
if self .port_id != '*' :
1170
- # could return UnknownDevice
1171
- return [self .backend_domain .devices [self .devclass ][self .port_id ]]
1170
+ dv = self .backend_domain .devices [self .devclass ][self .port_id ]
1171
+ if isinstance (dv , UnknownDevice ) or dv .device_id == self .device_id :
1172
+ return [dv ]
1172
1173
result = []
1173
1174
if self .device_id == "0000:0000::?******" :
1174
1175
return result
1175
1176
for dev in self .backend_domain .devices [self .devclass ]:
1176
- if dev . device_id == self .device_id :
1177
+ if self .matches ( dev ) :
1177
1178
result .append (dev )
1178
1179
return result
1179
1180
You can’t perform that action at this time.
0 commit comments