mirror of
https://github.com/junkfix/config-editor.git
synced 2025-09-21 00:32:10 +02:00
keep old file permission workaround
This commit is contained in:
parent
5616917064
commit
74d9e6efb0
|
@ -90,11 +90,12 @@ async def websocket_create(hass, connection, msg):
|
||||||
except:
|
except:
|
||||||
mode = 0o666
|
mode = 0o666
|
||||||
with AtomicWriter(fullpath, overwrite=True).open() as fdesc:
|
with AtomicWriter(fullpath, overwrite=True).open() as fdesc:
|
||||||
|
fdesc.write(content)
|
||||||
|
with open(fullpath, 'a') as fdesc:
|
||||||
try:
|
try:
|
||||||
os.fchmod(fdesc.fileno(), mode)
|
os.fchmod(fdesc.fileno(), mode)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
fdesc.write(content)
|
|
||||||
except:
|
except:
|
||||||
res = "Saving Failed"
|
res = "Saving Failed"
|
||||||
_LOGGER.exception(res+": %s", fullpath)
|
_LOGGER.exception(res+": %s", fullpath)
|
||||||
|
|
Loading…
Reference in a new issue