kolla_address: check correct error return value

Unlike other methods such as resolve(), get() does not return an Undefined object, but None.
This removes 4 ansible-lint warnings in various files calling kolla_address.

Closes-Bug: #2038281

Change-Id: I591a50512a954210f951c40a350ed4b9e1fc48ae
This commit is contained in:
Célestin Matte 2023-09-18 21:20:46 +02:00 committed by Célestin Matte
parent 65079b4dc1
commit eec8b05914

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)