Check that the config file is writable

This commit is contained in:
Nicolas Mowen 2024-05-26 13:41:34 -06:00
parent d2a0fce03d
commit d658035b60

View File

@ -18,6 +18,10 @@ def migrate_frigate_config(config_file: str):
"""handle migrating the frigate config."""
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.indent(mapping=2, sequence=4, offset=2)
with open(config_file, "r") as f: