Merge "kolla_address: check correct error return value"

This commit is contained in:
Zuul 2023-10-03 12:48:51 +00:00 committed by Gerrit Code Review
commit 0a392a69f5

View File

@ -48,7 +48,7 @@ def kolla_address(context, network_name, hostname=None):
raise FilterError("'inventory_hostname' variable is unavailable")
hostvars = context.get('hostvars')
if isinstance(hostvars, Undefined):
if hostvars is None or isinstance(hostvars, Undefined):
raise FilterError("'hostvars' variable is unavailable")
host = hostvars.get(hostname)