Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yocalebo committed Oct 28, 2024
1 parent 26c8edc commit 4e6c431
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ixdiagnose/plugins/zfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'
Expand All @@ -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'
Expand Down

0 comments on commit 4e6c431

Please sign in to comment.