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>
more_events
Javier Sánchez Parra 2020-05-15 17:14:47 +02:00
parent efedaa27f1
commit 621fb7a786
2 changed files with 5 additions and 7 deletions

View File

@ -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:

View File

@ -251,7 +251,7 @@ class ogRest():
self.samba_config = self.CONFIG['samba']
if self.mode == 'linux':
self.operations = OgLinuxOperations()
self.operations = OgLinuxOperations(self.CONFIG)
elif self.mode == 'virtual':
self.operations = OgVirtualOperations()
threading.Thread(target=ogThread.check_vm_state_loop,