Skip to content

Commit

Permalink
prettify the header
Browse files Browse the repository at this point in the history
(cherry picked from commit 5506a70)
  • Loading branch information
yocalebo authored and bugclerk committed Nov 17, 2024
1 parent 2ea16a1 commit 1d86a00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ixdiagnose/plugins/nvme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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


Expand Down

0 comments on commit 1d86a00

Please sign in to comment.