From affc55e761ea4c96b9b2de582d813787a317aeda Mon Sep 17 00:00:00 2001 From: Pavel Dovgalyuk Date: Fri, 19 Feb 2021 14:04:22 +0300 Subject: [PATCH] tests/acceptance: linux-related tests fix This patch allows cloudinit images download when ssh key is not specified. Signed-off-by: Pavel Dovgalyuk Message-Id: <161373266228.1608713.7614311331725780044.stgit@pasha-ThinkPad-X280> Reviewed-by: Willian Rampazzo Signed-off-by: Cleber Rosa --- tests/acceptance/avocado_qemu/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py index ac8041821f..83b1741ec8 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -317,8 +317,10 @@ class LinuxTest(Test): try: cloudinit_iso = os.path.join(self.workdir, 'cloudinit.iso') self.phone_home_port = network.find_free_port() - with open(ssh_pubkey) as pubkey: - pubkey_content = pubkey.read() + pubkey_content = None + if ssh_pubkey: + with open(ssh_pubkey) as pubkey: + pubkey_content = pubkey.read() cloudinit.iso(cloudinit_iso, self.name, username='root', password='password',