This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev-uxmt: Fix discovered migration flow issues (#756)
* Static IP address with device specific value converted to dynamic IP address #67 * Migration Feature Template with IPSec route fails #60 * KeyError: 'aggregate_only' during Cisco VPN feature template migration #59 * Constant value convernted to variable value for integrity-type from Cisco Secuirty feature template #58 * Incorrect value for static IPv4 address after migration to ux2 #57 * Fix imports * Fix: entire lan ethernet interface. fix attribute error when checking for vpn id value * Fix whitespace * Minor fixes * Support banner and snmp * fix: asPath parameter and conversion for Route Policy * bump version --------- Co-authored-by: Szymon Basan <[email protected]>
- Loading branch information
1 parent
82abf3f
commit 121ba1d
Showing
25 changed files
with
510 additions
and
222 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
catalystwan/utils/config_migration/converters/feature_template/helpers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
# Copyright 2024 Cisco Systems, Inc. and its affiliates | ||
from typing import Optional, Type, TypeVar, Union | ||
|
||
from catalystwan.api.configuration_groups.parcel import Global, OptionType, Variable | ||
|
||
T = TypeVar("T") | ||
|
||
|
||
def create_dict_without_none(**kwargs) -> dict: | ||
"""Create a dictionary without None values. | ||
This speeds up the converting because we don't need to check for None values. | ||
If pydantic model input doesn't have a key:value pair, it will use a default value.""" | ||
return {k: v for k, v in kwargs.items() if v is not None} | ||
|
||
|
||
def return_global_variable_or_none( | ||
data: dict, key: str, global_type: Type[Global[T]] | ||
) -> Optional[Union[Global[T], Variable]]: | ||
"""Return a Global or Variable object from the data dictionary or None if the key doesn't exist.""" | ||
value = data.get(key) | ||
if value is None: | ||
return None | ||
return global_type(value=value.value) if value.option_type == OptionType.GLOBAL else value |
Oops, something went wrong.