diff mbox series

tests/acceptance: linux-related tests fix

Message ID 161373266228.1608713.7614311331725780044.stgit@pasha-ThinkPad-X280 (mailing list archive)
State New, archived
Headers show
Series tests/acceptance: linux-related tests fix | expand

Commit Message

Pavel Dovgalyuk Feb. 19, 2021, 11:04 a.m. UTC
This patch allows cloudinit images download when ssh
key is not specified.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
---
 tests/acceptance/avocado_qemu/__init__.py |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Willian Rampazzo Feb. 19, 2021, 3:43 p.m. UTC | #1
On Fri, Feb 19, 2021 at 8:07 AM Pavel Dovgalyuk
<pavel.dovgalyuk@ispras.ru> wrote:
>
> This patch allows cloudinit images download when ssh
> key is not specified.
>
> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
> ---
>  tests/acceptance/avocado_qemu/__init__.py |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>

Reviewed-by: Willian Rampazzo <willianr@redhat.com>
diff mbox series

Patch

diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
index df167b142c..4ac9f72876 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -304,8 +304,10 @@  def prepare_cloudinit(self, ssh_pubkey=None):
         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',