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 /subplot | |
parent | a315fab485429c0e4dfd665ced86f51130e3ac3c (diff) | |
download | vmadm-7cd32a05dd2881b2aa92b4f3276d64a27f489173.tar.gz |
delete take spec file, not VM name
Diffstat (limited to 'subplot')
-rw-r--r-- | subplot/vmadm.py | 9 |
1 files changed, 2 insertions, 7 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) |