Fixing possible race condition with partprobe (#796)

* Update partition.py

* Added sleep after partprobe

Added sleep after partprobe. Without this tools such as lsblk may be unable to retrieve certain properties of devices (such as partuuid).
This commit is contained in:
Wilhelm Åkermark 2021-12-12 08:58:24 +01:00 committed by GitHub
parent c0b83e7f2f
commit b0c8346fa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -127,6 +127,7 @@ class Filesystem:
def partprobe(self):
SysCommand(f'bash -c "partprobe"')
time.sleep(1)
def raw_parted(self, string: str):
if (cmd_handle := SysCommand(f'/usr/bin/parted -s {string}')).exit_code != 0:

View File

@ -207,6 +207,7 @@ class Partition:
def partprobe(self):
SysCommand(f'bash -c "partprobe"')
time.sleep(1)
def detect_inner_filesystem(self, password):
log(f'Trying to detect inner filesystem format on {self} (This might take a while)', level=logging.INFO)