File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from pathlib import Path
2+ from subprocess import CalledProcessError
23
34from pydantic import BaseModel
45
5- from archinstall .lib .command import SysCommand
6+ from archinstall .lib .command import SysCommand , run
67from archinstall .lib .exceptions import DiskError , SysCallError
78from archinstall .lib .log import debug , info , warn
89from archinstall .lib .models .device import LsblkInfo
@@ -29,19 +30,18 @@ def _fetch_lsblk_info(
2930 cmd .append (str (dev_path ))
3031
3132 try :
32- worker = SysCommand (cmd )
33- except SysCallError as err :
33+ result = run (cmd )
34+ except CalledProcessError as err :
3435 # Get the output minus the message/info from lsblk if it returns a non-zero exit code.
35- if err .worker_log :
36- debug (f'Error calling lsblk: { err . worker_log . decode ()} ' )
36+ if stdout := err .stdout :
37+ debug (f'Error calling lsblk: { stdout . decode (). rstrip ()} ' )
3738
3839 if dev_path :
3940 raise DiskError (f'Failed to read disk "{ dev_path } " with lsblk' )
4041
4142 raise err
4243
43- output = worker .output (remove_cr = False )
44- return LsblkOutput .model_validate_json (output )
44+ return LsblkOutput .model_validate_json (result .stdout )
4545
4646
4747def get_lsblk_info (
You can’t perform that action at this time.
0 commit comments