From 4e6c431c53926efd97b1d684442d56566604dd23 Mon Sep 17 00:00:00 2001 From: caleb Date: Mon, 28 Oct 2024 13:33:04 -0400 Subject: [PATCH] fix unit tests --- ixdiagnose/plugins/zfs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ixdiagnose/plugins/zfs.py b/ixdiagnose/plugins/zfs.py index b1898c5..5a4755a 100644 --- a/ixdiagnose/plugins/zfs.py +++ b/ixdiagnose/plugins/zfs.py @@ -31,8 +31,10 @@ def zfs_getacl_impl(dataset_name: str, props_dict: dict) -> str: def resource_output(client: MiddlewareClient, resource_type: str) -> str: if resource_type in ('filesystem', 'volume'): + header_str = 'zfs get all' cp = run(['zfs', 'get', 'all', '-t', resource_type], check=False) else: + header_str = 'zpool get all' cp = run([resource_type, 'get', 'all'], check=False) if cp.returncode: return f'Failed to retrieve {resource_type!r} resources: {cp.stderr}' @@ -50,7 +52,7 @@ def resource_output(client: MiddlewareClient, resource_type: str) -> str: output += zfs_getacl(resource_context, prop_dict) prop_dict = {} - header_str = f'{resource_type} get all {resource_name}' + header_str += f' {resource_name}' next_line = '\n\n' if index != 0 else '' output += f'{next_line}{"=" * (len(header_str) + 5)}\n {header_str}\n{"=" * (len(header_str) + 5)}\n\n' output += f'{props_header}\n'