Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit 8e33d03

Browse files
committed
handle unattached hardware reservations
This is currently failing with: ``` TypeError: 'NoneType' object is not subscriptable ``` Signed-off-by: Adam Bozanich <adam.boz@gmail.com>
1 parent a2c8098 commit 8e33d03

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packet/HardwareReservation.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ 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+
4753
try:
4854
device_data = self.manager.call_api(data["device"]["href"], type="GET")
4955
self.device = Device(device_data, self.manager)

0 commit comments

Comments
 (0)