mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
remove index use with stat module attributes
This commit is contained in:
parent
dbeeb0e917
commit
ea852ec5d3
1 changed files with 1 additions and 2 deletions
|
@ -13,7 +13,6 @@ import errno
|
|||
import time
|
||||
import random
|
||||
import shutil
|
||||
import stat
|
||||
import salt.ext.six as six
|
||||
|
||||
|
||||
|
@ -122,7 +121,7 @@ class _AtomicWFile(object):
|
|||
if os.path.isfile(self._filename):
|
||||
shutil.copymode(self._filename, self._tmp_filename)
|
||||
st = os.stat(self._filename)
|
||||
os.chown(self._tmp_filename, st[stat.ST_UID], st[stat.ST_GID])
|
||||
os.chown(self._tmp_filename, st.st_uid, st.st_gid)
|
||||
atomic_rename(self._tmp_filename, self._filename)
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
|
|
Loading…
Add table
Reference in a new issue