Filter out switch port descriptions on Ruckus switches

Some Ruckus switches, e.g. the Ruckus ICX 7150, advertise switch
interface names as switch port descriptions. Unlike Dell switches, there
is no space character between port type and port number. For example:
GigabitEthernet1/1/9.

Update regular expression to match both styles.

Change-Id: I359b07abadc8665ff0a8c3407ca0fc5effc504cf
Story: 2007532
Task: 39343
This commit is contained in:
Pierre Riteau 2020-04-09 08:35:45 +02:00
parent 7110477bcb
commit 010681d7d9
2 changed files with 14 additions and 7 deletions

View File

@ -194,24 +194,25 @@ inspector_rule_lldp_switch_port_desc_to_name:
op: "is-empty" op: "is-empty"
invert: True invert: True
# Filter out switch port descriptions using the switch's interface names. # Filter out switch port descriptions using the switch's interface names.
# On some switches (including Dell Network OS 9.10(0.1)), the port # On some switches (including Dell Network OS 9.10(0.1) and some Ruckus
# description TLV is sent but contains the interface name rather than the # switches), the port description TLV is sent but contains the interface
# interface's description. # name rather than the interface's description. Dell switches use a space
# character between port type and port number, while Ruckus switches don't.
- field: "data://all_interfaces.{{inspector_rule_var_lldp_switch_port_interface}}.lldp_processed.switch_port_description" - field: "data://all_interfaces.{{inspector_rule_var_lldp_switch_port_interface}}.lldp_processed.switch_port_description"
op: "matches" op: "matches"
value: "^GigabitEthernet ([0-9/]*)$" value: "^GigabitEthernet ?([0-9/]*)$"
invert: True invert: True
- field: "data://all_interfaces.{{inspector_rule_var_lldp_switch_port_interface}}.lldp_processed.switch_port_description" - field: "data://all_interfaces.{{inspector_rule_var_lldp_switch_port_interface}}.lldp_processed.switch_port_description"
op: "matches" op: "matches"
value: "^TenGigabitEthernet ([0-9/]*)$" value: "^TenGigabitEthernet ?([0-9/]*)$"
invert: True invert: True
- field: "data://all_interfaces.{{inspector_rule_var_lldp_switch_port_interface}}.lldp_processed.switch_port_description" - field: "data://all_interfaces.{{inspector_rule_var_lldp_switch_port_interface}}.lldp_processed.switch_port_description"
op: "matches" op: "matches"
value: "^fortyGigE ([0-9/]*)$" value: "^fortyGigE ?([0-9/]*)$"
invert: True invert: True
- field: "data://all_interfaces.{{inspector_rule_var_lldp_switch_port_interface}}.lldp_processed.switch_port_description" - field: "data://all_interfaces.{{inspector_rule_var_lldp_switch_port_interface}}.lldp_processed.switch_port_description"
op: "matches" op: "matches"
value: "^Port-channel ([0-9/]*)$" value: "^Port-channel ?([0-9/]*)$"
invert: True invert: True
actions: actions:
- action: "set-attribute" - action: "set-attribute"

View File

@ -0,0 +1,6 @@
---
issues:
- |
Fixes an issue where the default inspector rule setting node names from
LLDP switch port descriptions would fail to filter out interface names on
Ruckus switches.