A singletone class for creating hypervisor driver objects. More...
Public Member Functions | |
def | __init__ |
Instantiates a HypervisorFactory object. More... | |
Static Public Member Functions | |
def | get_hypervisor_instance |
Returns the hypervisor driver nstance. More... | |
A singletone class for creating hypervisor driver objects.
For an instantiation of nf.io there can be exactly one object of only one type of hyperviosr. HyervisorFactory takes care of the creation logic.
Definition at line 11 of file hypervisor_factory.py.
def hypervisor.hypervisor_factory.HypervisorFactory.__init__ | ( | self, | |
hypervisor_type = "DockerDriver" |
|||
) |
Instantiates a HypervisorFactory object.
Args: hypervisor_type: The type of hypervisor object to instantiate. Valid hypervisor types are 'DockerDriver' and 'Libvirt' for the time being.
Returns: Nothing. Initializaes the factory object.
Note: If this factory class is instantiated multiple times with different types of hypervisor_type argument then it raises a ValueError.
If this factory class is instantiated with a hypervisor type other than Docker or Libvirt it raises a TypeError.
Definition at line 34 of file hypervisor_factory.py.
|
static |
Returns the hypervisor driver nstance.
If the instance is not initialized then a RuntimeError is raised.
Definition at line 57 of file hypervisor_factory.py.