Skip to content

Commit

Permalink
Address multiple comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Laxmikant Chintakindi authored and Laxmikant Chintakindi committed Sep 9, 2024
1 parent 06c5de5 commit 10ee5be
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,18 @@
{% set isis_hello_padding = port_channel_interface.isis_hello_padding | arista.avd.default("-") %}
{% if port_channel_interface.isis_authentication_mode is arista.avd.defined %}
{% set isis_authentication_mode = port_channel_interface.isis_authentication_mode %}
{% elif port_channel_interface.isis_authentication.both.mode is arista.avd.defined %}
{% set isis_authentication_mode = port_channel_interface.isis_authentication.both.mode %}
{% elif port_channel_interface.isis_authentication.level_1.mode is arista.avd.defined and port_channel_interface.isis_authentication.level_2.mode is arista.avd.defined %}
{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode ~ "<br>" ~ "Level-2: " ~ port_channel_interface.isis_authentication.level_2.mode %}
{% elif port_channel_interface.isis_authentication.level_1.mode is arista.avd.defined %}
{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode %}
{% elif port_channel_interface.isis_authentication.level_2.mode is arista.avd.defined %}
{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode %}
{% else %}
{% if port_channel_interface.isis_authentication.both.mode is arista.avd.defined %}
{% set isis_authentication_mode = port_channel_interface.isis_authentication.both.mode %}
{% else %}
{% if port_channel_interface.isis_authentication.level_1.mode is arista.avd.defined and port_channel_interface.isis_authentication.level_2.mode is arista.avd.defined %}
{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode ~ "<br>" ~ "Level-2: " ~ port_channel_interface.isis_authentication.level_2.mode %}
{% elif port_channel_interface.isis_authentication.level_1.mode is arista.avd.defined %}
{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode %}
{% elif port_channel_interface.isis_authentication.level_2.mode is arista.avd.defined %}
{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode %}
{% endif %}
{% endif %}
{% endif %}
{% if port_channel_interface.isis_network_point_to_point is arista.avd.defined(true) %}
{% set mode = "point-to-point" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,15 +683,12 @@ interface {{ port_channel_interface.name }}
{% if port_channel_interface.isis_authentication.both.mode is arista.avd.defined
and (port_channel_interface.isis_authentication.both.mode in ["md5", "text"]
or (port_channel_interface.isis_authentication.both.mode == "sha" and port_channel_interface.isis_authentication.both.sha.key_id is arista.avd.defined)
or (port_channel_interface.isis_authentication.both.mode == "shared-secret"
and port_channel_interface.isis_authentication.both.shared_secret.profile is arista.avd.defined
and port_channel_interface.isis_authentication.both.shared_secret.algorithm is arista.avd.defined)) %}
or (port_channel_interface.isis_authentication.both.mode == "shared-secret" and port_channel_interface.isis_authentication.both.shared_secret is arista.avd.defined)) %}
{% set isis_auth_cli = "isis authentication mode " ~ port_channel_interface.isis_authentication.both.mode %}
{% if port_channel_interface.isis_authentication.both.mode == "sha" %}
{% set isis_auth_cli = isis_auth_cli ~ " key-id " ~ port_channel_interface.isis_authentication.both.sha.key_id %}
{% elif port_channel_interface.isis_authentication.both.mode == "shared-secret" %}
{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.both.shared_secret.profile %}
{% set isis_auth_cli = isis_auth_cli ~ " algorithm " ~ port_channel_interface.isis_authentication.both.shared_secret.algorithm %}
{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.both.shared_secret.profile ~ " algorithm " ~ port_channel_interface.isis_authentication.both.shared_secret.algorithm %}
{% endif %}
{% if port_channel_interface.isis_authentication.both.rx_disabled is arista.avd.defined(true) %}
{% set isis_auth_cli = isis_auth_cli ~ " rx-disabled" %}
Expand All @@ -701,15 +698,12 @@ interface {{ port_channel_interface.name }}
{% if port_channel_interface.isis_authentication.level_1.mode is arista.avd.defined
and (port_channel_interface.isis_authentication.level_1.mode in ["md5", "text"]
or (port_channel_interface.isis_authentication.level_1.mode == "sha" and port_channel_interface.isis_authentication.level_1.sha.key_id is arista.avd.defined)
or (port_channel_interface.isis_authentication.level_1.mode == "shared-secret"
and port_channel_interface.isis_authentication.level_1.shared_secret.profile is arista.avd.defined
and port_channel_interface.isis_authentication.level_1.shared_secret.algorithm is arista.avd.defined)) %}
or (port_channel_interface.isis_authentication.level_1.mode == "shared-secret" and port_channel_interface.isis_authentication.level_1.shared_secret is arista.avd.defined)) %}
{% set isis_auth_cli = "isis authentication mode " ~ port_channel_interface.isis_authentication.level_1.mode %}
{% if port_channel_interface.isis_authentication.level_1.mode == "sha" %}
{% set isis_auth_cli = isis_auth_cli ~ " key-id " ~ port_channel_interface.isis_authentication.level_1.sha.key_id %}
{% elif port_channel_interface.isis_authentication.level_1.mode == "shared-secret" %}
{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.level_1.shared_secret.profile %}
{% set isis_auth_cli = isis_auth_cli ~ " algorithm " ~ port_channel_interface.isis_authentication.level_1.shared_secret.algorithm %}
{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.level_1.shared_secret.profile ~ " algorithm " ~ port_channel_interface.isis_authentication.level_1.shared_secret.algorithm %}
{% endif %}
{% if port_channel_interface.isis_authentication.level_1.rx_disabled is arista.avd.defined(true) %}
{% set isis_auth_cli = isis_auth_cli ~ " rx-disabled" %}
Expand All @@ -719,15 +713,12 @@ interface {{ port_channel_interface.name }}
{% if port_channel_interface.isis_authentication.level_2.mode is arista.avd.defined
and (port_channel_interface.isis_authentication.level_2.mode in ["md5", "text"]
or (port_channel_interface.isis_authentication.level_2.mode == "sha" and port_channel_interface.isis_authentication.level_2.sha.key_id is arista.avd.defined)
or (port_channel_interface.isis_authentication.level_2.mode == "shared-secret"
and port_channel_interface.isis_authentication.level_2.shared_secret.profile is arista.avd.defined
and port_channel_interface.isis_authentication.level_2.shared_secret.algorithm is arista.avd.defined)) %}
or (port_channel_interface.isis_authentication.level_2.mode == "shared-secret" and port_channel_interface.isis_authentication.level_2.shared_secret is arista.avd.defined)) %}
{% set isis_auth_cli = "isis authentication mode " ~ port_channel_interface.isis_authentication.level_2.mode %}
{% if port_channel_interface.isis_authentication.level_2.mode == "sha" %}
{% set isis_auth_cli = isis_auth_cli ~ " key-id " ~ port_channel_interface.isis_authentication.level_2.sha.key_id %}
{% elif port_channel_interface.isis_authentication.level_2.mode == "shared-secret" %}
{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.level_2.shared_secret.profile %}
{% set isis_auth_cli = isis_auth_cli ~ " algorithm " ~ port_channel_interface.isis_authentication.level_2.shared_secret.algorithm %}
{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.level_2.shared_secret.profile ~ " algorithm " ~ port_channel_interface.isis_authentication.level_2.shared_secret.algorithm %}
{% endif %}
{% if port_channel_interface.isis_authentication.level_2.rx_disabled is arista.avd.defined(true) %}
{% set isis_auth_cli = isis_auth_cli ~ " rx-disabled" %}
Expand All @@ -739,26 +730,17 @@ interface {{ port_channel_interface.name }}
{% set both_key_ids = [] %}
{% if port_channel_interface.isis_authentication.both.key_ids is arista.avd.defined %}
{% for auth_key in port_channel_interface.isis_authentication.both.key_ids | arista.avd.natural_sort("id") %}
{% if auth_key.id is arista.avd.defined
and auth_key.algorithm is arista.avd.defined
and auth_key.key_type is arista.avd.defined
and auth_key.key is arista.avd.defined %}
{% do both_key_ids.append(auth_key.id) %}
{% if auth_key.rfc_5310 is arista.avd.defined(true) %}
{% do both_key_ids.append(auth_key.id) %}
{% if auth_key.rfc_5310 is arista.avd.defined(true) %}
isis authentication key-id {{ auth_key.id }} algorithm {{ auth_key.algorithm }} rfc-5310 key {{ auth_key.key_type }} {{ auth_key.key }}
{% else %}
{% else %}
isis authentication key-id {{ auth_key.id }} algorithm {{ auth_key.algorithm }} key {{ auth_key.key_type }} {{ auth_key.key }}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% if port_channel_interface.isis_authentication.level_1.key_ids is arista.avd.defined %}
{% for auth_key in port_channel_interface.isis_authentication.level_1.key_ids %}
{% if auth_key.id is arista.avd.defined
and auth_key.id not in both_key_ids
and auth_key.algorithm is arista.avd.defined
and auth_key.key_type is arista.avd.defined
and auth_key.key is arista.avd.defined %}
{% for auth_key in port_channel_interface.isis_authentication.level_1.key_ids | arista.avd.natural_sort("id") %}
{% if auth_key.id not in both_key_ids %}
{% if auth_key.rfc_5310 is arista.avd.defined(true) %}
isis authentication key-id {{ auth_key.id }} algorithm {{ auth_key.algorithm }} rfc-5310 key {{ auth_key.key_type }} {{ auth_key.key }} level-1
{% else %}
Expand All @@ -769,11 +751,7 @@ interface {{ port_channel_interface.name }}
{% endif %}
{% if port_channel_interface.isis_authentication.level_2.key_ids is arista.avd.defined %}
{% for auth_key in port_channel_interface.isis_authentication.level_2.key_ids %}
{% if auth_key.id is arista.avd.defined
and auth_key.id not in both_key_ids
and auth_key.algorithm is arista.avd.defined
and auth_key.key_type is arista.avd.defined
and auth_key.key is arista.avd.defined %}
{% if auth_key.id not in both_key_ids %}
{% if auth_key.rfc_5310 is arista.avd.defined(true) %}
isis authentication key-id {{ auth_key.id }} algorithm {{ auth_key.algorithm }} rfc-5310 key {{ auth_key.key_type }} {{ auth_key.key }} level-2
{% else %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,8 @@ keys:
new_key: port_channel_interfaces[].isis_authentication.both.key or port_channel_interfaces[].isis_authentication.level_1.key or port_channel_interfaces[].isis_authentication.level_2.key
isis_authentication:
type: dict
description: This key should not be mixed with port_channel_interfaces[].isis_authentication_mode or ethernet_interfaces[].isis_authentication_key.
# TODO: AVD 6.0 Update the description
$ref: "eos_cli_config_gen#/keys/router_isis/keys/authentication"
traffic_policy:
type: dict
Expand Down

0 comments on commit 10ee5be

Please sign in to comment.