summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2020-05-19 10:24:02 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2020-05-20 10:33:41 +0200
commit6502180fc8be0a7307622963c147ab1b74ecb47d (patch)
tree1dcc26b6c43d459b244248d66557a44455101f9d
parent2ab5db74fea2e0cab82801b67969a818d721b405 (diff)
Only import virtual functions when needed.
ogClient may runs on an OS that do not have all the dependencies needed to use virtual functions. This commit change the behaviour to only import virtual functions when the ogClient has to work with Virtual Machines. This way ogClient works on environments which do not need virtual functions.
-rw-r--r--src/ogRest.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ogRest.py b/src/ogRest.py
index 01a3050..31c1506 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -19,7 +19,6 @@ import signal
from src.restRequest import *
from src.linux.ogOperations import OgLinuxOperations
-from src.virtual.ogOperations import OgVirtualOperations, OgVM
class ThreadState(Enum):
IDLE = 0
@@ -253,6 +252,8 @@ class ogRest():
if self.mode == 'linux':
self.operations = OgLinuxOperations(self.CONFIG)
elif self.mode == 'virtual':
+ from src.virtual.ogOperations import (OgVM,
+ OgVirtualOperations)
self.operations = OgVirtualOperations()
threading.Thread(target=ogThread.check_vm_state_loop,
args=(self,)).start()