Made error message of chia plotters version more traceable (#13704)

This commit is contained in:
Izumi Hoshino
2022-10-26 15:48:24 -05:00
committed by GitHub
parent 45b5ea39bb
commit 6dfbc1ef7c
2 changed files with 13 additions and 1 deletions
+8
View File
@@ -38,7 +38,11 @@ def meets_memory_requirement(plotters_root_path: Path) -> Tuple[bool, Optional[s
"Failed to call bladebit with --memory-json option",
capture_output=True,
text=True,
check=False,
)
if proc.returncode != 0:
return have_enough_memory, proc.stderr.strip()
memory_info: Dict[str, int] = json.loads(proc.stdout)
total_bytes: int = memory_info.get("total", -1)
required_bytes: int = memory_info.get("required", 0)
@@ -104,7 +108,11 @@ def get_bladebit_version(plotters_root_path: Path):
"Failed to call bladebit with --version option",
capture_output=True,
text=True,
check=False,
)
if proc.returncode != 0:
return None, proc.stderr.strip()
# (Found, versionStr)
version_str: str = proc.stdout.strip()
return True, version_str.split(".")
+5 -1
View File
@@ -86,7 +86,11 @@ def get_madmax_version(plotters_root_path: Path):
"Failed to call madmax with --version option",
capture_output=True,
text=True,
check=False,
)
if proc.returncode != 0:
return None, proc.stderr.strip()
# (Found, versionStr)
version_str = proc.stdout.strip()
return True, version_str.split(".")
@@ -108,7 +112,7 @@ def get_madmax_install_info(plotters_root_path: Path) -> Optional[Dict[str, Any]
if found:
version = ".".join(result_msg)
elif found is None:
print(result_msg)
print(f"Failed to determine madMAx version: {result_msg}")
if version is not None:
installed = True