summaryrefslogtreecommitdiffstats
path: root/ogclient
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2021-12-09 16:24:03 +0100
committerJose M. Guisado <jguisado@soleta.eu>2021-12-10 10:03:12 +0100
commit1601ad9b298ccefa1a71ae9ccfb939c73a5fc0ec (patch)
tree44f11cbb1fd7bf2bee2fbe9d9a3887120c682597 /ogclient
parent05f2fd43c274f896a719df097e668d8ca371b615 (diff)
#1065 Init config_path according to platform
Commit 2dbcd18c06dd breaks interfaceAdm path for live operations. Keep OG_PATH to the value prior to commit 2dbcd18c06dd. Check platform before reading config file. If platform is different from linux then look for cfg/ogclient.json in current folder and do not use OG_PATH.
Diffstat (limited to 'ogclient')
-rwxr-xr-xogclient8
1 files changed, 7 insertions, 1 deletions
diff --git a/ogclient b/ogclient
index 8e25303..0e7bca6 100755
--- a/ogclient
+++ b/ogclient
@@ -11,6 +11,7 @@
import json
import logging
import argparse
+import platform
import subprocess
try:
from signal import SIG_DFL, SIGPIPE
@@ -52,7 +53,12 @@ def main():
if args.func:
args.func(args)
return
- config_path = f'{ogClient.OG_PATH}cfg/ogclient.json'
+
+ if platform.system().lower() == 'linux':
+ config_path = f'{ogClient.OG_PATH}ogclient/cfg/ogclient.json'
+ else:
+ config_path = './cfg/ogclient.json'
+
try:
with open(config_path, 'r') as f:
CONFIG = json.load(f)