From c1de4c4760367361c96081d96ae03293bc49bb18 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 7 Oct 2020 07:23:42 +0300 Subject: fix: use a random port for Qemu client --- subplot/subplot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'subplot/subplot.py') diff --git a/subplot/subplot.py b/subplot/subplot.py index 4434f24..c9c3cdc 100644 --- a/subplot/subplot.py +++ b/subplot/subplot.py @@ -81,6 +81,8 @@ def run_playbook(ctx): assert_ne = globals()["assert_ne"] srcdir = globals()["srcdir"] + qemu = ctx["qemu"] + with open("hosts", "w") as f: f.write("test-host\n") @@ -98,7 +100,7 @@ def run_playbook(ctx): "-ostricthostkeychecking=accept-new", "-i", os.path.join(srcdir, "ssh", "id"), - "-p2222", + f"-p{qemu.get_port()}", ] env = dict(os.environ) @@ -112,7 +114,7 @@ def run_playbook(ctx): "hosts", f"-e@vars.yml", "-eansible_ssh_host=localhost", - "-eansible_ssh_port=2222", + f"-eansible_ssh_port={qemu.get_port()}", "playbook.yml", ] -- cgit v1.2.1