summaryrefslogtreecommitdiff
path: root/subplot
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-04 09:16:06 +0200
committerLars Wirzenius <liw@liw.fi>2021-03-04 09:33:28 +0200
commit5c8d79d1fa6a6e6f6174558c2d6484683fa37c77 (patch)
tree7ea950ecae3a1d13716ed397260f2bb576076925 /subplot
parentbccad77273048aae6be22bf09264ca6c6fd4225b (diff)
downloadvmadm-5c8d79d1fa6a6e6f6174558c2d6484683fa37c77.tar.gz
feat: configurable image_directory where VM images go by default
Also, specification file doesn't need to specify an image file anymore. Instead the image will be named after the VM and put into the image directory named in the configuration.
Diffstat (limited to 'subplot')
-rw-r--r--subplot/vmadm.py5
-rw-r--r--subplot/vmadm.yaml2
2 files changed, 4 insertions, 3 deletions
diff --git a/subplot/vmadm.py b/subplot/vmadm.py
index 2daa81c..1ee2914 100644
--- a/subplot/vmadm.py
+++ b/subplot/vmadm.py
@@ -20,6 +20,7 @@ def install_vmadm(ctx):
# directories.
os.mkdir(".ssh")
os.mkdir("expected")
+ os.mkdir("images")
def ensure_base_image(ctx):
@@ -35,11 +36,11 @@ def ensure_base_image(ctx):
shutil.copy(base, "base.qcow2")
-def invoke_cloud_init(ctx, filename=None, dirname=None):
+def invoke_cloud_init(ctx, config=None, filename=None, dirname=None):
runcmd_run = globals()["runcmd_run"]
runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]
- runcmd_run(ctx, ["vmadm", "cloud-init", filename, dirname])
+ runcmd_run(ctx, ["vmadm", "cloud-init", "--config", config, filename, dirname])
runcmd_exit_code_is_zero(ctx)
diff --git a/subplot/vmadm.yaml b/subplot/vmadm.yaml
index a8810ae..ec7d424 100644
--- a/subplot/vmadm.yaml
+++ b/subplot/vmadm.yaml
@@ -4,7 +4,7 @@
- given: "a Debian 10 OpenStack cloud image"
function: ensure_base_image
-- when: "I invoke vmadm cloud-init {filename} {dirname}"
+- when: "I invoke vmadm cloud-init --config {config} {filename} {dirname}"
function: invoke_cloud_init
- when: "I invoke vmadm new {filename}"