summaryrefslogtreecommitdiffstats
path: root/src/log.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-10-01 10:14:48 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-10-01 15:32:54 +0200
commite30e934272f16e3fa60454c37692034064a33a5c (patch)
tree1ce5a32c25581a201d2129a1aa55f4cf53acd1bc /src/log.py
parent8f437bb954266d1da31c7044edcdc2d9f4cef540 (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.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/log.py b/src/log.py
index 9478bb7..13c625a 100644
--- a/src/log.py
+++ b/src/log.py
@@ -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 = {