mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Merge pull request #19144 from rallytime/bp-19116
Backport #19116 to 2014.7
This commit is contained in:
commit
5e2473cf43
@ -126,10 +126,10 @@ def destroy(device):
|
|||||||
stop_cmd = ['mdadm', '--stop', device]
|
stop_cmd = ['mdadm', '--stop', device]
|
||||||
zero_cmd = ['mdadm', '--zero-superblock']
|
zero_cmd = ['mdadm', '--zero-superblock']
|
||||||
|
|
||||||
if __salt__['cmd.retcode'](stop_cmd):
|
if __salt__['cmd.retcode'](stop_cmd, python_shell=False):
|
||||||
for number in details['members']:
|
for number in details['members']:
|
||||||
zero_cmd.append(number['device'])
|
zero_cmd.append(details['members'][number]['device'])
|
||||||
__salt__['cmd.retcode'](zero_cmd)
|
__salt__['cmd.retcode'](zero_cmd, python_shell=False)
|
||||||
|
|
||||||
# Remove entry from config file:
|
# Remove entry from config file:
|
||||||
if __grains__.get('os_family') == 'Debian':
|
if __grains__.get('os_family') == 'Debian':
|
||||||
@ -137,7 +137,10 @@ def destroy(device):
|
|||||||
else:
|
else:
|
||||||
cfg_file = '/etc/mdadm.conf'
|
cfg_file = '/etc/mdadm.conf'
|
||||||
|
|
||||||
|
try:
|
||||||
__salt__['file.replace'](cfg_file, 'ARRAY {0} .*'.format(device), '')
|
__salt__['file.replace'](cfg_file, 'ARRAY {0} .*'.format(device), '')
|
||||||
|
except SaltInvocationError:
|
||||||
|
pass
|
||||||
|
|
||||||
if __salt__['raid.list']().get(device) is None:
|
if __salt__['raid.list']().get(device) is None:
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user