summaryrefslogtreecommitdiffstats
path: root/src/ogRest.py
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-05-13 14:10:01 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-05-13 14:10:01 +0200
commit38b6d77561c87cb427b21b811ce10208f2eb5b1a (patch)
treec091b3e6db41fff548f7c00b905d0dbc5a7e70cd /src/ogRest.py
parent404b8c79d070a027503cb8792888817eb800b396 (diff)
Switch config file to json
This patch makes configuration parsing easier as well as making the full configuration available in many subclasses.
Diffstat (limited to 'src/ogRest.py')
-rw-r--r--src/ogRest.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ogRest.py b/src/ogRest.py
index abe05c1..14b9d33 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -242,14 +242,15 @@ class ogResponses(Enum):
SERVICE_UNAVAILABLE=5
class ogRest():
- def __init__(self, mode, samba_config):
+ def __init__(self, config):
self.proc = None
self.terminated = False
self.state = ThreadState.IDLE
- self.mode = mode
- self.samba_config = samba_config
+ self.CONFIG = config
+ self.mode = self.CONFIG['opengnsys']['mode']
+ self.samba_config = self.CONFIG['samba']
- if self.mode == 'linux' and platform.system() == 'Linux':
+ if self.mode == 'linux':
self.operations = OgLinuxOperations()
elif self.mode == 'virtual':
self.operations = OgVirtualOperations()