♻️ move plugin check earlier, fix hints

This commit is contained in:
Ondrej Samohel 2025-11-26 17:34:01 +01:00
parent e6007b2cee
commit 700b025024
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
2 changed files with 13 additions and 11 deletions

View file

@ -759,13 +759,6 @@ class CreateContext:
)
for creator_class in report.plugins:
creator_identifier = creator_class.identifier
if creator_identifier in creators:
self.log.warning(
"Duplicate Creator identifier: '%s'. Using first Creator "
"and skipping: %s", creator_identifier, creator_class
)
continue
if not creator_class.product_base_type:
warn(
f"Provided creator {creator_class!r} doesn't have "
@ -776,6 +769,15 @@ class CreateContext:
)
continue
creator_identifier = creator_class.identifier
if creator_identifier in creators:
self.log.warning(
"Duplicate Creator identifier: '%s'. Using first Creator "
"and skipping: %s", creator_identifier, creator_class
)
continue
# Filter by host name
if (
creator_class.host_name

View file

@ -19,8 +19,8 @@ from .exceptions import TaskNotSetError, TemplateFillError
def get_product_name_template(
project_name: str,
product_type: str,
task_name: str,
task_type: str,
task_name: Optional[str],
task_type: Optional[str],
host_name: str,
default_template: Optional[str] = None,
project_settings: Optional[dict[str, Any]] = None,
@ -33,8 +33,8 @@ def get_product_name_template(
product_type (str): Product type for which the product name is
calculated.
host_name (str): Name of host in which the product name is calculated.
task_name (str): Name of task in which context the product is created.
task_type (str): Type of task in which context the product is created.
task_name (Optional[str]): Name of task in which context the product is created.
task_type (Optional[str]): Type of task in which context the product is created.
default_template (Optional[str]): Default template which is used if
settings won't find any matching possibility. Constant
'DEFAULT_PRODUCT_TEMPLATE' is used if not defined.