Revision 2584d4a4 lib/hypervisor.py
b/lib/hypervisor.py | ||
---|---|---|
33 | 33 |
from ganeti import constants |
34 | 34 |
from ganeti.errors import HypervisorError |
35 | 35 |
|
36 |
_HT_XEN30 = "xen-3.0" |
|
37 |
_HT_FAKE = "fake" |
|
38 |
|
|
39 |
VALID_HTYPES = (_HT_XEN30, _HT_FAKE) |
|
40 | 36 |
|
41 | 37 |
def GetHypervisor(): |
42 | 38 |
"""Return a Hypervisor instance. |
... | ... | |
46 | 42 |
|
47 | 43 |
""" |
48 | 44 |
ht_kind = ssconf.SimpleStore().GetHypervisorType() |
49 |
if ht_kind == _HT_XEN30:
|
|
45 |
if ht_kind == constants.HT_XEN30:
|
|
50 | 46 |
cls = XenHypervisor |
51 |
elif ht_kind == _HT_FAKE:
|
|
47 |
elif ht_kind == constants.HT_FAKE:
|
|
52 | 48 |
cls = FakeHypervisor |
53 | 49 |
else: |
54 | 50 |
raise HypervisorError("Unknown hypervisor type '%s'" % ht_kind) |
Also available in: Unified diff