Fix DNS script cleanup

Generated errors like:
2015-07-14 00:36:56,143 [salt.loaded.int.module.cmdmod][ERROR   ][16060] stderr: /bin/bash: -c: line 0: syntax error near unexpected token `then'

Simply apply existing pattern from running_systemd function. It should
probably all be revisited to work like bootstrap.sh but instead be
shipped into python module as data files.
This commit is contained in:
Gilles Dartiguelongue 2015-07-15 23:19:48 +02:00
parent 89649456e0
commit 456393d4db

View file

@ -2870,7 +2870,7 @@ def set_dns(name, dnsservers=None, searchdomains=None):
name, 'sh -c "chmod +x {0};{0}"'.format(script), python_shell=True)
# blindly delete the setter file
run_all(name,
'if [ -f "{0}" ];then rm -f "{0}";fi'.format(script),
'sh -c \'if [ -f "{0}" ];then rm -f "{0}";fi\''.format(script),
python_shell=True)
if result['retcode'] != 0:
error = ('Unable to write to /etc/resolv.conf in container \'{0}\''