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

Fixing the 'device_instance' being None in some partition places #902

Merged
merged 9 commits into from
Jan 25, 2022

Conversation

Torxed
Copy link
Member

@Torxed Torxed commented Jan 25, 2022

One minor issue was that add_partition was defined to return -> None.
Another issue might be uuid comparison using small/capital letters when comparing, so unified that.
Added a bunch of debugging and placed an exception in case add_partition doesn't return anything at all.

Anton Hvornum and others added 6 commits January 25, 2022 12:55
…to make sure `add_partition` can't continue silently
…get device (#896)

* disk layout: partprobe should be called and checked only for target device

* disk layout: partprobe: removed unnecessary bash subprocess
@Torxed
Copy link
Member Author

Torxed commented Jan 25, 2022

Found the possible culprit: filesystem.partprobe some times couldn't execute properly for different reasons.
This was passed silently allowing for add_partition (who calls partprobe) to return None when that happened.

Added an exception to add_partition so that it can't return nothing, but also added more debugging in case something like this ever happens again.

…e mount-checks got some rrro handling and non-block devices should no longer attempt to return a size
Torxed referenced this pull request Jan 25, 2022
…get device (#896)

* disk layout: partprobe should be called and checked only for target device

* disk layout: partprobe: removed unnecessary bash subprocess
@Torxed
Copy link
Member Author

Torxed commented Jan 25, 2022

We also had to change and make sure Partition() objects are properly configured with a BlockDevice() so that subsequent calls to .size and similar attributes doesn't break.

@Torxed Torxed merged commit 1aa7386 into master Jan 25, 2022
@Torxed Torxed deleted the torxed-fix-deviceinstance branch January 25, 2022 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: 'NoneType' object has no attribute 'format' on master
2 participants