summaryrefslogtreecommitdiff
path: root/subplot/vmadm.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-04 10:40:21 +0200
committerLars Wirzenius <liw@liw.fi>2021-03-04 11:46:17 +0200
commit458305fa48338de178739af2e3e86b85c0036a54 (patch)
tree9ad0731c2142d8fa49dda598d5a929556d221f3f /subplot/vmadm.py
parent9ec059250bacd1b17547e40b95709fac8d4f164a (diff)
downloadvmadm-458305fa48338de178739af2e3e86b85c0036a54.tar.gz
feat: use configured defaults to unspecified machine attributes
Diffstat (limited to 'subplot/vmadm.py')
-rw-r--r--subplot/vmadm.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/subplot/vmadm.py b/subplot/vmadm.py
index ae3a3a3..6997c5b 100644
--- a/subplot/vmadm.py
+++ b/subplot/vmadm.py
@@ -63,20 +63,21 @@ def directories_match(ctx, actual=None, expected=None):
assert_eq(edata, adata)
-def create_vm(ctx, filename=None):
+def create_vm(ctx, config=None, filename=None):
runcmd_run = globals()["runcmd_run"]
runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]
+ ctx["config"] = config
ctx["spec"] = filename
- runcmd_run(ctx, ["vmadm", "new", filename])
+ runcmd_run(ctx, ["vmadm", "new", "--config", config, filename])
runcmd_exit_code_is_zero(ctx)
-def delete_vm(ctx, filename=None):
+def delete_vm(ctx, config=None, filename=None):
runcmd_run = globals()["runcmd_run"]
runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]
- runcmd_run(ctx, ["vmadm", "delete", ctx["spec"]])
+ runcmd_run(ctx, ["vmadm", "delete", "--config", ctx["config"], ctx["spec"]])
runcmd_exit_code_is_zero(ctx)