From 6502180fc8be0a7307622963c147ab1b74ecb47d Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Tue, 19 May 2020 10:24:02 +0200 Subject: 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. --- src/ogRest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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() -- cgit v1.2.3-18-g5258