-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor(eos_designs): Various optimizations for speed (#1355)
- Loading branch information
1 parent
49bb10f
commit a8fa1c4
Showing
18 changed files
with
82 additions
and
84 deletions.
There are no files selected for viewing
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
5 changes: 3 additions & 2 deletions
5
...ons/arista/avd/roles/eos_cli_config_gen/templates/upgrade/overload-upgraded-data-model.j2
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
14 changes: 8 additions & 6 deletions
14
ansible_collections/arista/avd/roles/eos_designs/templates/facts/switch/logic.j2
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,18 +1,20 @@ | ||
{% if inventory_hostname in hostvars[inventory_hostname][switch.node_type_key].nodes | arista.avd.default([]) %} | ||
{% set switch_data.node = hostvars[inventory_hostname][switch.node_type_key].nodes[inventory_hostname] %} | ||
{% set node_type_vars = hostvars[inventory_hostname][switch.node_type_key] | arista.avd.default %} | ||
{% if inventory_hostname in node_type_vars.nodes | arista.avd.default([]) %} | ||
{% set switch_data.node = node_type_vars.nodes[inventory_hostname] %} | ||
{% set switch_data.node_group = {} %} | ||
{% endif %} | ||
{% if switch_data.node is not arista.avd.defined %} | ||
{% for node_group in hostvars[inventory_hostname][switch.node_type_key].node_groups | arista.avd.default([]) %} | ||
{% if inventory_hostname in hostvars[inventory_hostname][switch.node_type_key].node_groups[node_group].nodes | arista.avd.default([]) %} | ||
{% set switch_data.node_group = hostvars[inventory_hostname][switch.node_type_key].node_groups[node_group] %} | ||
{% set tmp_node_groups = node_type_vars.node_groups | arista.avd.default([]) %} | ||
{% for node_group in tmp_node_groups %} | ||
{% if inventory_hostname in tmp_node_groups[node_group].nodes | arista.avd.default([]) %} | ||
{% set switch_data.node_group = tmp_node_groups[node_group] %} | ||
{% set switch_data.group = node_group %} | ||
{% set switch_data.node = switch_data.node_group.nodes[inventory_hostname] %} | ||
{% break %} | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
{% if switch_data.node is arista.avd.defined(fail_action='error',var_name=switch.node_type_key ~ '.(node_groups.)nodes.' ~ inventory_hostname) %} | ||
{% set switch_data.defaults = hostvars[inventory_hostname][switch.node_type_key].defaults | arista.avd.default() %} | ||
{% set switch_data.defaults = node_type_vars.defaults | arista.avd.default() %} | ||
{% endif %} | ||
{% set switch_data.combined = switch_data.defaults | combine(switch_data.node_group, switch_data.node, recursive=true, list_merge='replace') %} |
3 changes: 3 additions & 0 deletions
3
ansible_collections/arista/avd/roles/eos_designs/templates/facts/switch/switch.j2
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
5 changes: 3 additions & 2 deletions
5
...ollections/arista/avd/roles/eos_designs/templates/upgrade/overload-upgraded-data-model.j2
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