-
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,802 additions
and
16 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .image_agent import image_agent | ||
from .resource_backing_agent import resbacking_agent |
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,29 @@ | ||
import logging | ||
|
||
from .images import get_image_handler | ||
|
||
|
||
LOG = logging.getLogger("avocado.service." + __name__) | ||
|
||
|
||
class _ImageAgent(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 | ||
|
||
|
||
image_agent = _ImageAgent() |
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.