diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-03-04 10:40:21 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-03-04 11:46:17 +0200 |
commit | 458305fa48338de178739af2e3e86b85c0036a54 (patch) | |
tree | 9ad0731c2142d8fa49dda598d5a929556d221f3f /subplot | |
parent | 9ec059250bacd1b17547e40b95709fac8d4f164a (diff) | |
download | vmadm-458305fa48338de178739af2e3e86b85c0036a54.tar.gz |
feat: use configured defaults to unspecified machine attributes
Diffstat (limited to 'subplot')
-rw-r--r-- | subplot/vmadm.py | 9 | ||||
-rw-r--r-- | subplot/vmadm.yaml | 2 |
2 files changed, 6 insertions, 5 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) diff --git a/subplot/vmadm.yaml b/subplot/vmadm.yaml index ec7d424..21662b6 100644 --- a/subplot/vmadm.yaml +++ b/subplot/vmadm.yaml @@ -7,7 +7,7 @@ - when: "I invoke vmadm cloud-init --config {config} {filename} {dirname}" function: invoke_cloud_init -- when: "I invoke vmadm new {filename}" +- when: "I invoke vmadm new --config {config} {filename}" function: create_vm cleanup: delete_vm |