From 1d86a00160aab96e41d15e779244853a9b04de71 Mon Sep 17 00:00:00 2001 From: Caleb Date: Sat, 16 Nov 2024 09:48:09 -0500 Subject: [PATCH] prettify the header (cherry picked from commit 5506a70b96be27aa4bf42c43fd8327653aabcb32) --- ixdiagnose/plugins/nvme.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ixdiagnose/plugins/nvme.py b/ixdiagnose/plugins/nvme.py index 0304764..4143a9a 100644 --- a/ixdiagnose/plugins/nvme.py +++ b/ixdiagnose/plugins/nvme.py @@ -19,8 +19,8 @@ def get_nvme_devs() -> list[str]: return nvmes -def run_nvme_cmd(action: str, nvme: str) -> str: - header = f"nvme {action} {nvme!r}\n" +def run_nvme_cmd(action: str, nvme: str, add_header: bool = True) -> str: + header = '' if not add_header else f'{nvme:#^30}\n' cp = run(["nvme", action, nvme], check=False) if cp.returncode: footer = f"FAILED: {cp.stderr}\n\n" @@ -47,7 +47,7 @@ def get_nvme_id_ns(client: MiddlewareClient, context: Any) -> str: def get_nvme_smart_log(client: MiddlewareClient, context: Any) -> str: output = "" for nvme in get_nvme_devs(): - output += run_nvme_cmd("smart-log", nvme) + output += run_nvme_cmd("smart-log", nvme, add_header=False) return output