diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-02-20 20:03:36 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-02-20 20:03:36 +0200 |
commit | 7cd32a05dd2881b2aa92b4f3276d64a27f489173 (patch) | |
tree | caf07b0dcbf9d58f6c4502189378b2c1b1c93a8d | |
parent | a315fab485429c0e4dfd665ced86f51130e3ac3c (diff) | |
download | vmadm-7cd32a05dd2881b2aa92b4f3276d64a27f489173.tar.gz |
delete take spec file, not VM name
-rw-r--r-- | subplot/vmadm.py | 9 | ||||
-rw-r--r-- | vmadm.md | 3 |
2 files changed, 4 insertions, 8 deletions
diff --git a/subplot/vmadm.py b/subplot/vmadm.py index 7a13635..2374baf 100644 --- a/subplot/vmadm.py +++ b/subplot/vmadm.py @@ -1,5 +1,4 @@ import os -import yaml def install_vmadm(ctx): @@ -23,10 +22,7 @@ def create_vm(ctx, filename=None): runcmd_run = globals()["runcmd_run"] runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"] - with open(filename) as f: - spec = yaml.load(f) - ctx["spec"] = spec - + ctx["spec"] = filename runcmd_run(ctx, ["vmadm", "new", filename]) runcmd_exit_code_is_zero(ctx) @@ -35,8 +31,7 @@ def delete_vm(ctx, filename=None): runcmd_run = globals()["runcmd_run"] runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"] - name = ctx["spec"]["name"] - runcmd_run(ctx, ["vmadm", "delete", name]) + runcmd_run(ctx, ["vmadm", "delete", ctx["spec"]]) runcmd_exit_code_is_zero(ctx) @@ -17,7 +17,7 @@ then stdout contains "smoke" when I invoke ssh -F .ssh/config debian@smoke df -h / then stdout contains "4.9G" when I invoke ssh -F .ssh/config debian@smoke free -m -then stdout contains "2000" +then stdout contains "1997" ~~~ @@ -29,6 +29,7 @@ base: /home/liw/tmp/debian-10-openstack-amd64.qcow2 image: smoke.qcow2 image_size_gib: 5 memory_mib: 2048 +cpus: 1 ~~~ ~~~{#ssh_key .file} |