Skip to content

Commit

Permalink
task/ansible: fix AttributeError
Browse files Browse the repository at this point in the history
AttributeError: 'NoneType' object has no attribute 'get_transport'

Signed-off-by: Kyr Shatskyy <[email protected]>
  • Loading branch information
Kyr Shatskyy committed Jan 18, 2025
1 parent 19977be commit ab5705c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions teuthology/task/ansible.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,11 @@ def generate_inventory(self):
hosts = self.cluster.remotes.keys()
hostnames = []
for remote in hosts:
host, port = remote.ssh.get_transport().getpeername()
i = f"{remote.hostname} ansible_host={host} ansible_port={port} ansible_ssh_common_args='-o StrictHostKeyChecking=no'"
if remote.ssh:
host, port = remote.ssh.get_transport().getpeername()
i = f"{remote.hostname} ansible_host={host} ansible_port={port} ansible_ssh_common_args='-o StrictHostKeyChecking=no'"
else:
i = remote.hostname
hostnames.append(i)
inventory = []
if self.inventory_group:
Expand Down

0 comments on commit ab5705c

Please sign in to comment.