mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
eliminate hardcoded vdev type from zpool state
This commit is contained in:
parent
47b8dc946c
commit
25d6c8139b
1 changed files with 6 additions and 7 deletions
|
@ -281,13 +281,12 @@ def present(name, properties=None, filesystem_properties=None, layout=None, conf
|
|||
for root_dev in layout:
|
||||
if '-' in root_dev: # special device
|
||||
# NOTE: accomidate non existing 'disk' vdev
|
||||
if root_dev.split('-')[0] in ['mirror', 'log', 'cache', 'raidz1', 'raidz2', 'raidz3', 'spare', 'disk']:
|
||||
if root_dev.split('-')[0] != 'disk':
|
||||
params.append(root_dev.split('-')[0]) # add the type by stripping the ID
|
||||
for sub_dev in layout[root_dev]: # add all sub devices
|
||||
if '/' not in sub_dev and config['device_dir'] and os.path.exists(config['device_dir']):
|
||||
sub_dev = os.path.join(config['device_dir'], sub_dev)
|
||||
params.append(sub_dev)
|
||||
if root_dev.split('-')[0] != 'disk':
|
||||
params.append(root_dev.split('-')[0]) # add the type by stripping the ID
|
||||
for sub_dev in layout[root_dev]: # add all sub devices
|
||||
if '/' not in sub_dev and config['device_dir'] and os.path.exists(config['device_dir']):
|
||||
sub_dev = os.path.join(config['device_dir'], sub_dev)
|
||||
params.append(sub_dev)
|
||||
else: # normal device
|
||||
if '/' not in root_dev and config['device_dir'] and os.path.exists(config['device_dir']):
|
||||
root_dev = os.path.join(config['device_dir'], root_dev)
|
||||
|
|
Loading…
Add table
Reference in a new issue