Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle unattached hardware reservations #120

Merged
merged 2 commits into from
Aug 29, 2021

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 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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants