Merge pull request #19144 from rallytime/bp-19116

Backport #19116 to 2014.7
This commit is contained in:
Thomas S Hatch 2014-12-22 16:34:07 -07:00
commit 5e2473cf43

View File

@ -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