Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cut(eos_designs): Remove deprecated ptp data model #4316

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
| <network_services_key>[].vrfs[].svis[].ipv6_address_virtual | <network_services_key>[].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`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 2 additions & 19 deletions python-avd/pyavd/_eos_designs/schema/eos_designs.schema.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions python-avd/pyavd/_eos_designs/shared_utils/ptp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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}"
Expand Down
Loading