From 7ca118c2c726eb5a22bbf9e3c7668df94f2bbf21 Mon Sep 17 00:00:00 2001 From: laxmikantchintakindi <159624484+laxmikantchintakindi@users.noreply.github.com> Date: Wed, 31 Jul 2024 20:41:02 +0530 Subject: [PATCH] Cut(eos_cli_config_gen): Remove deprecated key MIB_family_name from snmp_server data model (#4289) --- .../arista/avd/docs/porting-guides/5.x.x.md | 2 +- .../documentation/devices/host1.md | 4 ++-- .../intended/configs/host1.cfg | 2 +- .../host_vars/host1/{snmp-server.yml => snmp_server.yml} | 3 --- .../roles/eos_cli_config_gen/docs/tables/snmp-server.md | 6 +----- .../eos_designs/docs/tables/management-snmp-settings.md | 6 +----- .../j2templates/documentation/snmp-server.j2 | 2 +- .../_eos_cli_config_gen/j2templates/eos/snmp-server.j2 | 4 ++-- .../schema/eos_cli_config_gen.jsonschema.json | 4 ---- .../schema/eos_cli_config_gen.schema.yml | 1 + .../schema/schema_fragments/snmp_server.schema.yml | 1 + .../pyavd/_eos_designs/schema/eos_designs.jsonschema.json | 8 -------- 12 files changed, 11 insertions(+), 32 deletions(-) rename ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/inventory/host_vars/host1/{snmp-server.yml => snmp_server.yml} (81%) 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 ff3ea4f9786..9c9d83fc392 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 @@ -81,7 +81,7 @@ The following data model keys have been removed from `eos_cli_config_gen` in v5. | old key 9.6(router_bgp) | new key(TODO) | | old key 10.1(router_isis) | new key(TODO) | | old key 10.2(router_isis) | new key(TODO) | -| old key 11(snmp_server) | new key(TODO) | +| snmp_server.views.MIB_family_name | snmp_server.views.mib_family_name | | stun.server.local_interface | stun.server.local_interfaces | | old key 13.1(vlan_interfaces) | new key(TODO) | | old key 13.2(vlan_interfaces) | new key(TODO) | diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/documentation/devices/host1.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/documentation/devices/host1.md index 01bf750d24b..1d2e38d8cdd 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/documentation/devices/host1.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/documentation/devices/host1.md @@ -348,7 +348,7 @@ logging policy match match-list molecule discard | View | MIB Family Name | Status | | ---- | --------------- | ------ | -| VW-WRITE | iso | Included | +| VW-WRITE | - | Included | #### SNMP Communities @@ -365,7 +365,7 @@ logging policy match match-list molecule discard snmp-server vrf MGMT local-interface Management1 snmp-server local-interface Loopback0 snmp-server vrf Tenant_A_APP_Zone local-interface Loopback12 -snmp-server view VW-WRITE iso included +snmp-server view VW-WRITE included snmp-server community ro onur snmp-server community view VW-READ rw ipv6 SNMP-MGMT SNMP-MGMT snmp-server community ro diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/intended/configs/host1.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/intended/configs/host1.cfg index d0a1384c70a..4e52920d060 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/intended/configs/host1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/intended/configs/host1.cfg @@ -83,7 +83,7 @@ qos profile test snmp-server vrf MGMT local-interface Management1 snmp-server local-interface Loopback0 snmp-server vrf Tenant_A_APP_Zone local-interface Loopback12 -snmp-server view VW-WRITE iso included +snmp-server view VW-WRITE included snmp-server community SNMP-COMMUNITY-1 ro onur snmp-server community SNMP-COMMUNITY-2 view VW-READ rw ipv6 SNMP-MGMT SNMP-MGMT snmp-server community SNMP-COMMUNITY-3 ro diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/inventory/host_vars/host1/snmp-server.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/inventory/host_vars/host1/snmp_server.yml similarity index 81% rename from ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/inventory/host_vars/host1/snmp-server.yml rename to ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/inventory/host_vars/host1/snmp_server.yml index f1b08d5f661..0139b7b9203 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/inventory/host_vars/host1/snmp-server.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen_deprecated_vars/inventory/host_vars/host1/snmp_server.yml @@ -26,7 +26,4 @@ snmp_server: vrf: Tenant_A_APP_Zone views: - name: VW-WRITE - # Testing deprecated upper-case key name - # Deprecated in 4.0.0 in favor of lower case variant. To be removed in 5.0.0 - MIB_family_name: iso included: true diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/snmp-server.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/snmp-server.md index e52676691f2..f0f48faa2e6 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/snmp-server.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/snmp-server.md @@ -37,7 +37,7 @@ | [    - name](## "snmp_server.views.[].name") | String | | | | SNMP view name. | | [      mib_family_name](## "snmp_server.views.[].mib_family_name") | String | | | | | | [      included](## "snmp_server.views.[].included") | Boolean | | | | | - | [      MIB_family_name](## "snmp_server.views.[].MIB_family_name") deprecated | String | | | | This key is deprecated. Support will be removed in AVD version 5.0.0. Use mib_family_name instead. | + | [      MIB_family_name](## "snmp_server.views.[].MIB_family_name") removed | String | | | | This key was removed. Support was removed in AVD version 5.0.0. Use mib_family_name instead. | | [  groups](## "snmp_server.groups") | List, items: Dictionary | | | | | | [    - name](## "snmp_server.groups.[].name") | String | | | | Group name. | | [      version](## "snmp_server.groups.[].version") | String | | | Valid Values:
- v1
- v2c
- v3 | | @@ -131,10 +131,6 @@ - name: mib_family_name: included: - # This key is deprecated. - # Support will be removed in AVD version 5.0.0. - # Use mib_family_name instead. - MIB_family_name: groups: # Group name. diff --git a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/management-snmp-settings.md b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/management-snmp-settings.md index 8f05174533a..fbbd409172a 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/docs/tables/management-snmp-settings.md +++ b/ansible_collections/arista/avd/roles/eos_designs/docs/tables/management-snmp-settings.md @@ -54,7 +54,7 @@ | [    - name](## "snmp_settings.views.[].name") | String | | | | SNMP view name. | | [      mib_family_name](## "snmp_settings.views.[].mib_family_name") | String | | | | | | [      included](## "snmp_settings.views.[].included") | Boolean | | | | | - | [      MIB_family_name](## "snmp_settings.views.[].MIB_family_name") deprecated | String | | | | This key is deprecated. Support will be removed in AVD version 5.0.0. Use mib_family_name instead. | + | [      MIB_family_name](## "snmp_settings.views.[].MIB_family_name") removed | String | | | | This key was removed. Support was removed in AVD version 5.0.0. Use mib_family_name instead. | | [  groups](## "snmp_settings.groups") | List, items: Dictionary | | | | | | [    - name](## "snmp_settings.groups.[].name") | String | | | | Group name. | | [      version](## "snmp_settings.groups.[].version") | String | | | Valid Values:
- v1
- v2c
- v3 | | @@ -186,10 +186,6 @@ - name: mib_family_name: included: - # This key is deprecated. - # Support will be removed in AVD version 5.0.0. - # Use mib_family_name instead. - MIB_family_name: groups: # Group name. diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/snmp-server.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/snmp-server.j2 index f74131222f9..0d14418810d 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/snmp-server.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/snmp-server.j2 @@ -119,7 +119,7 @@ | ---- | --------------- | ------ | {% for view in snmp_server.views %} {% set row_view = view.name | arista.avd.default('default') %} -{% set row_mib_family_name = view.mib_family_name | arista.avd.default(view.MIB_family_name, '-') %} +{% set row_mib_family_name = view.mib_family_name | arista.avd.default('-') %} {% if view.included | arista.avd.default(false) %} {% set row_status = 'Included' %} {% else %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/snmp-server.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/snmp-server.j2 index 70227d902a4..041a2eb5315 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/snmp-server.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/snmp-server.j2 @@ -60,8 +60,8 @@ snmp-server location {{ snmp_server.location }} {% if view.name is arista.avd.defined %} {% set view_cli = "snmp-server view " ~ view.name %} {% endif %} -{% if view.mib_family_name | arista.avd.default(view.MIB_family_name) is arista.avd.defined %} -{% set view_cli = view_cli ~ " " ~ view.mib_family_name | arista.avd.default(view.MIB_family_name) %} +{% if view.mib_family_name is arista.avd.defined %} +{% set view_cli = view_cli ~ " " ~ view.mib_family_name %} {% endif %} {% if view.included is arista.avd.defined(true) %} {% set view_cli = view_cli ~ " included" %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.jsonschema.json b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.jsonschema.json index 51268abe332..f661f43256e 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.jsonschema.json +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.jsonschema.json @@ -28142,10 +28142,6 @@ "included": { "type": "boolean", "title": "Included" - }, - "MIB_family_name": { - "type": "string", - "title": "MIB Family Name" } }, "additionalProperties": false, diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index ed5e61fe359..4d734281127 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -16689,6 +16689,7 @@ keys: MIB_family_name: deprecation: warning: true + removed: true remove_in_version: 5.0.0 new_key: mib_family_name type: str diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/snmp_server.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/snmp_server.schema.yml index 0ade14374c7..362197c8c10 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/snmp_server.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/snmp_server.schema.yml @@ -126,6 +126,7 @@ keys: MIB_family_name: deprecation: warning: true + removed: true remove_in_version: 5.0.0 new_key: mib_family_name type: str diff --git a/python-avd/pyavd/_eos_designs/schema/eos_designs.jsonschema.json b/python-avd/pyavd/_eos_designs/schema/eos_designs.jsonschema.json index 3bea5a036df..41cf4a89a56 100644 --- a/python-avd/pyavd/_eos_designs/schema/eos_designs.jsonschema.json +++ b/python-avd/pyavd/_eos_designs/schema/eos_designs.jsonschema.json @@ -46161,10 +46161,6 @@ "included": { "type": "boolean", "title": "Included" - }, - "MIB_family_name": { - "type": "string", - "title": "MIB Family Name" } }, "additionalProperties": false, @@ -56486,10 +56482,6 @@ "included": { "type": "boolean", "title": "Included" - }, - "MIB_family_name": { - "type": "string", - "title": "MIB Family Name" } }, "additionalProperties": false,