From 3cd7dc24c7ebe8911978380d75fd79e0c581060a Mon Sep 17 00:00:00 2001 From: Werner Llácer Date: Thu, 3 Feb 2022 00:02:30 +0100 Subject: Command locales (second batch) (#886) * flexibilize the definition of execution locale for OS commands executed via the SysCommand* interface. Defined a storage argument which holds the default Added functions to unset the program own locales reset to the program default locales set a specific locale A decorator to execute functions in the host locale environment * rename decorator local_environ to host_locale_environ created a simmetric decorator c_locale_environ, to make a routine work with the C locale whatever is set * Correct definition of btrfs standard layout * Added error handling * Fixed issue where archinstall.Boot() would raise an exception in vain * Added debugging for SysCommandWorker() * Added some debugging * Tweaking debug a bit * Tweaking debug * Adding more debug * Adding more debug * Removed some debugging * Adding more debug * Adding more debug * Adding more debug * Adding more debug * Adding more debug * Adding more debug * Adding more debug * Adding more debug * Adding more debug * Adding more debug * Adding more debug * Removed soem debugging * Removed soem debugging * Testing a revert * Adding back the reverted change, adding lofile * Redirecting stdout to /dev/null for testing (to avoid interrupting the fork) * Reverted debug changes * Testing os.system() Co-authored-by: Anton Hvornum --- archinstall/lib/disk/helpers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'archinstall/lib/disk') diff --git a/archinstall/lib/disk/helpers.py b/archinstall/lib/disk/helpers.py index 26f701d2..b04e2740 100644 --- a/archinstall/lib/disk/helpers.py +++ b/archinstall/lib/disk/helpers.py @@ -140,11 +140,12 @@ def split_bind_name(path :Union[pathlib.Path, str]) -> list: def get_mount_info(path :Union[pathlib.Path, str], traverse :bool = False, return_real_path :bool = False) -> Dict[str, Any]: device_path,bind_path = split_bind_name(path) + output = {} + for traversal in list(map(str, [str(device_path)] + list(pathlib.Path(str(device_path)).parents))): try: log(f"Getting mount information for device path {traversal}", level=logging.INFO) - output = SysCommand(f'/usr/bin/findmnt --json {traversal}').decode('UTF-8') - if output: + if (output := SysCommand(f'/usr/bin/findmnt --json {traversal}').decode('UTF-8')): break except SysCallError: pass -- cgit v1.2.3-54-g00ecf