mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +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]
|
||||
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']:
|
||||
zero_cmd.append(number['device'])
|
||||
__salt__['cmd.retcode'](zero_cmd)
|
||||
zero_cmd.append(details['members'][number]['device'])
|
||||
__salt__['cmd.retcode'](zero_cmd, python_shell=False)
|
||||
|
||||
# Remove entry from config file:
|
||||
if __grains__.get('os_family') == 'Debian':
|
||||
@ -137,7 +137,10 @@ def destroy(device):
|
||||
else:
|
||||
cfg_file = '/etc/mdadm.conf'
|
||||
|
||||
__salt__['file.replace'](cfg_file, 'ARRAY {0} .*'.format(device), '')
|
||||
try:
|
||||
__salt__['file.replace'](cfg_file, 'ARRAY {0} .*'.format(device), '')
|
||||
except SaltInvocationError:
|
||||
pass
|
||||
|
||||
if __salt__['raid.list']().get(device) is None:
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user