-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add storage and image management support
Added pool_selectors and image_pool_name Signed-off-by: Zhenchao Liu <[email protected]>
- Loading branch information
Showing
59 changed files
with
3,829 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
from .connect import ConnectManager | ||
from .console import ConsoleManager | ||
from .image import ImageHandlerManager | ||
from .resource_backing import ResourceBackingManager | ||
|
||
connect_mgr = ConnectManager() | ||
console_mgr = ConsoleManager() | ||
resbacking_mgr = ResourceBackingManager() | ||
image_handler_mgr = ImageHandlerManager() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import logging | ||
|
||
from .images import get_image_handler | ||
|
||
|
||
LOG = logging.getLogger("avocado.service." + __name__) | ||
|
||
|
||
class ImageHandlerManager(object): | ||
|
||
def __init__(self): | ||
pass | ||
|
||
def handle_image(self, image_config, config): | ||
r, o = 0, dict() | ||
try: | ||
cmd, arguments = config.popitem() | ||
image_type = image_config["meta"]["type"] | ||
handler = get_image_handler(image_type, cmd) | ||
ret = handler(image_config, arguments) | ||
if ret: | ||
o["out"] = ret | ||
except Exception as e: | ||
r, o["out"] = 1, str(e) | ||
LOG.debug("Failed to handle image(%s): %s", str(e)) | ||
return r, o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from .qemu import get_qemu_image_handler | ||
#from .xen import get_xen_image_handler | ||
|
||
|
||
_image_handler_getters = { | ||
"qemu": get_qemu_image_handler, | ||
#"xen": get_xen_image_handler, | ||
} | ||
|
||
|
||
def get_image_handler(image_type, cmd): | ||
getter = _image_handler_getters.get(image_type) | ||
return getter(cmd) | ||
|
||
|
||
__all__ = ["get_image_handler"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .qemu_image_handlers import get_qemu_image_handler |
Oops, something went wrong.