Fix Inventory Generation without Overcloud deployed

The utils.list_plan_and_stack function returns None in case of exceptions
or and empty list if no stacks or no plans have been found in the
environment.

This patch fixes the conditional to allow the tripleo-ansible-inventory
script to generate only the undercloud Inventory when no Overcloud has
been deployed.

Related-bz: rhbz#1987318

Signed-off-by: Gael Chamoulaud (Strider) <gchamoul@redhat.com>
Change-Id: If0dc3300fbd8cf245c0477be782110d897344860
(cherry picked from commit 5a8cfac7f9)
(cherry picked from commit 9289704779)
(cherry picked from commit 8ad642f538)
This commit is contained in:
Gael Chamoulaud (Strider) 2021-07-29 15:45:11 +02:00 committed by Gael Chamoulaud
parent c1ec034b6a
commit 1e9ba89030
1 changed files with 1 additions and 1 deletions

View File

@ -179,7 +179,7 @@ def main():
utils.get_heat_client(auth_variables),
utils.get_swift_client(auth_variables))
if plans is None:
if not plans:
inventory = inv.TripleoInventory(
session=utils.get_auth_session(auth_variables),
hclient=utils.get_heat_client(auth_variables),