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

handle unattached hardware reservations#120

Merged
displague merged 2 commits intopackethost:masterfrom
boz:fix-unattached-reservation
Aug 29, 2021
Merged

handle unattached hardware reservations#120
displague merged 2 commits intopackethost:masterfrom
boz:fix-unattached-reservation

Conversation

@boz
Copy link
Contributor

@boz boz commented Aug 7, 2021

This is currently failing with:

TypeError: 'NoneType' object is not subscriptable

@boz boz force-pushed the fix-unattached-reservation branch 2 times, most recently from fca0284 to 740b7fc Compare August 7, 2021 04:09
@boz boz changed the title handle unattached hardwsare reservations handle unattached hardware reservations Aug 7, 2021
This is currently failing with:

```
TypeError: 'NoneType' object is not subscriptable
```

Signed-off-by: Adam Bozanich <adam.boz@gmail.com>
@boz boz force-pushed the fix-unattached-reservation branch from 740b7fc to 8e33d03 Compare August 7, 2021 04:09

# not attached
if data["device"] is None:
self.attached_to = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we could use except (KeyError, IndexError, TypeError): in the following try block.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boz I think I would prefer that approach. The overfit error handling is mildly concerning, but I don't see any risks that are not already present in the previous try block.

Copy link
Contributor Author

@boz boz Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will do.

I did it that way at first but I felt like it could shadow other problems too easily.

@displague displague added the bug label Aug 16, 2021
@displague displague added this to the 1.45 milestone Aug 16, 2021
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
@displague displague force-pushed the fix-unattached-reservation branch from 998e810 to 37af084 Compare August 29, 2021 21:02
@displague displague merged commit 5655305 into packethost:master Aug 29, 2021
@boz
Copy link
Contributor Author

boz commented Sep 3, 2021

Thanks so much @displague - sorry I ran out of bandwidth, was just coming back to this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants