From 9383f54be7ab2012541c272ef65589888c2c1954 Mon Sep 17 00:00:00 2001 From: Eduard Yakubchyk Date: Wed, 18 Feb 2026 05:16:53 -0800 Subject: [PATCH] tests/common/cache: Fix hostname type checking for fanout devices Signed-off-by: Eduard Yakubchyk --- tests/common/cache/facts_cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/common/cache/facts_cache.py b/tests/common/cache/facts_cache.py index c40e5f9ff0..3b3c5504cb 100644 --- a/tests/common/cache/facts_cache.py +++ b/tests/common/cache/facts_cache.py @@ -205,7 +205,7 @@ def _get_default_zone(function, func_args, func_kargs): unicode_type = str if sys.version_info.major >= 3 else unicode # noqa: F821 if func_args: hostname = getattr(func_args[0], "hostname", None) - if not hostname or type(hostname) not in [str, unicode_type]: + if not hostname or not isinstance(hostname, (str, unicode_type)): raise ValueError("Failed to get attribute 'hostname' of type string from instance of type %s." % type(func_args[0])) zone = hostname