items/zfs_pool: rewrite item to support all kinds of zfs pools
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
9111d49bf4
commit
cee2a41771
10 changed files with 134 additions and 117 deletions
|
@ -23,13 +23,13 @@ defaults = {
|
|||
def zfs_disks_to_metadata(metadata):
|
||||
disks = set()
|
||||
|
||||
for _, config in metadata.get('zfs/pools', {}).items():
|
||||
if 'device' in config:
|
||||
disks.add(config['device'])
|
||||
else:
|
||||
for t in {'mirror', 'raidz', 'raidz2', 'raidz3'}:
|
||||
for device in config.get(t, set()):
|
||||
disks.add(device)
|
||||
for config in metadata.get('zfs/pools', {}).values():
|
||||
for option in config:
|
||||
if option.get('type', '') in {'log', 'cache'}:
|
||||
continue
|
||||
|
||||
for disk in option['devices']:
|
||||
disks.add(disk)
|
||||
|
||||
return {
|
||||
'smartd': {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue