Log warning if active argument needs converting to bool

This commit is contained in:
Roy Nieterau 2024-07-15 17:29:31 +02:00
parent c5e699a159
commit 05f6b0f2ce

View file

@ -2130,7 +2130,12 @@ class CreateContext:
"variant": variant
}
if active is not None:
instance_data["active"] = bool(active)
if not isinstance(active, bool):
self.log.warning(
"CreateContext.create 'active' argument is not a bool. "
f"Converting {active} {type(active)} to bool.")
active = bool(active)
instance_data["active"] = active
return creator.create(
product_name,