diff --git a/catalystwan/utils/config_migration/converters/feature_template/aaa.py b/catalystwan/utils/config_migration/converters/feature_template/aaa.py index 93cb451e..88c5c8f0 100644 --- a/catalystwan/utils/config_migration/converters/feature_template/aaa.py +++ b/catalystwan/utils/config_migration/converters/feature_template/aaa.py @@ -5,6 +5,8 @@ class AAATemplateConverter: + supported_template_types = ("cisco_aaa", "cedge_aaa", "aaa") + @staticmethod def create_parcel(name: str, description: str, template_values: dict) -> AAAParcel: """ diff --git a/catalystwan/utils/config_migration/converters/feature_template/banner.py b/catalystwan/utils/config_migration/converters/feature_template/banner.py index 7f2b6727..e7a061e1 100644 --- a/catalystwan/utils/config_migration/converters/feature_template/banner.py +++ b/catalystwan/utils/config_migration/converters/feature_template/banner.py @@ -2,6 +2,8 @@ class BannerTemplateConverter: + supported_template_types = ("cisco_banner",) + @staticmethod def create_parcel(name: str, description: str, template_values: dict) -> BannerParcel: """ diff --git a/catalystwan/utils/config_migration/converters/feature_template/basic.py b/catalystwan/utils/config_migration/converters/feature_template/basic.py index fac69f60..eb0d5e6a 100644 --- a/catalystwan/utils/config_migration/converters/feature_template/basic.py +++ b/catalystwan/utils/config_migration/converters/feature_template/basic.py @@ -4,6 +4,8 @@ class SystemToBasicTemplateConverter: + supported_template_types = ("cisco_system", "system-vsmart", "system-vedge") + @staticmethod def create_parcel(name: str, description: str, template_values: dict) -> BasicParcel: """ diff --git a/catalystwan/utils/config_migration/converters/feature_template/bfd.py b/catalystwan/utils/config_migration/converters/feature_template/bfd.py index ce1b6711..2a7cd1e0 100644 --- a/catalystwan/utils/config_migration/converters/feature_template/bfd.py +++ b/catalystwan/utils/config_migration/converters/feature_template/bfd.py @@ -2,6 +2,8 @@ class BFDTemplateConverter: + supported_template_types = ("cisco_bfd",) + @staticmethod def create_parcel(name: str, description: str, template_values: dict) -> BFDParcel: """ diff --git a/catalystwan/utils/config_migration/converters/feature_template/factory_method.py b/catalystwan/utils/config_migration/converters/feature_template/factory_method.py index b09223ea..78a0684f 100644 --- a/catalystwan/utils/config_migration/converters/feature_template/factory_method.py +++ b/catalystwan/utils/config_migration/converters/feature_template/factory_method.py @@ -20,21 +20,20 @@ logger = logging.getLogger(__name__) -# TODO: Move tuples inside of template converter classes then assamble them here -supported_parcel_converters: Dict[Any, FeatureTemplateConverter] = { - ("cisco_aaa", "cedge_aaa", "aaa"): AAATemplateConverter, # type: ignore[dict-item] - ("cisco_bfd",): BFDTemplateConverter, # type: ignore[dict-item] - ("cisco_logging", "logging"): LoggingTemplateConverter, # type: ignore[dict-item] - ( - "cisco_security", - "security", - "security-vsmart", - "security-vedge", - ): SecurityTemplateConverter, # type: ignore[dict-item] - ("cisco_omp", "omp-vedge", "omp-vsmart"): OMPTemplateConverter, - ("cedge_global",): GlobalTemplateConverter, - ("cisco_banner",): BannerTemplateConverter, - ("cisco_system", "system-vsmart", "system-vedge"): SystemToBasicTemplateConverter, +available_converters = [ + AAATemplateConverter, + BannerTemplateConverter, + SecurityTemplateConverter, + SystemToBasicTemplateConverter, + BFDTemplateConverter, + GlobalTemplateConverter, + LoggingTemplateConverter, + OMPTemplateConverter, +] + + +supported_parcel_converters: Dict[Any, Any] = { + converter.supported_template_types: converter for converter in available_converters # type: ignore } diff --git a/catalystwan/utils/config_migration/converters/feature_template/global_.py b/catalystwan/utils/config_migration/converters/feature_template/global_.py index 0204c83c..bbc97b4b 100644 --- a/catalystwan/utils/config_migration/converters/feature_template/global_.py +++ b/catalystwan/utils/config_migration/converters/feature_template/global_.py @@ -2,6 +2,8 @@ class GlobalTemplateConverter: + supported_template_types = ("cedge_global",) + @staticmethod def create_parcel(name: str, description: str, template_values: dict) -> GlobalParcel: """ diff --git a/catalystwan/utils/config_migration/converters/feature_template/logging_.py b/catalystwan/utils/config_migration/converters/feature_template/logging_.py index 2223ff2f..0796a05e 100644 --- a/catalystwan/utils/config_migration/converters/feature_template/logging_.py +++ b/catalystwan/utils/config_migration/converters/feature_template/logging_.py @@ -6,6 +6,8 @@ class LoggingTemplateConverter: + supported_template_types = ("cisco_logging", "logging") + @staticmethod def create_parcel(name: str, description: str, template_values: dict) -> LoggingParcel: """ diff --git a/catalystwan/utils/config_migration/converters/feature_template/omp.py b/catalystwan/utils/config_migration/converters/feature_template/omp.py index 9ad6015e..4070a342 100644 --- a/catalystwan/utils/config_migration/converters/feature_template/omp.py +++ b/catalystwan/utils/config_migration/converters/feature_template/omp.py @@ -3,6 +3,8 @@ class OMPTemplateConverter: + supported_template_types = ("cisco_omp", "omp-vedge", "omp-vsmart") + @staticmethod def create_parcel(name: str, description: str, template_values: dict) -> OMPParcel: """ diff --git a/catalystwan/utils/config_migration/converters/feature_template/security.py b/catalystwan/utils/config_migration/converters/feature_template/security.py index edd8d237..94f0d0aa 100644 --- a/catalystwan/utils/config_migration/converters/feature_template/security.py +++ b/catalystwan/utils/config_migration/converters/feature_template/security.py @@ -6,6 +6,13 @@ class SecurityTemplateConverter: + supported_template_types = ( + "cisco_security", + "security", + "security-vsmart", + "security-vedge", + ) + @staticmethod def create_parcel(name: str, description: str, template_values: dict) -> SecurityParcel: """