summaryrefslogtreecommitdiffstats
path: root/src/virtBootstrap/virt_bootstrap.py
diff options
context:
space:
mode:
authorRadostin Stoyanov <rstoyanov1@gmail.com>2017-08-26 21:42:06 +0100
committerRadostin Stoyanov <rstoyanov1@gmail.com>2017-08-28 17:00:19 +0100
commite98df68ded6515c3f6d8f8854697c15407aff000 (patch)
treec6f0f087b89b6f0966025e7441fb0f01765dc25c /src/virtBootstrap/virt_bootstrap.py
parent2bb76d45f14ae1bce4240bd3c1eeabcb44f663ac (diff)
downloadvirt-bootstrap.git-e98df68ded6515c3f6d8f8854697c15407aff000.tar.gz
virt-bootstrap.git-e98df68ded6515c3f6d8f8854697c15407aff000.tar.xz
virt-bootstrap.git-e98df68ded6515c3f6d8f8854697c15407aff000.zip
Add virt-builder source
Add implementation for virt-builder source which aims to create container root file system from VM image build with virt-builder. Usage examples: $ virt-bootstrap virt-builder://fedora-25 /tmp/foo $ virt-bootstrap virt-builder://ubuntu-16.04 /tmp/bar --root-password secret $ virt-bootstrap virt-builder://fedora-25 /tmp/foo -f qcow2 --idmap 0:1000:10 $ sudo virt-bootstrap virt-builder://fedora-25 /tmp/foo --idmap 0:1000:10 Tests are also introduced along with the implementation. They cover creation of root file system and UID/GID mapping for 'dir' and 'qcow2' output format by mocking the build_image() method to avoid the time consuming call to virt-builder which might also require network connection with function which creates dummy disk image. Setting root password is handled by virt-builder and hence the introduced test only ensures that the password string is passed correctly.
Diffstat (limited to 'src/virtBootstrap/virt_bootstrap.py')
-rwxr-xr-xsrc/virtBootstrap/virt_bootstrap.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/virtBootstrap/virt_bootstrap.py b/src/virtBootstrap/virt_bootstrap.py
index e387842..fe95f5e 100755
--- a/src/virtBootstrap/virt_bootstrap.py
+++ b/src/virtBootstrap/virt_bootstrap.py
@@ -62,7 +62,7 @@ def get_source(source_type):
Get object which match the source type
"""
try:
- class_name = "%sSource" % source_type.capitalize()
+ class_name = "%sSource" % source_type.title().replace('-', '')
clazz = getattr(sources, class_name)
return clazz
except Exception: