diff --git a/tmt/config/models/__init__.py b/tmt/config/models/__init__.py index 6a1635216f..0db7b43327 100644 --- a/tmt/config/models/__init__.py +++ b/tmt/config/models/__init__.py @@ -1,13 +1,10 @@ from tmt._compat.pydantic import BaseModel, Extra - - -def create_alias(name: str) -> str: - return name.replace('_', '-') +from tmt.utils import key_to_option class BaseConfig(BaseModel): class Config: # Accept only keys with dashes instead of underscores - alias_generator = create_alias + alias_generator = key_to_option extra = Extra.forbid validate_assignment = True