mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 13:45:25 +03:00
Check that the config file is writable
This commit is contained in:
parent
d2a0fce03d
commit
d658035b60
@ -18,6 +18,10 @@ def migrate_frigate_config(config_file: str):
|
|||||||
"""handle migrating the frigate config."""
|
"""handle migrating the frigate config."""
|
||||||
logger.info("Checking if frigate config needs migration...")
|
logger.info("Checking if frigate config needs migration...")
|
||||||
|
|
||||||
|
if not os.access(config_file, mode=os.W_OK):
|
||||||
|
logger.error("Config file is read-only, unable to migrate config file.")
|
||||||
|
return
|
||||||
|
|
||||||
yaml = YAML()
|
yaml = YAML()
|
||||||
yaml.indent(mapping=2, sequence=4, offset=2)
|
yaml.indent(mapping=2, sequence=4, offset=2)
|
||||||
with open(config_file, "r") as f:
|
with open(config_file, "r") as f:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user