Ensure each host is type string

ssh_servers takes a list of strings. This change
ensures that each item in the list is a string
instead of type Host being returned from
InventoryManager.

Resolves: rhbz#2085492
Change-Id: Ic3dc6304287361e83e91ad05aa480ff874011f1b
This commit is contained in:
Brendan Shephard 2022-05-15 04:45:34 +10:00
parent 196dcf5d06
commit fb7c8f5c27
1 changed files with 5 additions and 2 deletions

View File

@ -114,6 +114,10 @@ class Authorize(command.Command):
else:
hosts = parsed_args.limit_hosts
host_list = [str(h) for h in oooutils.parse_ansible_inventory(
inventory, hosts
)]
oooutils.run_ansible_playbook(
playbook='cli-enable-ssh-admin.yaml',
inventory=inventory,
@ -123,8 +127,7 @@ class Authorize(command.Command):
ssh_user=parsed_args.overcloud_ssh_user,
extra_vars={
"ANSIBLE_PRIVATE_KEY_FILE": key_file,
"ssh_servers": oooutils.parse_ansible_inventory(
inventory, hosts)
"ssh_servers": host_list
},
ansible_timeout=parsed_args.overcloud_ssh_port_timeout
)