summaryrefslogtreecommitdiffstats
path: root/src/linux/ogOperations.py
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2020-05-15 17:14:47 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2020-05-18 08:33:37 +0200
commit621fb7a786c724609690c480650b8a4ac01befa7 (patch)
tree2d80aa5713756d2ebb8ded5582a9e747cd67fb4e /src/linux/ogOperations.py
parentefedaa27f1402331911b50f33ca3315a8b888884 (diff)
Adapt ogLinuxOperation to work with json config file
ogClient changed its config file format to json. This patch adapts ogLinuxOperation to use new config file. Co-authored-by: Roberto Hueso <rhueso@soleta.eu>
Diffstat (limited to 'src/linux/ogOperations.py')
-rw-r--r--src/linux/ogOperations.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/linux/ogOperations.py b/src/linux/ogOperations.py
index db37326..3638268 100644
--- a/src/linux/ogOperations.py
+++ b/src/linux/ogOperations.py
@@ -7,18 +7,16 @@
#
import os
+import json
import subprocess
from src.ogConfig import *
OG_SHELL = '/bin/bash'
class OgLinuxOperations:
-
- _ogconfig = ogConfig()
- _config_path = f'{ogConfig.OG_PATH}ogclient/cfg/ogclient.cfg'
- _ogconfig.parser_file(_config_path)
- _url = _ogconfig.get_value_section('opengnsys', 'url')
- _url_log = _ogconfig.get_value_section('opengnsys', 'url_log')
+ def __init__(self, config):
+ _url = config['opengnsys']['url']
+ _url_log = config['opengnsys']['url_log']
def _restartBrowser(self, url):
try: