tests/acceptance: linux-related tests fix

This patch allows cloudinit images download when ssh
key is not specified.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Message-Id: <161373266228.1608713.7614311331725780044.stgit@pasha-ThinkPad-X280>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Cleber Rosa <crosa@redhat.com>
This commit is contained in:
Pavel Dovgalyuk 2021-02-19 14:04:22 +03:00 committed by Cleber Rosa
parent 9afa1766dd
commit affc55e761

View file

@ -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',