Skip to content

Commit

Permalink
Bugfix: Account for powered-dn - nxos_show_module
Browse files Browse the repository at this point in the history
  • Loading branch information
mtbutler07 authored and thomasblass committed Oct 25, 2020
1 parent 1f4a25e commit aee25cd
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
3 changes: 2 additions & 1 deletion templates/cisco_nxos_show_module.textfsm
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ Value MODULE (\d+)
Value PORTS (\d+)
Value TYPE (\S+(\s+\S+)+)
Value MODEL (\S+)
Value STATUS (ok|active \*|ha-standby|powered-dn)
Value STATUS (ok|active \*|ha-standby|powered-dn|powered-up)

Start
^Xbar\s+Ports\s+Module-Type\s+Model\s+Status -> Fail
^${MODULE}\s+${PORTS}\s+${TYPE}\s+${MODEL}\s+${STATUS} -> Record
^${MODULE}\s+${PORTS}\s+${TYPE}\s+${STATUS} -> Record

Fail
^.* -> NoRecord
41 changes: 41 additions & 0 deletions tests/cisco_nxos/show_module/cisco_nxos_show_module1.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Mod Ports Module-Type Model Status
--- ----- -------------------------------- ------------------ ------------
1 48 1000 Mbps Optical Ethernet Modul N7K-M148GS-11 ok
3 0 Supervisor Module-2 powered-up
4 0 Supervisor Module-2 N7K-SUP1 powered-dn
5 0 Supervisor Module-2 N7K-SUP1 active *
6 0 Supervisor Module-2 N7K-SUP1 ha-standby


Mod Power-Status Reason
--- ------------ ---------------------------
4 powered-dn Configured Power down

Mod Sw Hw
--- -------------- ------
3 4.1(3) 0.202
4 4.1(3) 0.805

Mod MAC-Address(es) Serial-Num
--- -------------------------------------- ----------
3 00-1b-54-c2-ed-d0 to 00-1b-54-c2-ee-04 JAF1219AGFE
4 00-1b-54-c0-ff-10 to 00-1b-54-c0-ff-18 JAB114000BV

Mod Online Diag Status
--- ------------------
3 Pass
4 Pass

Xbar Ports Module-Type Model Status
--- ----- -------------------------------- ------------------ ------------
1 0 Fabric Module 1 N7K-C7018-FAB-1 ok

Xbar Sw Hw
--- -------------- ------
1 NA 0.101

Xbar MAC-Address(es) Serial-Num
--- -------------------------------------- ----------
1 NA JAF1225AGHJ

* this terminal session
27 changes: 27 additions & 0 deletions tests/cisco_nxos/show_module/cisco_nxos_show_module1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
parsed_sample:
- module: "1"
ports: "48"
type: "1000 Mbps Optical Ethernet Modul"
model: "N7K-M148GS-11"
status: "ok"
- module: "3"
ports: "0"
type: "Supervisor Module-2"
model: ""
status: "powered-up"
- module: "4"
ports: "0"
type: "Supervisor Module-2"
model: "N7K-SUP1"
status: "powered-dn"
- module: "5"
ports: "0"
type: "Supervisor Module-2"
model: "N7K-SUP1"
status: "active *"
- module: "6"
ports: "0"
type: "Supervisor Module-2"
model: "N7K-SUP1"
status: "ha-standby"

0 comments on commit aee25cd

Please sign in to comment.