Skip to content

Commit

Permalink
Making schema 1:1 and changing code accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
Vibhu-gslab committed Jan 3, 2025
1 parent 56e5e42 commit 1043e6d
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ router_id_loopback_description: "MY_ROUTER_ID_LOOPBACK"
vtep_vvtep_ip: 192.168.255.255/32

# Testing event_monitor
event_monitor: true
event_monitor:
enabled: true

# Testing load_interval_default
load_interval_default: 6
load_interval:
default: 6

# Testing unsupported_transceiver
unsupported_transceiver:
Expand Down

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

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

24 changes: 16 additions & 8 deletions python-avd/pyavd/_eos_designs/schema/__init__.py

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

10 changes: 5 additions & 5 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 @@ -7,4 +7,5 @@
type: dict
keys:
event_monitor:
type: bool
type: dict
$ref: "eos_cli_config_gen#/keys/event_monitor"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# Use Ctrl + Space to get suggestions for every field. Autocomplete will pop up after typing 2 letters.
type: dict
keys:
load_interval_default:
type: int
convert_types:
- str
load_interval:
type: dict
$ref: "eos_cli_config_gen#/keys/load_interval"
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def transceiver_qsfp_default_mode_4x10(self) -> bool:
@cached_property
def event_monitor(self) -> dict | None:
"""event_monitor set based on event_monitor data-model."""
if get(self._hostvars, "event_monitor") is True:
if get(self._hostvars, "event_monitor.enabled") is True:
return {"enabled": True}
return None

Expand All @@ -352,7 +352,7 @@ def event_handlers(self) -> list | None:
@cached_property
def load_interval(self) -> dict | None:
"""load_interval set based on load_interval_default variable."""
if (load_interval_default := get(self._hostvars, "load_interval_default")) is not None:
if (load_interval_default := get(self._hostvars, "load_interval.default")) is not None:
return {"default": load_interval_default}
return None

Expand Down

0 comments on commit 1043e6d

Please sign in to comment.