Skip to content

Commit 37af084

Browse files
committed
catch TypeError in HardwareReservation device assignment
Signed-off-by: Marques Johansson <[email protected]>
1 parent 8e33d03 commit 37af084

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

packet/HardwareReservation.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,10 @@ def __init__(self, data, manager):
4444
# except (KeyError, IndexError):
4545
# self.attached_to = None
4646

47-
48-
# not attached
49-
if data["device"] is None:
50-
self.attached_to = None
51-
return
52-
5347
try:
5448
device_data = self.manager.call_api(data["device"]["href"], type="GET")
5549
self.device = Device(device_data, self.manager)
56-
except (KeyError, IndexError):
50+
except (KeyError, IndexError, TypeError):
5751
self.attached_to = None
5852

5953
def __str__(self):

0 commit comments

Comments
 (0)