diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-10-01 10:14:48 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-10-01 15:32:54 +0200 |
commit | e30e934272f16e3fa60454c37692034064a33a5c (patch) | |
tree | 1ce5a32c25581a201d2129a1aa55f4cf53acd1bc /src/log.py | |
parent | 8f437bb954266d1da31c7044edcdc2d9f4cef540 (diff) |
src: replace DEVICE env variable with get_ethernet_interface()
Use a python function to obtain the main net interface. Detect
the first ethernet inferface in use.
Stop using the DEVICE environment variable.
Diffstat (limited to 'src/log.py')
-rw-r--r-- | src/log.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -9,6 +9,7 @@ import logging import logging.config import os +from src.utils.net import get_ethernet_interface class OgError(Exception): @@ -67,7 +68,7 @@ def _default_logging_live(): 'samba': { 'class': 'logging.FileHandler', 'formatter': 'formatter.syslogtime', - 'filename': f'/opt/opengnsys/log/{getifaddr(os.getenv("DEVICE"))}.log', + 'filename': f'/opt/opengnsys/log/{getifaddr(get_ethernet_interface())}.log', } } rtlog = { |