forked from napalm-automation/napalm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incorrectly taken serial number in NXOS. (napalm-automation#1025)
* The serial number is taken incorrectly, in particular, the "Processor Board ID" is displayed, and you need a Chassis -> serialnum: * Additional safety net for the lack of a serial number in the output. * black test * mov function _get_table_rows, _get_reply_table and _get_command_table from class NXOSDriver to NXOSDriverBase, because used in NXOSSSHDriver. * Added verification and conversion from string to json
- Loading branch information
1 parent
5bfbee5
commit 3a7e9c0
Showing
8 changed files
with
260 additions
and
34 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
34 changes: 34 additions & 0 deletions
34
test/nxos/mocked_data/test_get_facts/normal/show_inventory.json
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"TABLE_inv": { | ||
"ROW_inv": [ | ||
{ | ||
"name": "Chassis", | ||
"desc": "Nexus 6001 Chassis", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "TM6017D760B" | ||
}, | ||
{ | ||
"name": "Module 1", | ||
"desc": "Nexus 64 Supervisor", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Module 2", | ||
"desc": "Nexus 4xQSFP Ethernet Module", | ||
"productid": "N6K-C6001-M4Q", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Fan 1", | ||
"desc": "Chassis fan module", | ||
"productid": "N6K-C6001-FAN-B", | ||
"vendorid": "N/A", | ||
"serialnum": "N/A" | ||
} | ||
] | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
test/nxos_ssh/mocked_data/test_get_facts/7009_6_2_14/show_inventory___json.txt
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"TABLE_inv": { | ||
"ROW_inv": [ | ||
{ | ||
"name": "Chassis", | ||
"desc": "Nexus 6001 Chassis", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "JAF1602BKEN" | ||
}, | ||
{ | ||
"name": "Module 1", | ||
"desc": "Nexus 64 Supervisor", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Module 2", | ||
"desc": "Nexus 4xQSFP Ethernet Module", | ||
"productid": "N6K-C6001-M4Q", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Fan 1", | ||
"desc": "Chassis fan module", | ||
"productid": "N6K-C6001-FAN-B", | ||
"vendorid": "N/A", | ||
"serialnum": "N/A" | ||
} | ||
] | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
test/nxos_ssh/mocked_data/test_get_facts/N93180/show_inventory___json.txt
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"TABLE_inv": { | ||
"ROW_inv": [ | ||
{ | ||
"name": "Chassis", | ||
"desc": "Nexus 6001 Chassis", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "FDO21270U84" | ||
}, | ||
{ | ||
"name": "Module 1", | ||
"desc": "Nexus 64 Supervisor", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Module 2", | ||
"desc": "Nexus 4xQSFP Ethernet Module", | ||
"productid": "N6K-C6001-M4Q", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Fan 1", | ||
"desc": "Chassis fan module", | ||
"productid": "N6K-C6001-FAN-B", | ||
"vendorid": "N/A", | ||
"serialnum": "N/A" | ||
} | ||
] | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
test/nxos_ssh/mocked_data/test_get_facts/missing_domain/show_inventory___json.txt
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"TABLE_inv": { | ||
"ROW_inv": [ | ||
{ | ||
"name": "Chassis", | ||
"desc": "Nexus 6001 Chassis", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "TM6012EC74B" | ||
}, | ||
{ | ||
"name": "Module 1", | ||
"desc": "Nexus 64 Supervisor", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Module 2", | ||
"desc": "Nexus 4xQSFP Ethernet Module", | ||
"productid": "N6K-C6001-M4Q", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Fan 1", | ||
"desc": "Chassis fan module", | ||
"productid": "N6K-C6001-FAN-B", | ||
"vendorid": "N/A", | ||
"serialnum": "N/A" | ||
} | ||
] | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
test/nxos_ssh/mocked_data/test_get_facts/newer_version/show_inventory___json.txt
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"TABLE_inv": { | ||
"ROW_inv": [ | ||
{ | ||
"name": "Chassis", | ||
"desc": "Nexus 6001 Chassis", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "TM6012EC74B" | ||
}, | ||
{ | ||
"name": "Module 1", | ||
"desc": "Nexus 64 Supervisor", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Module 2", | ||
"desc": "Nexus 4xQSFP Ethernet Module", | ||
"productid": "N6K-C6001-M4Q", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Fan 1", | ||
"desc": "Chassis fan module", | ||
"productid": "N6K-C6001-FAN-B", | ||
"vendorid": "N/A", | ||
"serialnum": "N/A" | ||
} | ||
] | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
test/nxos_ssh/mocked_data/test_get_facts/normal/show_inventory___json.txt
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"TABLE_inv": { | ||
"ROW_inv": [ | ||
{ | ||
"name": "Chassis", | ||
"desc": "Nexus 6001 Chassis", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "TM6012EC74B" | ||
}, | ||
{ | ||
"name": "Module 1", | ||
"desc": "Nexus 64 Supervisor", | ||
"productid": "N6K-C6001-64P", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Module 2", | ||
"desc": "Nexus 4xQSFP Ethernet Module", | ||
"productid": "N6K-C6001-M4Q", | ||
"vendorid": "V01", | ||
"serialnum": "FOC11111111" | ||
}, | ||
{ | ||
"name": "Fan 1", | ||
"desc": "Chassis fan module", | ||
"productid": "N6K-C6001-FAN-B", | ||
"vendorid": "N/A", | ||
"serialnum": "N/A" | ||
} | ||
] | ||
} | ||
} |