Merge pull request #681 from Didr/patch-1

Add import for all_disks
This commit is contained in:
Anton Hvornum 2021-11-01 14:30:28 +00:00 committed by GitHub
commit e70cfa65bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -7,6 +7,7 @@ from ..general import SysCommand
class BlockDevice:
def __init__(self, path, info=None):
if not info:
from .helpers import all_disks
# If we don't give any information, we need to auto-fill it.
# Otherwise any subsequent usage will break.
info = all_disks()[path].info
@ -220,4 +221,4 @@ class BlockDevice:
def get_partition(self, uuid):
for partition in self:
if partition.uuid == uuid:
return partition
return partition