diff --git a/ansible_collections/arista/avd/docs/porting-guides/5.x.x.md b/ansible_collections/arista/avd/docs/porting-guides/5.x.x.md index a80fab3da0a..ea09f61c988 100644 --- a/ansible_collections/arista/avd/docs/porting-guides/5.x.x.md +++ b/ansible_collections/arista/avd/docs/porting-guides/5.x.x.md @@ -60,7 +60,7 @@ The following data model keys have been removed from `eos_designs` in v5.0.0. | old key 3.2(defs_node_type) | new key(TODO) | | [].vrfs[].svis[].ipv6_address_virtual | [].vrfs[].svis[].ipv6_address_virtuals | | svi_profiles[].ipv6_address_virtual | svi_profiles[].ipv6_address_virtuals | -| old key 5(ptp) | new key(TODO) | +| ptp | ptp_settings | ## Changes to role `arista.avd.eos_cli_config_gen` diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host1.cfg index 7a8859f0227..00a313d3f00 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/configs/host1.cfg @@ -8,19 +8,6 @@ service routing protocols model multi-agent ! hostname host1 ! -ptp clock-identity 00:1C:73:1e:00:65 -ptp priority1 30 -ptp priority2 101 -ptp domain 127 -ptp mode boundary -ptp monitor threshold offset-from-master 250 -ptp monitor threshold mean-path-delay 1500 -ptp monitor sequence-id -ptp monitor threshold missing-message announce 3 sequence-ids -ptp monitor threshold missing-message delay-resp 3 sequence-ids -ptp monitor threshold missing-message follow-up 3 sequence-ids -ptp monitor threshold missing-message sync 3 sequence-ids -! no enable password no aaa root ! diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host1.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host1.yml index 4e130128fd5..7b34a2f7824 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/intended/structured_configs/host1.yml @@ -50,24 +50,6 @@ management_api_http: enable_vrfs: - name: MGMT enable_https: true -ptp: - mode: boundary - clock_identity: 00:1C:73:1e:00:65 - priority1: 30 - priority2: 101 - domain: 127 - monitor: - enabled: true - threshold: - offset_from_master: 250 - mean_path_delay: 1500 - missing_message: - sequence_ids: - enabled: true - announce: 3 - delay_resp: 3 - follow_up: 3 - sync: 3 loopback_interfaces: - name: Loopback0 description: EVPN_Overlay_Peering diff --git a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host1/ptp.yml b/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host1/ptp.yml deleted file mode 100644 index 21a74a82ef5..00000000000 --- a/ansible_collections/arista/avd/molecule/eos_designs_deprecated_vars/inventory/host_vars/host1/ptp.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -ptp_settings: - enabled: true - auto_clock_identity: true diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/ptp_settings.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/ptp_settings.md index f2ac6b485a7..e4b2e42c958 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/ptp_settings.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/ptp_settings.md @@ -7,11 +7,7 @@ | Variable | Type | Required | Default | Value Restrictions | Description | | -------- | ---- | -------- | ------- | ------------------ | ----------- | - | [ptp](## "ptp") deprecated | Dictionary | | | | This key is deprecated. Support will be removed in AVD version v5.0.0. Use ptp_settings instead. | - | [  enabled](## "ptp.enabled") | Boolean | | | | | - | [  profile](## "ptp.profile") | String | | `aes67-r16-2016` | Valid Values:
- aes67
- smpte2059-2
- aes67-r16-2016 | | - | [  domain](## "ptp.domain") | Integer | | | Min: 0
Max: 255 | | - | [  auto_clock_identity](## "ptp.auto_clock_identity") | Boolean | | `True` | | | + | [ptp](## "ptp") removed | Dictionary | | | | This key was removed. Support was removed in AVD version v5.0.0. Use ptp_settings instead. | | [ptp_profiles](## "ptp_profiles") | List, items: Dictionary | | See (+) on YAML tab | | | | [  - profile](## "ptp_profiles.[].profile") | String | | | | PTP profile. | | [    announce](## "ptp_profiles.[].announce") | Dictionary | | | | PTP announce interval. | @@ -21,7 +17,7 @@ | [    sync_message](## "ptp_profiles.[].sync_message") | Dictionary | | | | PTP sync message interval. | | [      interval](## "ptp_profiles.[].sync_message.interval") | Integer | | | Min: -7
Max: 3 | | | [    transport](## "ptp_profiles.[].transport") | String | | | Valid Values:
- ipv4 | | - | [ptp_settings](## "ptp_settings") | Dictionary | | | | Common PTP settings.
`ptp_settings` replaces the old `ptp` key. `ptp_settings` takes precedence. | + | [ptp_settings](## "ptp_settings") | Dictionary | | | | Common PTP settings. | | [  enabled](## "ptp_settings.enabled") | Boolean | | | | | | [  profile](## "ptp_settings.profile") | String | | `aes67-r16-2016` | Valid Values:
- aes67
- smpte2059-2
- aes67-r16-2016 | | | [  domain](## "ptp_settings.domain") | Integer | | | Min: 0
Max: 255 | | @@ -30,14 +26,6 @@ === "YAML" ```yaml - # This key is deprecated. - # Support will be removed in AVD version v5.0.0. - # Use ptp_settings instead. - ptp: - enabled: - profile: - domain: - auto_clock_identity: ptp_profiles: # (1)! # PTP profile. @@ -55,7 +43,6 @@ transport: # Common PTP settings. - # `ptp_settings` replaces the old `ptp` key. `ptp_settings` takes precedence. ptp_settings: enabled: profile: diff --git a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml index a7cf9bc12be..e5ae3478758 100644 --- a/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml @@ -3169,27 +3169,12 @@ keys: ptp: deprecation: warning: true + removed: true new_key: ptp_settings remove_in_version: v5.0.0 documentation_options: table: ptp_settings type: dict - keys: - enabled: - type: bool - profile: - type: str - valid_values: - - aes67 - - smpte2059-2 - - aes67-r16-2016 - default: aes67-r16-2016 - domain: - type: int - $ref: eos_cli_config_gen#/keys/ptp/keys/domain - auto_clock_identity: - type: bool - default: true ptp_profiles: documentation_options: table: ptp_settings @@ -3265,9 +3250,7 @@ keys: documentation_options: table: ptp_settings type: dict - description: 'Common PTP settings. - - `ptp_settings` replaces the old `ptp` key. `ptp_settings` takes precedence.' + description: Common PTP settings. keys: enabled: type: bool diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/ptp.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/ptp.schema.yml index 50a26bd1f58..b8204a15666 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/ptp.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/ptp.schema.yml @@ -9,24 +9,9 @@ keys: ptp: deprecation: warning: true + removed: true new_key: 'ptp_settings' remove_in_version: v5.0.0 documentation_options: table: ptp_settings type: dict - keys: - enabled: - type: bool - profile: - type: str - valid_values: - - "aes67" - - "smpte2059-2" - - "aes67-r16-2016" - default: "aes67-r16-2016" - domain: - type: int - $ref: "eos_cli_config_gen#/keys/ptp/keys/domain" - auto_clock_identity: - type: bool - default: true diff --git a/python-avd/pyavd/_eos_designs/schema/schema_fragments/ptp_settings.schema.yml b/python-avd/pyavd/_eos_designs/schema/schema_fragments/ptp_settings.schema.yml index 305db7f4526..281b56dc732 100644 --- a/python-avd/pyavd/_eos_designs/schema/schema_fragments/ptp_settings.schema.yml +++ b/python-avd/pyavd/_eos_designs/schema/schema_fragments/ptp_settings.schema.yml @@ -10,10 +10,7 @@ keys: documentation_options: table: ptp_settings type: dict - # TODO AVD5.0: Update description to not mention ptp key. - description: |- - Common PTP settings. - `ptp_settings` replaces the old `ptp` key. `ptp_settings` takes precedence. + description: Common PTP settings. keys: enabled: type: bool diff --git a/python-avd/pyavd/_eos_designs/shared_utils/ptp.py b/python-avd/pyavd/_eos_designs/shared_utils/ptp.py index 25ebb511724..4c5f1c15af1 100644 --- a/python-avd/pyavd/_eos_designs/shared_utils/ptp.py +++ b/python-avd/pyavd/_eos_designs/shared_utils/ptp.py @@ -6,7 +6,7 @@ from functools import cached_property from typing import TYPE_CHECKING -from pyavd._utils import default, get, get_item +from pyavd._utils import get, get_item if TYPE_CHECKING: from . import SharedUtils @@ -55,7 +55,7 @@ class PtpMixin: @cached_property def ptp_enabled(self: SharedUtils) -> bool: - default_ptp_enabled = default(get(self.hostvars, "ptp_settings.enabled"), get(self.hostvars, "ptp.enabled")) + default_ptp_enabled = get(self.hostvars, "ptp_settings.enabled") return get(self.switch_data_combined, "ptp.enabled", default=default_ptp_enabled) is True @cached_property @@ -64,7 +64,7 @@ def ptp_mlag(self: SharedUtils) -> bool: @cached_property def ptp_profile_name(self: SharedUtils) -> str: - default_ptp_profile = default(get(self.hostvars, "ptp_settings.profile"), get(self.hostvars, "ptp.profile"), "aes67-r16-2016") + default_ptp_profile = get(self.hostvars, "ptp_settings.profile", default="aes67-r16-2016") return get(self.switch_data_combined, "ptp.profile", default_ptp_profile) @cached_property diff --git a/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py b/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py index 95b7ff9581a..3bf47f92aa1 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py +++ b/python-avd/pyavd/_eos_designs/structured_config/base/__init__.py @@ -7,7 +7,7 @@ from pyavd._eos_designs.avdfacts import AvdFacts from pyavd._errors import AristaAvdMissingVariableError -from pyavd._utils import default, get, strip_null_from_data +from pyavd._utils import get, strip_null_from_data from pyavd.j2filters import convert_dicts, natural_sort from .ntp import NtpMixin @@ -594,13 +594,8 @@ def ptp(self) -> dict | None: default_priority2 = self.id % 256. """ if not self.shared_utils.ptp_enabled: - # Since we have overlapping data model "ptp" between eos_designs and eos_cli_config_gen, - # we need to overwrite the input dict if set but not enabled. - # TODO: AVD5.0.0 Remove this handling since the `ptp` key is removed from eos_designs. - if get(self._hostvars, "ptp") is not None: - return {} return None - default_ptp_domain = default(get(self._hostvars, "ptp_settings.domain"), get(self._hostvars, "ptp.domain"), 127) + default_ptp_domain = get(self._hostvars, "ptp_settings.domain", default=127) default_ptp_priority1 = get(self.shared_utils.node_type_key_data, "default_ptp_priority1", default=127) default_clock_identity = None @@ -612,11 +607,7 @@ def ptp(self) -> dict | None: raise AristaAvdMissingVariableError(msg) priority2 = self.shared_utils.id % 256 - default_auto_clock_identity = default( - get(self._hostvars, "ptp_settings.auto_clock_identity"), - get(self._hostvars, "ptp.auto_clock_identity"), - True, # noqa: FBT003 - ) + default_auto_clock_identity = get(self._hostvars, "ptp_settings.auto_clock_identity", default=True) if get(self.shared_utils.switch_data_combined, "ptp.auto_clock_identity", default=default_auto_clock_identity) is True: clock_identity_prefix = get(self.shared_utils.switch_data_combined, "ptp.clock_identity_prefix", default="00:1C:73") default_clock_identity = f"{clock_identity_prefix}:{priority1:02x}:00:{priority2:02x}"