-
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
Signed-off-by: Zhenchao Liu <[email protected]>
- Loading branch information
Showing
66 changed files
with
3,893 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
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,21 @@ | ||
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, update_config): | ||
cmd, arguments = update_config.popitem() | ||
image_type = image_config["meta"]["type"] | ||
handler = get_image_handler(image_type, cmd) | ||
return handler(image_config, arguments) | ||
|
||
|
||
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.