python runtime: fix behaviour of -s CLI option when given file doesn't exist.
authorEdouard Tisserant <edouard@beremiz.fr>
Wed, 26 Feb 2025 16:17:15 +0100 (2 weeks ago)
changeset 4114 8a9986e26dfc
parent 4113 fe41562050ed
child 4115 a734a4d3ef23
python runtime: fix behaviour of -s CLI option when given file doesn't exist.
Beremiz_service.py
--- a/Beremiz_service.py	Tue Feb 18 16:22:54 2025 +0100
+++ b/Beremiz_service.py	Wed Feb 26 16:17:15 2025 +0100
@@ -169,9 +169,9 @@
             _PSKpath = os.path.join(a, "psk.txt")
             if os.path.isfile(_PSKpath):
                 PSKpath = _PSKpath
-        elif os.path.isfile(a) or os.path.isdir(os.path.dirname(a)):
+        elif os.path.isfile(a) or os.path.isdir(paths.AbsDir(a)):
             PSKpath = a
-            KeyStore = os.path.dirname(a)
+            KeyStore = paths.AbsDir(a)
 
     elif o == "-e":
         fnameanddirname = list(os.path.split(os.path.realpath(a)))