HEnquist / camillagui-backend

Backend server for camillagui
GNU General Public License v3.0
18 stars 4 forks source link

[1.0.0rc1] Missing default value for config entry 'log_file' #40

Closed bitkeeper closed 2 years ago

bitkeeper commented 2 years ago

Did a test run with 1.0.0rc1. At startup of the gui backend, the backend crashed due missing value in config:

May 03 11:19:31 raspberrypi python3[1536009]: Traceback (most recent call last):
May 03 11:19:31 raspberrypi python3[1536009]:   File "/opt/camillagui/main.py", line 13, in <module>
May 03 11:19:31 raspberrypi python3[1536009]:     app["log_file"] = config["log_file"]
May 03 11:19:31 raspberrypi python3[1536009]: KeyError: 'log_file

Maybe set the default value at backend/settings.py in function get_config to None:

+    if "log_file" not in config:
+        config["log_file"] = None

This will be backward compatible with already existing config files and an at least provides backend that starts.

HEnquist commented 2 years ago

Thanks! I'll fix asap.

HEnquist commented 2 years ago

Can you please try 1.0.0-rc2?

bitkeeper commented 2 years ago

rc2 works like a charm! Thanks