From 7c916d5e201b7800b05e44e7fe763c3c8c10bdb0 Mon Sep 17 00:00:00 2001 From: Anthony Ruhier Date: Thu, 10 Jan 2019 05:39:34 +0100 Subject: [PATCH] Fix get_interface_type nxos on python 3.4 --- .../cli.1.show_interface_transceiver_json.0 | 10 +- .../nxos/cli.2.show_interface_status_json.0 | 91 ++++++++++--------- 2 files changed, 56 insertions(+), 45 deletions(-) diff --git a/tests/mock_driver/specific/cisco/nxos/cli.1.show_interface_transceiver_json.0 b/tests/mock_driver/specific/cisco/nxos/cli.1.show_interface_transceiver_json.0 index 5f06ca5..ead15c0 100644 --- a/tests/mock_driver/specific/cisco/nxos/cli.1.show_interface_transceiver_json.0 +++ b/tests/mock_driver/specific/cisco/nxos/cli.1.show_interface_transceiver_json.0 @@ -15,12 +15,14 @@ { "interface": "Ethernet1/3", "sfp": "present", - "type": "1000BASE-T" + "type": "1000BASE-T", + "partnum": "" }, { "interface": "Ethernet1/4", "sfp": "present", - "type": "1000BASE-SX" + "type": "1000BASE-SX", + "partnum": "" }, { "interface": "Ethernet1/5", @@ -57,6 +59,10 @@ "sfp": "present", "type": "X2-10GB-T", "partnum": "X2-10GB-T-FU" + }, + { + "interface": "mgmt0", + "partnum": "" } ] } diff --git a/tests/mock_driver/specific/cisco/nxos/cli.2.show_interface_status_json.0 b/tests/mock_driver/specific/cisco/nxos/cli.2.show_interface_status_json.0 index 9a74144..70ab21a 100644 --- a/tests/mock_driver/specific/cisco/nxos/cli.2.show_interface_status_json.0 +++ b/tests/mock_driver/specific/cisco/nxos/cli.2.show_interface_status_json.0 @@ -1,55 +1,60 @@ { - "TABLE_interface": { - "ROW_interface": [{ - "interface": "Ethernet1/1", + "TABLE_interface": { + "ROW_interface": [{ + "interface": "Ethernet1/1", "speed": "100G", - "type": "CFP-100G-SR10" - }, - { - "interface": "Ethernet1/2", + "type": "CFP-100G-SR10" + }, + { + "interface": "Ethernet1/2", "speed": "100G", - "type": "CFP2-100G-ER4" - }, - { - "interface": "Ethernet1/3", + "type": "CFP2-100G-ER4" + }, + { + "interface": "Ethernet1/3", "speed": "1G", - "type": "1000BASE-T" - }, - { - "interface": "Ethernet1/4", + "type": "1000BASE-T" + }, + { + "interface": "Ethernet1/4", "speed": "1G", - "type": "1000BASE-SX" - }, - { - "interface": "Ethernet1/5", + "type": "1000BASE-SX" + }, + { + "interface": "Ethernet1/5", "speed": "10G", - "type": "SFP-H10GB-CU3M" - }, - { - "interface": "Ethernet1/6", + "type": "SFP-H10GB-CU3M" + }, + { + "interface": "Ethernet1/6", "speed": "25G", - "type": "SFP-H25G-CU1M" - }, - { - "interface": "Ethernet1/7", + "type": "SFP-H25G-CU1M" + }, + { + "interface": "Ethernet1/7", "speed": "40G", - "type": "QSFP-40G-SR-BD" - }, - { - "interface": "Ethernet1/8", + "type": "QSFP-40G-SR-BD" + }, + { + "interface": "Ethernet1/8", "speed": "40G", - "type": "QSFP-4X10G-AC" - }, - { - "interface": "Ethernet1/9", + "type": "QSFP-4X10G-AC" + }, + { + "interface": "Ethernet1/9", "speed": "10G", - "type": "XENPAK-10GB-LRM" - }, - { - "interface": "Ethernet1/10", + "type": "XENPAK-10GB-LRM" + }, + { + "interface": "Ethernet1/10", "speed": "10G", - "type": "X2-10GB-T" - } - ] - } + "type": "X2-10GB-T" + }, + { + "interface": "mgmt0", + "speed": "", + "type": "" + } + ] + } }