Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-ganeti
Commits
a2d32034
Commit
a2d32034
authored
May 06, 2008
by
Michael Hanselmann
Browse files
Rename hypervisor code to lowercase filenames
Reviewed-by: iustinp
parent
94f3875d
Changes
5
Hide whitespace changes
Inline
Side-by-side
lib/hypervisor/Makefile.am
View file @
a2d32034
CLEANFILES
=
*
.py[oc]
hypervisordir
=
$(pkgpythondir)
/hypervisor
hypervisor_PYTHON
=
__init__.py XenHypervisor.py FakeHypervisor.py
\
BaseHypervisor.py
hypervisor_PYTHON
=
__init__.py hv_base.py hv_fake.py hv_xen.py
python_files
=
$(hypervisor_PYTHON)
include
$(srcdir)/../Makefile.libcommon
lib/hypervisor/__init__.py
View file @
a2d32034
...
...
@@ -27,8 +27,8 @@ from ganeti import ssconf
from
ganeti
import
constants
from
ganeti
import
errors
from
ganeti.hypervisor
import
FakeHypervisor
from
ganeti.hypervisor
import
XenHypervisor
from
ganeti.hypervisor
import
hv_fake
from
ganeti.hypervisor
import
hv_xen
def
GetHypervisor
():
...
...
@@ -40,11 +40,11 @@ def GetHypervisor():
"""
ht_kind
=
ssconf
.
SimpleStore
().
GetHypervisorType
()
if
ht_kind
==
constants
.
HT_XEN_PVM30
:
cls
=
XenHypervisor
.
XenPvmHypervisor
cls
=
hv_xen
.
XenPvmHypervisor
elif
ht_kind
==
constants
.
HT_XEN_HVM31
:
cls
=
XenHypervisor
.
XenHvmHypervisor
cls
=
hv_xen
.
XenHvmHypervisor
elif
ht_kind
==
constants
.
HT_FAKE
:
cls
=
FakeHypervisor
.
FakeHypervisor
cls
=
hv_fake
.
FakeHypervisor
else
:
raise
errors
.
HypervisorError
(
"Unknown hypervisor type '%s'"
%
ht_kind
)
return
cls
()
lib/hypervisor/
BaseHypervisor
.py
→
lib/hypervisor/
hv_base
.py
View file @
a2d32034
File moved
lib/hypervisor/
FakeHypervisor
.py
→
lib/hypervisor/
hv_fake
.py
View file @
a2d32034
...
...
@@ -30,10 +30,10 @@ import re
from
ganeti
import
utils
from
ganeti
import
constants
from
ganeti
import
errors
from
ganeti.hypervisor
import
BaseHypervisor
from
ganeti.hypervisor
import
hv_base
class
FakeHypervisor
(
BaseHypervisor
.
BaseHypervisor
):
class
FakeHypervisor
(
hv_base
.
BaseHypervisor
):
"""Fake hypervisor interface.
This can be used for testing the ganeti code without having to have
...
...
@@ -43,7 +43,7 @@ class FakeHypervisor(BaseHypervisor.BaseHypervisor):
_ROOT_DIR
=
constants
.
RUN_DIR
+
"/ganeti-fake-hypervisor"
def
__init__
(
self
):
BaseHypervisor
.
__init__
(
self
)
hv_base
.
BaseHypervisor
.
__init__
(
self
)
if
not
os
.
path
.
exists
(
self
.
_ROOT_DIR
):
os
.
mkdir
(
self
.
_ROOT_DIR
)
...
...
lib/hypervisor/
XenHypervisor
.py
→
lib/hypervisor/
hv_xen
.py
View file @
a2d32034
...
...
@@ -32,10 +32,10 @@ from ganeti import constants
from
ganeti
import
errors
from
ganeti
import
logger
from
ganeti
import
utils
from
ganeti.hypervisor
import
BaseHypervisor
from
ganeti.hypervisor
import
hv_base
class
XenHypervisor
(
BaseHypervisor
.
BaseHypervisor
):
class
XenHypervisor
(
hv_base
.
BaseHypervisor
):
"""Xen generic hypervisor interface
This is the Xen base class used for both Xen PVM and HVM. It contains
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment