FIX: disk layout: partprobe should be called and checked only for target device (#896)

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

* disk layout: partprobe: removed unnecessary bash subprocess
This commit is contained in:
Victor Gavro 2022-01-25 15:45:28 +02:00 committed by GitHub
parent 26f9b681a4
commit eb712a9ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -141,7 +141,7 @@ class Filesystem:
return partition
def partprobe(self) -> bool:
return SysCommand(f'bash -c "partprobe"').exit_code == 0
return SysCommand(f'partprobe {self.blockdevice.device}').exit_code == 0
def raw_parted(self, string: str) -> SysCommand:
if (cmd_handle := SysCommand(f'/usr/bin/parted -s {string}')).exit_code != 0:

View File

@ -225,7 +225,7 @@ class Partition:
return bind_name
def partprobe(self) -> bool:
if SysCommand(f'bash -c "partprobe"').exit_code == 0:
if SysCommand(f'partprobe {self.block_device.device}').exit_code == 0:
time.sleep(1)
return True
return False