mirror of https://git.48k.eu/ogclient
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.more_events
parent
2ab5db74fe
commit
6502180fc8
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue