Revert "Fix incorrect file permissions in file.line"

Refs #30204

This reverts commit 79daa25a15.
This commit is contained in:
Mike Place 2016-01-07 10:54:34 -07:00
parent 5632ccb796
commit ee786293e7
2 changed files with 2 additions and 4 deletions

View file

@ -1468,9 +1468,9 @@ def line(path, content, match=None, mode=None, location=None,
salt '*' file.line /etc/nsswitch.conf "networks:\tfiles dns", after="hosts:.*?", mode='ensure'
'''
path = os.path.realpath(os.path.expanduser(path))
if not os.path.isfile(path):
if not os.path.exists(path):
if not quiet:
raise CommandExecutionError('File "{0}" does not exists or is not a file.'.format(path))
raise CommandExecutionError('File "{0}" does not exists.'.format(path))
return False # No changes had happened
mode = mode and mode.lower() or mode

View file

@ -12,7 +12,6 @@ import sys
import errno
import time
import random
import shutil
import salt.ext.six as six
@ -118,7 +117,6 @@ class _AtomicWFile(object):
if self._fh.closed:
return
self._fh.close()
shutil.copymode(self._filename, self._tmp_filename)
atomic_rename(self._tmp_filename, self._filename)
def __exit__(self, exc_type, exc_value, traceback):