From e5c977699cc53b3e3b4e001467d60f7d13b329a1 Mon Sep 17 00:00:00 2001 From: Johan Marcusson Date: Wed, 19 May 2021 15:14:21 +0200 Subject: [PATCH 01/60] Discard config if there was an error. This avoids stale config sessions lingering on the device. --- napalm/junos/junos.py | 1 + 1 file changed, 1 insertion(+) diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index 5867fd90d..128749b0a 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -267,6 +267,7 @@ def _load_candidate(self, filename, config, overwrite): ignore_warning=self.ignore_warning, ) except ConfigLoadError as e: + self.discard_config() if self.config_replace: raise ReplaceConfigException(e.errs) else: From 1bf981bd62d56e608cea8e7f0f0132af8cf25b70 Mon Sep 17 00:00:00 2001 From: Dylan Kaplan Date: Sat, 5 Jun 2021 13:14:46 -0700 Subject: [PATCH 02/60] Fix NXOS tests to allow mocked data to raise --- test/nxos/conftest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/nxos/conftest.py b/test/nxos/conftest.py index cd5f051a6..44ffe5656 100644 --- a/test/nxos/conftest.py +++ b/test/nxos/conftest.py @@ -2,10 +2,9 @@ from builtins import super import pytest +from napalm.base.mock import raise_exception from napalm.base.test import conftest as parent_conftest - from napalm.base.test.double import BaseTestDouble - from napalm.nxos import nxos @@ -74,6 +73,8 @@ def show(self, command, raw_text=False): result = self.read_txt_file(full_path) else: result = self.read_json_file(full_path) + if "exception" in result: + raise_exception(result) return result From 6b29a50e2f1ac7ce29063161b36823fbd9d0f48f Mon Sep 17 00:00:00 2001 From: Dylan Kaplan Date: Sun, 6 Jun 2021 12:27:19 -0700 Subject: [PATCH 03/60] Update NXOS response processing for more informative error messaging --- napalm/nxapi_plumbing/api_client.py | 24 ++++---- napalm/nxos/nxos.py | 2 +- test/nxapi_plumbing/conftest.py | 6 +- test/nxapi_plumbing/mock_device.py | 55 +++++++++++++++++-- test/nxapi_plumbing/test_config.py | 34 ++++++++++++ .../no_ipv6_support/show_ipv6_interface.json | 8 ++- 6 files changed, 108 insertions(+), 21 deletions(-) diff --git a/napalm/nxapi_plumbing/api_client.py b/napalm/nxapi_plumbing/api_client.py index d403a216d..55d399334 100644 --- a/napalm/nxapi_plumbing/api_client.py +++ b/napalm/nxapi_plumbing/api_client.py @@ -78,15 +78,7 @@ def _send_request(self, commands, method): ) raise NXAPIAuthError(msg) - if response.status_code not in [200]: - msg = """Invalid status code returned on NX-API POST -commands: {} -status_code: {}""".format( - commands, response.status_code - ) - raise NXAPIPostError(msg) - - return response.text + return response class RPCClient(RPCBase): @@ -139,7 +131,7 @@ def _process_api_response(self, response, commands, raw_text=False): structured data. """ - response_list = json.loads(response) + response_list = json.loads(response.text) if isinstance(response_list, dict): response_list = [response_list] @@ -150,7 +142,7 @@ def _process_api_response(self, response, commands, raw_text=False): new_response = [] for response in response_list: - # Dectect errors + # Detect errors self._error_check(response) # Some commands like "show run" can have a None result @@ -235,7 +227,15 @@ def _build_payload(self, commands, method, xml_version="1.0", version="1.0"): return payload def _process_api_response(self, response, commands, raw_text=False): - xml_root = etree.fromstring(response) + if response.status_code not in [200]: + msg = """Invalid status code returned on NX-API POST +commands: {} +status_code: {}""".format( + commands, response.status_code + ) + raise NXAPIPostError(msg) + + xml_root = etree.fromstring(response.text) response_list = xml_root.xpath("outputs/output") if len(commands) != len(response_list): raise NXAPIXMLError( diff --git a/napalm/nxos/nxos.py b/napalm/nxos/nxos.py index 67fdc0595..84e899888 100644 --- a/napalm/nxos/nxos.py +++ b/napalm/nxos/nxos.py @@ -1175,7 +1175,7 @@ def get_interfaces_ip(self): ipv6_interf_table_vrf = self._get_command_table( ipv6_command, "TABLE_intf", "ROW_intf" ) - except napalm.nxapi_plumbing.errors.NXAPIPostError: + except napalm.nxapi_plumbing.errors.NXAPICommandError: return interfaces_ip for interface in ipv6_interf_table_vrf: diff --git a/test/nxapi_plumbing/conftest.py b/test/nxapi_plumbing/conftest.py index 245319eaa..09fea1faa 100644 --- a/test/nxapi_plumbing/conftest.py +++ b/test/nxapi_plumbing/conftest.py @@ -39,6 +39,7 @@ def pytest_addoption(parser): @pytest.fixture(scope="module") def mock_pynxos_device(request): """Create a mock pynxos test device.""" + response_status_code = getattr(request, "param", 200) device = { "host": "nxos1.fake.com", "username": "admin", @@ -49,13 +50,14 @@ def mock_pynxos_device(request): "timeout": 60, "verify": False, } - conn = MockDevice(**device) + conn = MockDevice(response_status_code=response_status_code, **device) return conn @pytest.fixture(scope="module") def mock_pynxos_device_xml(request): """Create a mock pynxos test device.""" + response_status_code = getattr(request, "param", 200) device = { "host": "nxos1.fake.com", "username": "admin", @@ -66,7 +68,7 @@ def mock_pynxos_device_xml(request): "timeout": 60, "verify": False, } - conn = MockDevice(**device) + conn = MockDevice(response_status_code=response_status_code, **device) return conn diff --git a/test/nxapi_plumbing/mock_device.py b/test/nxapi_plumbing/mock_device.py index 852ebf272..9355b056a 100644 --- a/test/nxapi_plumbing/mock_device.py +++ b/test/nxapi_plumbing/mock_device.py @@ -61,6 +61,7 @@ def __init__( port=None, timeout=30, verify=True, + response_status_code=200, ): super().__init__( host, @@ -81,6 +82,7 @@ def __init__( port=port, timeout=timeout, verify=verify, + response_status_code=response_status_code, ) elif api_format == "xml": self.api = MockXMLClient( @@ -91,10 +93,33 @@ def __init__( port=port, timeout=timeout, verify=verify, + response_status_code=response_status_code, ) class MockRPCClient(RPCClient): + def __init__( + self, + host, + username, + password, + transport="https", + port=None, + timeout=30, + verify=True, + response_status_code=200, + ): + self.response_status_code = response_status_code + super().__init__( + host=host, + username=username, + password=password, + transport=transport, + port=port, + timeout=timeout, + verify=verify, + ) + def _send_request(self, commands, method="cli"): payload = self._build_payload(commands, method) @@ -112,12 +137,34 @@ def _send_request(self, commands, method="cli"): response_obj = FakeResponse() response_obj.text = mock_response - response_obj.status_code = 200 + response_obj.status_code = self.response_status_code - return response_obj.text + return response_obj class MockXMLClient(XMLClient): + def __init__( + self, + host, + username, + password, + transport="https", + port=None, + timeout=30, + verify=True, + response_status_code=200, + ): + self.response_status_code = response_status_code + super().__init__( + host=host, + username=username, + password=password, + transport=transport, + port=port, + timeout=timeout, + verify=verify, + ) + def _send_request(self, commands, method="cli_show"): payload = self._build_payload(commands, method) @@ -135,6 +182,6 @@ def _send_request(self, commands, method="cli_show"): response_obj = FakeResponse() response_obj.text = mock_response - response_obj.status_code = 200 + response_obj.status_code = self.response_status_code - return response_obj.text + return response_obj diff --git a/test/nxapi_plumbing/test_config.py b/test/nxapi_plumbing/test_config.py index 1b244b62d..1941fcca4 100644 --- a/test/nxapi_plumbing/test_config.py +++ b/test/nxapi_plumbing/test_config.py @@ -1,3 +1,9 @@ +import pytest + +from napalm.nxapi_plumbing import NXAPICommandError +from napalm.nxapi_plumbing.errors import NXAPIPostError + + def test_config_jsonrpc(mock_pynxos_device): result = mock_pynxos_device.config("logging history size 200") assert result is None @@ -36,3 +42,31 @@ def test_config_xml_list(mock_pynxos_device_xml): msg = element.find("./msg") assert status_code.text == "200" assert msg.text == "Success" + + +@pytest.mark.parametrize("mock_pynxos_device", [500], indirect=True) +def test_config_jsonrpc_raises_NXAPICommandError_on_non_200_config_error( + mock_pynxos_device, +): + with pytest.raises( + NXAPICommandError, match='The command "bogus command" gave the error' + ) as e: + result = mock_pynxos_device.config("bogus command") + + +@pytest.mark.parametrize("mock_pynxos_device_xml", [500], indirect=True) +def test_config_xml_raises_NXAPIPostError_on_non_200_post_error(mock_pynxos_device_xml): + with pytest.raises( + NXAPIPostError, match="Invalid status code returned on NX-API POST" + ) as e: + result = mock_pynxos_device_xml.config("logging history size 200") + + +@pytest.mark.parametrize("mock_pynxos_device_xml", [200], indirect=True) +def test_config_xml_raises_NXAPICommandError_on_200_config_error( + mock_pynxos_device_xml, +): + with pytest.raises( + NXAPICommandError, match='The command "bogus command" gave the error' + ) as e: + result = mock_pynxos_device_xml.config("bogus command") diff --git a/test/nxos/mocked_data/test_get_interfaces_ip/no_ipv6_support/show_ipv6_interface.json b/test/nxos/mocked_data/test_get_interfaces_ip/no_ipv6_support/show_ipv6_interface.json index d6e3d7429..c32daa6a3 100644 --- a/test/nxos/mocked_data/test_get_interfaces_ip/no_ipv6_support/show_ipv6_interface.json +++ b/test/nxos/mocked_data/test_get_interfaces_ip/no_ipv6_support/show_ipv6_interface.json @@ -1,3 +1,7 @@ { - "exception": "nxapi_plumbing.api_client.NXAPIPostError" -} + "exception": "napalm.nxapi_plumbing.errors.NXAPICommandError", + "kwargs": { + "command": "show ipv6 interface", + "message": "" + } +} \ No newline at end of file From acb2f7ce86833e03b19d651644c7bfcb383a85a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jun 2021 11:19:46 +0000 Subject: [PATCH 04/60] Bump pytest-cov from 2.12.0 to 2.12.1 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.12.0 to 2.12.1. - [Release notes](https://github.com/pytest-dev/pytest-cov/releases) - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.12.0...v2.12.1) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 106e77768..589cf888c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ coveralls==3.1.0 ddt==1.4.2 flake8-import-order==0.18.1 pytest==5.4.3 -pytest-cov==2.12.0 +pytest-cov==2.12.1 pytest-json==0.4.0 pytest-pythonpath==0.7.3 pylama==7.7.1 From f28843bdf1d2af042c8b1759b1544ff9fbb44a63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jun 2021 11:19:48 +0000 Subject: [PATCH 05/60] Bump black from 21.5b1 to 21.6b0 Bumps [black](https://github.com/psf/black) from 21.5b1 to 21.6b0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/commits) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 106e77768..77368b21f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -black==21.5b1 +black==21.6b0 coveralls==3.1.0 ddt==1.4.2 flake8-import-order==0.18.1 From bc4af769eb80d521098d484d0e37c1b7dceffb23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Jun 2021 11:19:50 +0000 Subject: [PATCH 06/60] Bump mypy from 0.812 to 0.902 Bumps [mypy](https://github.com/python/mypy) from 0.812 to 0.902. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.812...v0.902) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 106e77768..f35296f54 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -9,4 +9,4 @@ pytest-pythonpath==0.7.3 pylama==7.7.1 mock==4.0.3 tox==3.23.1 -mypy==0.812 +mypy==0.902 From acd64a35e0fc351062ba68c1618da7f61e0ca0a2 Mon Sep 17 00:00:00 2001 From: Christian Adell Date: Fri, 18 Jun 2021 10:38:13 +0200 Subject: [PATCH 07/60] Junos get_lldp_neighbor port return the port-id, not the port-decription --- napalm/junos/utils/junos_views.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napalm/junos/utils/junos_views.yml b/napalm/junos/utils/junos_views.yml index 41d922e06..a48fd3cb7 100644 --- a/napalm/junos/utils/junos_views.yml +++ b/napalm/junos/utils/junos_views.yml @@ -104,7 +104,7 @@ junos_lldp_table: junos_lldp_view: fields: hostname: lldp-remote-system-name - port: lldp-remote-port-description | lldp-remote-port-id + port: lldp-remote-port-id #### #### Interface counters From 66a146eabb1277093aee2ef48994480dbe98484c Mon Sep 17 00:00:00 2001 From: Christian Adell Date: Fri, 18 Jun 2021 10:48:56 +0200 Subject: [PATCH 08/60] Fix tests by adding port-id references --- .../test_get_lldp_neighbors/normal/expected_result.json | 2 +- .../normal/get-lldp-neighbors-information.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/junos/mocked_data/test_get_lldp_neighbors/normal/expected_result.json b/test/junos/mocked_data/test_get_lldp_neighbors/normal/expected_result.json index dfd79aec8..227125baf 100644 --- a/test/junos/mocked_data/test_get_lldp_neighbors/normal/expected_result.json +++ b/test/junos/mocked_data/test_get_lldp_neighbors/normal/expected_result.json @@ -1 +1 @@ -{"me0.0": [{"hostname": "lom-bjg61-r1-1", "port": "27"}], "xe-4/3/6": [{"hostname": "peer00.lab.demo", "port": "Ethernet1"}], "xe-0/1/0.0": [{"hostname": "spine00", "port": "xe-0/0/0"}], "ge-0/0/0.0": [{"hostname": "rtr00.demo", "port": "GigabitEthernet0/0/0/0"}]} +{"me0.0": [{"hostname": "lom-bjg61-r1-1", "port": "27"}], "xe-4/3/6": [{"hostname": "peer00.lab.demo", "port": "Ethernet1"}], "xe-0/1/0.0": [{"hostname": "spine00", "port": "xe-0/0/0"}], "ge-0/0/0.0": [{"hostname": "rtr00.demo", "port": "ge-0/0/0"}]} diff --git a/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml b/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml index 98f76fdd5..51ff83040 100644 --- a/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml +++ b/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml @@ -14,6 +14,7 @@ Mac address 00:23:47:50:21:40 27 + 27 lom-bjg61-r1-1 @@ -22,6 +23,7 @@ Mac address 02:e4:c8:6c:a4:00 GigabitEthernet0/0/0/0 + ge-0/0/0 rtr00.demo @@ -30,6 +32,7 @@ Mac address dc:38:e1:b7:26:16 xe-0/0/0 + xe-0/0/0 spine00 From bf145347bc22c1ffe5151a5720b88ee11b5fa36c Mon Sep 17 00:00:00 2001 From: Christian Adell Date: Fri, 18 Jun 2021 14:04:52 +0200 Subject: [PATCH 09/60] Keep backwards compatibility with older Junos versions Co-authored-by: Mircea Ulinic --- napalm/junos/utils/junos_views.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napalm/junos/utils/junos_views.yml b/napalm/junos/utils/junos_views.yml index a48fd3cb7..d134ab712 100644 --- a/napalm/junos/utils/junos_views.yml +++ b/napalm/junos/utils/junos_views.yml @@ -104,7 +104,7 @@ junos_lldp_table: junos_lldp_view: fields: hostname: lldp-remote-system-name - port: lldp-remote-port-id + port: lldp-remote-port-id | lldp-remote-port-description #### #### Interface counters From 16b67d3f56b5299a6089742c80f0aa14dd639b04 Mon Sep 17 00:00:00 2001 From: Christian Adell Date: Fri, 18 Jun 2021 14:12:19 +0200 Subject: [PATCH 10/60] Change get-lldp-neighbors-information response to test the port-description behaviour --- .../normal/get-lldp-neighbors-information.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml b/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml index 51ff83040..b15b9ca33 100644 --- a/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml +++ b/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml @@ -14,7 +14,6 @@ Mac address 00:23:47:50:21:40 27 - 27 lom-bjg61-r1-1 From 395c75ef2c78ab94734700926c6986d72ca27c21 Mon Sep 17 00:00:00 2001 From: Christian Adell Date: Fri, 18 Jun 2021 14:26:51 +0200 Subject: [PATCH 11/60] Define the tests for old and new junos LLDP --- .../normal/get-lldp-neighbors-information.xml | 8 +++-- .../expected_result.json | 1 + .../get-lldp-neighbors-information.xml | 36 +++++++++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/expected_result.json create mode 100644 test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/get-lldp-neighbors-information.xml diff --git a/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml b/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml index b15b9ca33..a9627c764 100644 --- a/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml +++ b/test/junos/mocked_data/test_get_lldp_neighbors/normal/get-lldp-neighbors-information.xml @@ -6,6 +6,7 @@ 00:1c:73:8f:0a:ed Interface name Ethernet1 + Ethernet1 interface peer00.lab.demo @@ -13,7 +14,8 @@ - Mac address 00:23:47:50:21:40 - 27 + 27 + Interface 27 lom-bjg61-r1-1 @@ -21,8 +23,8 @@ - Mac address 02:e4:c8:6c:a4:00 - GigabitEthernet0/0/0/0 ge-0/0/0 + GigabitEthernet0/0/0/0 rtr00.demo @@ -30,8 +32,8 @@ - Mac address dc:38:e1:b7:26:16 - xe-0/0/0 xe-0/0/0 + xe-0/0/0 spine00 diff --git a/test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/expected_result.json b/test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/expected_result.json new file mode 100644 index 000000000..dfd79aec8 --- /dev/null +++ b/test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/expected_result.json @@ -0,0 +1 @@ +{"me0.0": [{"hostname": "lom-bjg61-r1-1", "port": "27"}], "xe-4/3/6": [{"hostname": "peer00.lab.demo", "port": "Ethernet1"}], "xe-0/1/0.0": [{"hostname": "spine00", "port": "xe-0/0/0"}], "ge-0/0/0.0": [{"hostname": "rtr00.demo", "port": "GigabitEthernet0/0/0/0"}]} diff --git a/test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/get-lldp-neighbors-information.xml b/test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/get-lldp-neighbors-information.xml new file mode 100644 index 000000000..1bbcc0319 --- /dev/null +++ b/test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/get-lldp-neighbors-information.xml @@ -0,0 +1,36 @@ + + + xe-4/3/6 + - + Mac address + 00:1c:73:8f:0a:ed + Interface name + Ethernet1 interface + peer00.lab.demo + + + me0.0 + - + Mac address + 00:23:47:50:21:40 + Interface 27 + lom-bjg61-r1-1 + + + ge-0/0/0.0 + - + Mac address + 02:e4:c8:6c:a4:00 + GigabitEthernet0/0/0/0 + rtr00.demo + + + xe-0/1/0.0 + - + Mac address + dc:38:e1:b7:26:16 + xe-0/0/0 + xe-0/0/0 + spine00 + + From f44bbfce595be32c35fe280bde734a3475d9090e Mon Sep 17 00:00:00 2001 From: Christian Adell Date: Fri, 18 Jun 2021 14:53:12 +0200 Subject: [PATCH 12/60] Refine get_lldp_neighbors logic to pick only the first element of multiple types --- napalm/junos/junos.py | 13 ++++++++++++- .../old_without_remote_port_id/expected_result.json | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index 7ca5447fc..5fdee7e07 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -908,7 +908,18 @@ def get_lldp_neighbors(self): for neigh in result: if neigh[0] not in neighbors.keys(): neighbors[neigh[0]] = [] - neighbors[neigh[0]].append({x[0]: str(x[1]) for x in neigh[1]}) + + neigh_dict = {} + for neigh_data in neigh[1]: + key = neigh_data[0] + value = ( + neigh_data[1][0] + # When return value is a list of multiple objects, we pick the first one + if isinstance(neigh_data[1], list) + else str(neigh_data[1]) + ) + neigh_dict[key] = value + neighbors[neigh[0]].append(neigh_dict) return neighbors diff --git a/test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/expected_result.json b/test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/expected_result.json index dfd79aec8..0843cfa8e 100644 --- a/test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/expected_result.json +++ b/test/junos/mocked_data/test_get_lldp_neighbors/old_without_remote_port_id/expected_result.json @@ -1 +1 @@ -{"me0.0": [{"hostname": "lom-bjg61-r1-1", "port": "27"}], "xe-4/3/6": [{"hostname": "peer00.lab.demo", "port": "Ethernet1"}], "xe-0/1/0.0": [{"hostname": "spine00", "port": "xe-0/0/0"}], "ge-0/0/0.0": [{"hostname": "rtr00.demo", "port": "GigabitEthernet0/0/0/0"}]} +{"me0.0": [{"hostname": "lom-bjg61-r1-1", "port": "Interface 27"}], "xe-4/3/6": [{"hostname": "peer00.lab.demo", "port": "Ethernet1 interface"}], "xe-0/1/0.0": [{"hostname": "spine00", "port": "xe-0/0/0"}], "ge-0/0/0.0": [{"hostname": "rtr00.demo", "port": "GigabitEthernet0/0/0/0"}]} From ada8dbb10b40f38a9cf2124e0e9c169123700973 Mon Sep 17 00:00:00 2001 From: Christian Adell Date: Fri, 18 Jun 2021 15:19:50 +0200 Subject: [PATCH 13/60] Enforce string coding for values from list --- napalm/junos/junos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index 5fdee7e07..978ec7f7e 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -913,7 +913,7 @@ def get_lldp_neighbors(self): for neigh_data in neigh[1]: key = neigh_data[0] value = ( - neigh_data[1][0] + str(neigh_data[1][0]) # When return value is a list of multiple objects, we pick the first one if isinstance(neigh_data[1], list) else str(neigh_data[1]) From 4cdfcb7a92e9a3f6ffeec959101880c971fd11a1 Mon Sep 17 00:00:00 2001 From: Christian Adell Date: Mon, 21 Jun 2021 14:51:38 +0200 Subject: [PATCH 14/60] Handle empty list case to get first list element --- napalm/junos/junos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index 978ec7f7e..5058c0d58 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -915,7 +915,7 @@ def get_lldp_neighbors(self): value = ( str(neigh_data[1][0]) # When return value is a list of multiple objects, we pick the first one - if isinstance(neigh_data[1], list) + if neigh_data[1] and isinstance(neigh_data[1], list) else str(neigh_data[1]) ) neigh_dict[key] = value From 07bb71744997580f62f0bd44bdfafa476bb31c38 Mon Sep 17 00:00:00 2001 From: Kirk Byers Date: Fri, 30 Jul 2021 09:21:07 -0700 Subject: [PATCH 15/60] Allowing IOS bgp configuration with no explicit afi --- napalm/ios/ios.py | 8 +- .../no_afi/expected_result.json | 30 ++++ .../no_afi/show_running_config.txt | 152 ++++++++++++++++++ 3 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 test/ios/mocked_data/test_get_bgp_config/no_afi/expected_result.json create mode 100644 test/ios/mocked_data/test_get_bgp_config/no_afi/show_running_config.txt diff --git a/napalm/ios/ios.py b/napalm/ios/ios.py index a09c81292..ed4ea112c 100644 --- a/napalm/ios/ios.py +++ b/napalm/ios/ios.py @@ -1303,7 +1303,7 @@ def build_prefix_limit(af_table, limit, prefix_percent, prefix_timeout): if "ipv6" in af_table.lower(): inet6 = True preifx_type = "inet6" - if len(af_table.split()) == 2: + if not af_table or len(af_table.split()) == 2: safi = "unicast" else: safi = af_table.split()[-1] @@ -1355,7 +1355,11 @@ def build_prefix_limit(af_table, limit, prefix_percent, prefix_timeout): afi_list = napalm.base.helpers.cisco_conf_parse_parents( r"\s+address-family.*", bgp_neighbor, bgp_config_text ) - afi = afi_list[0] + try: + afi = afi_list[0] + except IndexError: + afi = "" + # Skipping neighbors in VRFs for now if "vrf" in str(afi_list): continue diff --git a/test/ios/mocked_data/test_get_bgp_config/no_afi/expected_result.json b/test/ios/mocked_data/test_get_bgp_config/no_afi/expected_result.json new file mode 100644 index 000000000..6c5a9cbaa --- /dev/null +++ b/test/ios/mocked_data/test_get_bgp_config/no_afi/expected_result.json @@ -0,0 +1,30 @@ +{ + "_": { + "apply_groups": [], + "description": "", + "local_as": 0, + "type": "", + "import_policy": "", + "export_policy": "", + "local_address": "", + "multipath": false, + "multihop_ttl": 0, + "remote_as": 0, + "remove_private_as": false, + "prefix_limit": {}, + "neighbors": { + "10.22.8.38": { + "description": "", + "remote_as": 44, + "prefix_limit": {}, + "export_policy": "", + "import_policy": "", + "local_address": "", + "local_as": 0, + "authentication_key": "", + "nhs": false, + "route_reflector_client": false + } + } + } +} diff --git a/test/ios/mocked_data/test_get_bgp_config/no_afi/show_running_config.txt b/test/ios/mocked_data/test_get_bgp_config/no_afi/show_running_config.txt new file mode 100644 index 000000000..d67e7cd06 --- /dev/null +++ b/test/ios/mocked_data/test_get_bgp_config/no_afi/show_running_config.txt @@ -0,0 +1,152 @@ +! +! Last configuration change at 18:41:02 UTC Thu Nov 24 2016 +! +version 15.5 +service timestamps debug datetime msec +service timestamps log datetime msec +no platform punt-keepalive disable-kernel-core +platform console auto +! +hostname CSR1 +! +boot-start-marker +boot-end-marker +! +! +enable password cisco +! +aaa new-model +! +! +aaa authentication login default local +aaa authorization exec default local +! +! +! +! +! +aaa session-id common +! +ip vrf MGMT +! +! +! +! +! +! +! +! +! + + +ip domain name example.local + +! +! +! +! +! +! +! +! +! +! +subscriber templating +! +multilink bundle-name authenticated +! +! +! +! +! +! +! +! +! +! +! +! +! +license udi pid CSR1000V sn 9OSEGKJXRHE +spanning-tree extend system-id +! +username cisco privilege 15 password 0 cisco +! +redundancy +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +interface Loopback0 + ip address 1.1.1.1 255.255.255.255 +! +interface GigabitEthernet1 + ip vrf forwarding MGMT + ip address 192.168.35.121 255.255.255.0 + negotiation auto +! +interface GigabitEthernet2 + ip address 10.1.1.1 255.255.255.0 + negotiation auto +! +interface GigabitEthernet3 + no ip address + shutdown + negotiation auto +! +router ospf 1 + redistribute connected subnets + network 10.1.1.0 0.0.0.255 area 0 +! +router bgp 42 + bgp router-id 10.22.8.20 + bgp log-neighbor-changes + neighbor 10.22.8.38 remote-as 44 +! +virtual-service csr_mgmt +! +ip forward-protocol nd +! +no ip http server +no ip http secure-server +! +! +! +! +! +! +control-plane +! + ! + ! + ! + ! +! +! +! +! +! +line con 0 +line vty 0 4 +! +! +end From f5ddef7d8e9e1420308549bcf300e73aee5f6e7f Mon Sep 17 00:00:00 2001 From: Sebastian Schaack Date: Sun, 1 Aug 2021 16:44:40 +0200 Subject: [PATCH 16/60] fixing float on ios and eos --- napalm/base/test/models.py | 2 +- napalm/eos/eos.py | 4 +- napalm/ios/ios.py | 1 - .../normal/expected_result.json | 19 +++++-- .../normal/show_interfaces.json | 54 +++++++++++++++++++ .../alternate/expected_result.json | 16 +++--- .../normal/expected_result.json | 15 ++++-- .../normal/show_interfaces.txt | 27 ++++++++++ .../pseudowire/expected_result.json | 2 +- .../normal/expected_result.json | 6 +-- 10 files changed, 123 insertions(+), 23 deletions(-) diff --git a/napalm/base/test/models.py b/napalm/base/test/models.py index e65cbf0d2..adf0de3fd 100644 --- a/napalm/base/test/models.py +++ b/napalm/base/test/models.py @@ -31,7 +31,7 @@ "description": str, "last_flapped": float, "mtu": int, - "speed": int, + "speed": float, "mac_address": str, }, ) diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index 083f00eb5..1d209b48d 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -490,7 +490,9 @@ def get_interfaces(self): ) interfaces[interface]["mtu"] = int(values["mtu"]) - interfaces[interface]["speed"] = int(values["bandwidth"] * 1e-6) +# interfaces[interface]["speed"] = float(values["bandwidth"] * 1e-6) + interfaces[interface]["speed"] = float(values["bandwidth"] / + 1000000.0 ) interfaces[interface]["mac_address"] = napalm.base.helpers.convert( napalm.base.helpers.mac, values.pop("physicalAddress", "") ) diff --git a/napalm/ios/ios.py b/napalm/ios/ios.py index a09c81292..7531d9053 100644 --- a/napalm/ios/ios.py +++ b/napalm/ios/ios.py @@ -1132,7 +1132,6 @@ def get_interfaces(self): speed = speed / 1000.0 elif speedformat.startswith("Gb"): speed = speed * 1000 - speed = int(round(speed)) if interface == "": raise ValueError( diff --git a/test/eos/mocked_data/test_get_interfaces/normal/expected_result.json b/test/eos/mocked_data/test_get_interfaces/normal/expected_result.json index d842545b4..e81746e3a 100644 --- a/test/eos/mocked_data/test_get_interfaces/normal/expected_result.json +++ b/test/eos/mocked_data/test_get_interfaces/normal/expected_result.json @@ -6,7 +6,7 @@ "is_up": true, "mac_address": "08:00:27:10:C4:8F", "mtu": 9214, - "speed": 0 + "speed": 0.0 }, "Management1": { "is_enabled": true, @@ -15,7 +15,7 @@ "is_up": true, "mac_address": "08:00:27:20:B9:04", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet1": { "is_enabled": true, @@ -24,7 +24,7 @@ "is_up": true, "mac_address": "08:00:27:C6:00:F0", "mtu": 9214, - "speed": 0 + "speed": 0.0 }, "Ethernet4": { "is_enabled": true, @@ -33,7 +33,7 @@ "is_up": true, "mac_address": "08:00:27:E0:12:D2", "mtu": 9214, - "speed": 0 + "speed": 0.0 }, "Ethernet3": { "is_enabled": true, @@ -42,6 +42,15 @@ "is_up": true, "mac_address": "08:00:27:1F:60:43", "mtu": 9214, - "speed": 0 + "speed": 0.0 + }, + "Ethernet5": { + "is_enabled": true, + "description": "", + "last_flapped": 1466586841.4148579, + "is_up": true, + "mac_address": "08:00:27:C6:00:F0", + "mtu": 9214, + "speed": 2.5 } } diff --git a/test/eos/mocked_data/test_get_interfaces/normal/show_interfaces.json b/test/eos/mocked_data/test_get_interfaces/normal/show_interfaces.json index 6b4709322..9f4fc2e3e 100644 --- a/test/eos/mocked_data/test_get_interfaces/normal/show_interfaces.json +++ b/test/eos/mocked_data/test_get_interfaces/normal/show_interfaces.json @@ -284,6 +284,60 @@ "interfaceAddress": [], "physicalAddress": "08:00:27:e0:12:d2", "description": "" + }, + "Ethernet5": { + "lastStatusChangeTimestamp": 1466586841.4148579, + "name": "Ethernet1", + "interfaceStatus": "connected", + "autoNegotiate": "unknown", + "burnedInAddress": "08:00:27:c6:00:f0", + "loopbackMode": "loopbackNone", + "interfaceStatistics": { + "inBitsRate": 0.0, + "inPktsRate": 0.0, + "outBitsRate": 0.0, + "updateInterval": 300.0, + "outPktsRate": 0.0 + }, + "mtu": 9214, + "hardware": "ethernet", + "duplex": "duplexFull", + "bandwidth": 2500000, + "forwardingModel": "bridged", + "lineProtocolStatus": "up", + "interfaceCounters": { + "outBroadcastPkts": 0, + "linkStatusChanges": 1, + "totalOutErrors": 0, + "inMulticastPkts": 94, + "counterRefreshTime": 1466589559.992741, + "inBroadcastPkts": 0, + "outputErrorsDetail": { + "deferredTransmissions": 0, + "txPause": 0, + "collisions": 0, + "lateCollisions": 0 + }, + "inOctets": 16386, + "outDiscards": 0, + "outOctets": 180591, + "inUcastPkts": 0, + "inputErrorsDetail": { + "runtFrames": 0, + "rxPause": 0, + "fcsErrors": 0, + "alignmentErrors": 0, + "giantFrames": 0, + "symbolErrors": 0 + }, + "outUcastPkts": 0, + "outMulticastPkts": 1429, + "totalInErrors": 0, + "inDiscards": 0 + }, + "interfaceAddress": [], + "physicalAddress": "08:00:27:c6:00:f0", + "description": "" } } } diff --git a/test/ios/mocked_data/test_get_interfaces/alternate/expected_result.json b/test/ios/mocked_data/test_get_interfaces/alternate/expected_result.json index af68f1b99..8684629e8 100644 --- a/test/ios/mocked_data/test_get_interfaces/alternate/expected_result.json +++ b/test/ios/mocked_data/test_get_interfaces/alternate/expected_result.json @@ -6,7 +6,7 @@ "last_flapped": -1, "mac_address": "FA:16:3E:57:33:6F", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "GigabitEthernet0/1": { "description": "to iosvl2-2", @@ -15,7 +15,7 @@ "last_flapped": -1, "mac_address": "FA:16:3E:4F:41:CC", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "GigabitEthernet0/2": { "description": "to iosvl2-4", @@ -24,7 +24,7 @@ "last_flapped": -1, "mac_address": "FA:16:3E:A3:3E:49", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "GigabitEthernet0/3": { "description": "to iosvl2-3", @@ -33,7 +33,7 @@ "last_flapped": -1, "mac_address": "FA:16:3E:31:2C:47", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "GigabitEthernet1/0": { "description": "to iosvl2-3", @@ -42,7 +42,7 @@ "last_flapped": -1, "mac_address": "FA:16:3E:C8:50:AB", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Loopback0": { "description": "Loopback", @@ -51,7 +51,7 @@ "last_flapped": -1, "mac_address": "", "mtu": 1514, - "speed": 8000 + "speed": 8000.0 }, "Port-channel1": { "description": "", @@ -60,7 +60,7 @@ "last_flapped": -1, "mac_address": "FA:16:3E:4F:41:CC", "mtu": 1500, - "speed": 100 + "speed": 100.0 }, "Vlan1": { "description": "OOB Management", @@ -69,6 +69,6 @@ "last_flapped": -1, "mac_address": "FA:16:3E:57:80:01", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 } } diff --git a/test/ios/mocked_data/test_get_interfaces/normal/expected_result.json b/test/ios/mocked_data/test_get_interfaces/normal/expected_result.json index 2e3970732..dc81ee67f 100644 --- a/test/ios/mocked_data/test_get_interfaces/normal/expected_result.json +++ b/test/ios/mocked_data/test_get_interfaces/normal/expected_result.json @@ -1,6 +1,6 @@ { "GigabitEthernet3": { - "speed": 1000, + "speed": 1000.0, "mtu": 1500, "mac_address": "08:00:27:82:51:6B", "is_up": false, @@ -9,7 +9,7 @@ "is_enabled": false }, "GigabitEthernet2": { - "speed": 1000, + "speed": 1000.0, "mtu": 1500, "mac_address": "08:00:27:79:E8:96", "is_up": true, @@ -18,12 +18,21 @@ "is_enabled": true }, "GigabitEthernet1": { - "speed": 1000, + "speed": 1000.0, "mtu": 1500, "mac_address": "08:00:27:F8:E8:42", "is_up": true, "last_flapped": -1.0, "description": "", "is_enabled": true + }, + "GigabitEthernet4": { + "speed": 2.5, + "mtu": 1500, + "mac_address": "08:00:27:82:51:6B", + "is_up": false, + "last_flapped": -1.0, + "description": "", + "is_enabled": false } } diff --git a/test/ios/mocked_data/test_get_interfaces/normal/show_interfaces.txt b/test/ios/mocked_data/test_get_interfaces/normal/show_interfaces.txt index 3a16a0014..fb243a394 100644 --- a/test/ios/mocked_data/test_get_interfaces/normal/show_interfaces.txt +++ b/test/ios/mocked_data/test_get_interfaces/normal/show_interfaces.txt @@ -82,3 +82,30 @@ GigabitEthernet3 is administratively down, line protocol is down 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier, 0 pause output 0 output buffer failures, 0 output buffers swapped out +GigabitEthernet4 is administratively down, line protocol is down + Hardware is CSR vNIC, address is 0800.2782.516b (bia 0800.2782.516b) + MTU 1500 bytes, BW 2500 Kbit/sec, DLY 10 usec, + reliability 255/255, txload 1/255, rxload 1/255 + Encapsulation ARPA, loopback not set + Keepalive set (10 sec) + Full Duplex, 1000Mbps, link type is auto, media type is RJ45 + output flow-control is unsupported, input flow-control is unsupported + ARP type: ARPA, ARP Timeout 04:00:00 + Last input never, output never, output hang never + Last clearing of "show interface" counters never + Input queue: 0/375/0/0 (size/max/drops/flushes); Total output drops: 0 + Queueing strategy: fifo + Output queue: 0/40 (size/max) + 5 minute input rate 0 bits/sec, 0 packets/sec + 5 minute output rate 0 bits/sec, 0 packets/sec + 0 packets input, 0 bytes, 0 no buffer + Received 0 broadcasts (0 IP multicasts) + 0 runts, 0 giants, 0 throttles + 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored + 0 watchdog, 0 multicast, 0 pause input + 3 packets output, 258 bytes, 0 underruns + 0 output errors, 0 collisions, 0 interface resets + 0 unknown protocol drops + 0 babbles, 0 late collision, 0 deferred + 0 lost carrier, 0 no carrier, 0 pause output + 0 output buffer failures, 0 output buffers swapped out diff --git a/test/ios/mocked_data/test_get_interfaces/pseudowire/expected_result.json b/test/ios/mocked_data/test_get_interfaces/pseudowire/expected_result.json index f6f7ccc6d..1cc2382d3 100644 --- a/test/ios/mocked_data/test_get_interfaces/pseudowire/expected_result.json +++ b/test/ios/mocked_data/test_get_interfaces/pseudowire/expected_result.json @@ -1,6 +1,6 @@ { "pseudowire100006": { - "speed": 10000, + "speed": 10000.0, "mac_address": "", "is_up": true, "last_flapped": -1.0, diff --git a/test/iosxr/mocked_data/test_get_interfaces/normal/expected_result.json b/test/iosxr/mocked_data/test_get_interfaces/normal/expected_result.json index 7ce391f05..8d25c7331 100644 --- a/test/iosxr/mocked_data/test_get_interfaces/normal/expected_result.json +++ b/test/iosxr/mocked_data/test_get_interfaces/normal/expected_result.json @@ -6,7 +6,7 @@ "is_up": false, "mac_address": "E0:AC:F1:64:71:52", "mtu": 1514, - "speed": 10000 + "speed": 10000.0 }, "TenGigE0/0/0/24": { "is_enabled": false, @@ -15,7 +15,7 @@ "is_up": false, "mac_address": "E0:AC:F1:64:71:5C", "mtu": 1514, - "speed": 10000 + "speed": 10000.0 }, "TenGigE0/0/0/13": { "is_enabled": true, @@ -24,6 +24,6 @@ "is_up": false, "mac_address": "E0:AC:F1:64:71:51", "mtu": 1514, - "speed": 10000 + "speed": 10000.0 } } From 919353da6d982c67b039a2f4ab6c8adce65de29e Mon Sep 17 00:00:00 2001 From: Sebastian Schaack Date: Sun, 1 Aug 2021 16:59:15 +0200 Subject: [PATCH 17/60] fixing failing test for nxos ; --- napalm/nxos/nxos.py | 2 +- .../normal/expected_result.json | 292 +++++++++--------- 2 files changed, 147 insertions(+), 147 deletions(-) diff --git a/napalm/nxos/nxos.py b/napalm/nxos/nxos.py index 67fdc0595..d3e311f1e 100644 --- a/napalm/nxos/nxos.py +++ b/napalm/nxos/nxos.py @@ -891,7 +891,7 @@ def get_interfaces(self): interface_speed = 0 if isinstance(interface_speed, list): interface_speed = interface_speed[0] - interface_speed = int(int(interface_speed) / 1000) + interface_speed = float(float(interface_speed) / 1000.0) if "admin_state" in interface_details: is_up = interface_details.get("admin_state", "") == "up" diff --git a/test/nxos/mocked_data/test_get_interfaces/normal/expected_result.json b/test/nxos/mocked_data/test_get_interfaces/normal/expected_result.json index 691cf62a0..28e83d343 100644 --- a/test/nxos/mocked_data/test_get_interfaces/normal/expected_result.json +++ b/test/nxos/mocked_data/test_get_interfaces/normal/expected_result.json @@ -6,7 +6,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/20": { "is_enabled": false, @@ -15,7 +15,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/23": { "is_enabled": false, @@ -24,7 +24,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/22": { "is_enabled": false, @@ -33,7 +33,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/25": { "is_enabled": false, @@ -42,7 +42,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/24": { "is_enabled": false, @@ -51,7 +51,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/27": { "is_enabled": false, @@ -60,7 +60,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/26": { "is_enabled": false, @@ -69,7 +69,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/29": { "is_enabled": false, @@ -78,7 +78,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/28": { "is_enabled": false, @@ -87,7 +87,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/39": { "is_enabled": false, @@ -96,7 +96,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/38": { "is_enabled": false, @@ -105,7 +105,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/31": { "is_enabled": false, @@ -114,7 +114,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/30": { "is_enabled": false, @@ -123,7 +123,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/33": { "is_enabled": false, @@ -132,7 +132,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/32": { "is_enabled": false, @@ -141,7 +141,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/35": { "is_enabled": false, @@ -150,7 +150,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/34": { "is_enabled": false, @@ -159,7 +159,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/37": { "is_enabled": false, @@ -168,7 +168,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/36": { "is_enabled": false, @@ -177,7 +177,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/48": { "is_enabled": false, @@ -186,7 +186,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/44": { "is_enabled": false, @@ -195,7 +195,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/45": { "is_enabled": false, @@ -204,7 +204,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/46": { "is_enabled": false, @@ -213,7 +213,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/47": { "is_enabled": false, @@ -222,7 +222,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/40": { "is_enabled": false, @@ -231,7 +231,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/41": { "is_enabled": false, @@ -240,7 +240,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/42": { "is_enabled": false, @@ -249,7 +249,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/43": { "is_enabled": false, @@ -258,7 +258,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Vlan1": { "is_enabled": false, @@ -267,7 +267,7 @@ "is_up": false, "mac_address": "2C:C2:60:1C:7B:94", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/47": { "is_enabled": false, @@ -276,7 +276,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/46": { "is_enabled": false, @@ -285,7 +285,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/45": { "is_enabled": false, @@ -294,7 +294,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/44": { "is_enabled": false, @@ -303,7 +303,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/43": { "is_enabled": false, @@ -312,7 +312,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/42": { "is_enabled": false, @@ -321,7 +321,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/41": { "is_enabled": false, @@ -330,7 +330,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/40": { "is_enabled": false, @@ -339,7 +339,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/48": { "is_enabled": false, @@ -348,7 +348,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/42": { "is_enabled": false, @@ -357,7 +357,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/43": { "is_enabled": false, @@ -366,7 +366,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/40": { "is_enabled": false, @@ -375,7 +375,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/41": { "is_enabled": false, @@ -384,7 +384,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/46": { "is_enabled": false, @@ -393,7 +393,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/47": { "is_enabled": false, @@ -402,7 +402,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/44": { "is_enabled": false, @@ -411,7 +411,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/45": { "is_enabled": false, @@ -420,7 +420,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/48": { "is_enabled": false, @@ -429,7 +429,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/8": { "is_enabled": false, @@ -438,7 +438,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/1": { "is_enabled": true, @@ -447,7 +447,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/28": { "is_enabled": false, @@ -456,7 +456,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/29": { "is_enabled": false, @@ -465,7 +465,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/20": { "is_enabled": false, @@ -474,7 +474,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/21": { "is_enabled": false, @@ -483,7 +483,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/22": { "is_enabled": false, @@ -492,7 +492,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/23": { "is_enabled": false, @@ -501,7 +501,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/24": { "is_enabled": false, @@ -510,7 +510,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/25": { "is_enabled": false, @@ -519,7 +519,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/26": { "is_enabled": false, @@ -528,7 +528,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/27": { "is_enabled": false, @@ -537,7 +537,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/18": { "is_enabled": false, @@ -546,7 +546,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/19": { "is_enabled": false, @@ -555,7 +555,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/10": { "is_enabled": false, @@ -564,7 +564,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/11": { "is_enabled": false, @@ -573,7 +573,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/12": { "is_enabled": false, @@ -582,7 +582,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/13": { "is_enabled": false, @@ -591,7 +591,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/14": { "is_enabled": false, @@ -600,7 +600,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/15": { "is_enabled": false, @@ -609,7 +609,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/16": { "is_enabled": false, @@ -618,7 +618,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/17": { "is_enabled": false, @@ -627,7 +627,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/5": { "is_enabled": false, @@ -636,7 +636,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/4": { "is_enabled": false, @@ -645,7 +645,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/7": { "is_enabled": false, @@ -654,7 +654,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/6": { "is_enabled": false, @@ -663,7 +663,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/1": { "is_enabled": false, @@ -672,7 +672,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/3": { "is_enabled": false, @@ -681,7 +681,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/2": { "is_enabled": false, @@ -690,7 +690,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/9": { "is_enabled": false, @@ -699,7 +699,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/8": { "is_enabled": false, @@ -708,7 +708,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/39": { "is_enabled": false, @@ -717,7 +717,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/38": { "is_enabled": false, @@ -726,7 +726,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/33": { "is_enabled": false, @@ -735,7 +735,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/32": { "is_enabled": false, @@ -744,7 +744,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/31": { "is_enabled": false, @@ -753,7 +753,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/30": { "is_enabled": false, @@ -762,7 +762,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/37": { "is_enabled": false, @@ -771,7 +771,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/36": { "is_enabled": false, @@ -780,7 +780,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/35": { "is_enabled": false, @@ -789,7 +789,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/34": { "is_enabled": false, @@ -798,7 +798,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/6": { "is_enabled": false, @@ -807,7 +807,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/7": { "is_enabled": false, @@ -816,7 +816,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/4": { "is_enabled": false, @@ -825,7 +825,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/5": { "is_enabled": false, @@ -834,7 +834,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/2": { "is_enabled": false, @@ -843,7 +843,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/3": { "is_enabled": false, @@ -852,7 +852,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/9": { "is_enabled": false, @@ -861,7 +861,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/1": { "is_enabled": false, @@ -870,7 +870,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/7": { "is_enabled": false, @@ -879,7 +879,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/6": { "is_enabled": true, @@ -888,7 +888,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/5": { "is_enabled": true, @@ -897,7 +897,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/4": { "is_enabled": true, @@ -906,7 +906,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/3": { "is_enabled": true, @@ -915,7 +915,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/2": { "is_enabled": true, @@ -924,7 +924,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/8": { "is_enabled": false, @@ -933,7 +933,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/9": { "is_enabled": false, @@ -942,7 +942,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "mgmt0": { "is_enabled": true, @@ -951,7 +951,7 @@ "is_up": true, "mac_address": "2C:C2:60:17:D7:60", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/13": { "is_enabled": false, @@ -960,7 +960,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/12": { "is_enabled": false, @@ -969,7 +969,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/11": { "is_enabled": false, @@ -978,7 +978,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/10": { "is_enabled": false, @@ -987,7 +987,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/17": { "is_enabled": false, @@ -996,7 +996,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/16": { "is_enabled": false, @@ -1005,7 +1005,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/15": { "is_enabled": false, @@ -1014,7 +1014,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/14": { "is_enabled": false, @@ -1023,7 +1023,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/19": { "is_enabled": false, @@ -1032,7 +1032,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/18": { "is_enabled": false, @@ -1041,7 +1041,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/36": { "is_enabled": false, @@ -1050,7 +1050,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/37": { "is_enabled": false, @@ -1059,7 +1059,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/34": { "is_enabled": false, @@ -1068,7 +1068,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/35": { "is_enabled": false, @@ -1077,7 +1077,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/32": { "is_enabled": false, @@ -1086,7 +1086,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/33": { "is_enabled": false, @@ -1095,7 +1095,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/30": { "is_enabled": false, @@ -1104,7 +1104,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/31": { "is_enabled": false, @@ -1113,7 +1113,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/38": { "is_enabled": false, @@ -1122,7 +1122,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet3/39": { "is_enabled": false, @@ -1131,7 +1131,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/28": { "is_enabled": false, @@ -1140,7 +1140,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/29": { "is_enabled": false, @@ -1149,7 +1149,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/26": { "is_enabled": false, @@ -1158,7 +1158,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/27": { "is_enabled": false, @@ -1167,7 +1167,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/24": { "is_enabled": false, @@ -1176,7 +1176,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/25": { "is_enabled": false, @@ -1185,7 +1185,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/22": { "is_enabled": false, @@ -1194,7 +1194,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/23": { "is_enabled": false, @@ -1203,7 +1203,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/20": { "is_enabled": false, @@ -1212,7 +1212,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/21": { "is_enabled": false, @@ -1221,7 +1221,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/11": { "is_enabled": false, @@ -1230,7 +1230,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/10": { "is_enabled": false, @@ -1239,7 +1239,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/13": { "is_enabled": false, @@ -1248,7 +1248,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/12": { "is_enabled": false, @@ -1257,7 +1257,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/15": { "is_enabled": false, @@ -1266,7 +1266,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/14": { "is_enabled": false, @@ -1275,7 +1275,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/17": { "is_enabled": false, @@ -1284,7 +1284,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/16": { "is_enabled": false, @@ -1293,7 +1293,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/19": { "is_enabled": false, @@ -1302,7 +1302,7 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet4/18": { "is_enabled": false, @@ -1311,6 +1311,6 @@ "is_up": false, "mac_address": "00:0C:29:D1:D5:6B", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 } } From 5076987a8fb61bd40db02d594b61c7c126d282ed Mon Sep 17 00:00:00 2001 From: Sebastian Schaack Date: Sun, 1 Aug 2021 18:20:35 +0200 Subject: [PATCH 18/60] fixing iosxr --- napalm/iosxr_netconf/iosxr_netconf.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/napalm/iosxr_netconf/iosxr_netconf.py b/napalm/iosxr_netconf/iosxr_netconf.py index a2216d448..727eec194 100644 --- a/napalm/iosxr_netconf/iosxr_netconf.py +++ b/napalm/iosxr_netconf/iosxr_netconf.py @@ -442,7 +442,7 @@ def get_interfaces(self): "is_up": False, "mac_address": "", "description": "", - "speed": -1, + "speed": -1.0, "last_flapped": -1.0, } @@ -489,14 +489,11 @@ def get_interfaces(self): napalm.base.helpers.mac, raw_mac, raw_mac ) speed = napalm.base.helpers.convert( - int, + float, napalm.base.helpers.convert( - int, - self._find_txt(interface_tree, "./int:bandwidth", namespaces=C.NS), - 0, - ) - * 1e-3, - ) + float,self._find_txt(interface_tree, "./int:bandwidth", namespaces=C.NS),0,)* 1e-3) +# speed = float(speed) + mtu = int( self._find_txt(interface_tree, "./int:mtu", default="", namespaces=C.NS) ) From 548e6b6f353dc5b1633a13a6c99fbfd0ca386c38 Mon Sep 17 00:00:00 2001 From: Sebastian Schaack Date: Sun, 1 Aug 2021 18:22:13 +0200 Subject: [PATCH 19/60] iosxr.py now returns speed -> float --- napalm/iosxr/iosxr.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/napalm/iosxr/iosxr.py b/napalm/iosxr/iosxr.py index 4e5043597..bcad6d6bb 100644 --- a/napalm/iosxr/iosxr.py +++ b/napalm/iosxr/iosxr.py @@ -221,7 +221,7 @@ def get_interfaces(self): "is_up": False, "mac_address": "", "description": "", - "speed": -1, + "speed": -1.0, "last_flapped": -1.0, } @@ -252,12 +252,13 @@ def get_interfaces(self): napalm.base.helpers.mac, raw_mac, raw_mac ) speed = napalm.base.helpers.convert( - int, + float, napalm.base.helpers.convert( - int, napalm.base.helpers.find_txt(interface_tree, "Bandwidth"), 0 + float, napalm.base.helpers.find_txt(interface_tree, "Bandwidth"), 0 ) * 1e-3, ) + mtu = int(napalm.base.helpers.find_txt(interface_tree, "MTU")) description = napalm.base.helpers.find_txt(interface_tree, "Description") interfaces[interface_name] = copy.deepcopy(INTERFACE_DEFAULTS) From ec53659c04548a0b4d88824ac16fae6236d74090 Mon Sep 17 00:00:00 2001 From: Sebastian Schaack Date: Sun, 1 Aug 2021 18:22:47 +0200 Subject: [PATCH 20/60] fixing pep8 issue --- napalm/eos/eos.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index 1d209b48d..10c30a1ec 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -491,8 +491,9 @@ def get_interfaces(self): interfaces[interface]["mtu"] = int(values["mtu"]) # interfaces[interface]["speed"] = float(values["bandwidth"] * 1e-6) - interfaces[interface]["speed"] = float(values["bandwidth"] / - 1000000.0 ) + interfaces[interface]["speed"] = float( + values["bandwidth"] / 1000000.0 + ) interfaces[interface]["mac_address"] = napalm.base.helpers.convert( napalm.base.helpers.mac, values.pop("physicalAddress", "") ) From e5052d637a61f8185a51d8f77d2539fede8b6ec5 Mon Sep 17 00:00:00 2001 From: Sebastian Schaack Date: Sun, 1 Aug 2021 18:27:36 +0200 Subject: [PATCH 21/60] make black happy --- napalm/eos/eos.py | 6 ++---- napalm/iosxr_netconf/iosxr_netconf.py | 8 ++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index 10c30a1ec..068710919 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -490,10 +490,8 @@ def get_interfaces(self): ) interfaces[interface]["mtu"] = int(values["mtu"]) -# interfaces[interface]["speed"] = float(values["bandwidth"] * 1e-6) - interfaces[interface]["speed"] = float( - values["bandwidth"] / 1000000.0 - ) + # interfaces[interface]["speed"] = float(values["bandwidth"] * 1e-6) + interfaces[interface]["speed"] = float(values["bandwidth"] / 1000000.0) interfaces[interface]["mac_address"] = napalm.base.helpers.convert( napalm.base.helpers.mac, values.pop("physicalAddress", "") ) diff --git a/napalm/iosxr_netconf/iosxr_netconf.py b/napalm/iosxr_netconf/iosxr_netconf.py index 727eec194..654ae31cc 100644 --- a/napalm/iosxr_netconf/iosxr_netconf.py +++ b/napalm/iosxr_netconf/iosxr_netconf.py @@ -491,8 +491,12 @@ def get_interfaces(self): speed = napalm.base.helpers.convert( float, napalm.base.helpers.convert( - float,self._find_txt(interface_tree, "./int:bandwidth", namespaces=C.NS),0,)* 1e-3) -# speed = float(speed) + float, + self._find_txt(interface_tree, "./int:bandwidth", namespaces=C.NS), + 0, + ) + * 1e-3, + ) mtu = int( self._find_txt(interface_tree, "./int:mtu", default="", namespaces=C.NS) From 9fd031bc05796417deb564f27d8f83ac2980a864 Mon Sep 17 00:00:00 2001 From: Sebastian Schaack Date: Sun, 1 Aug 2021 21:54:59 +0200 Subject: [PATCH 22/60] fix failing junos tests --- napalm/junos/junos.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index 7ca5447fc..c559cd273 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -448,7 +448,7 @@ def _convert_to_dict(interfaces): iface_data["mac_address"], str(iface_data["mac_address"]), ), - "speed": -1, + "speed": -1.0, "mtu": 0, } # result[iface]['last_flapped'] = float(result[iface]['last_flapped']) @@ -463,12 +463,14 @@ def _convert_to_dict(interfaces): ) if match is None: continue - speed_value = napalm.base.helpers.convert(int, match.group(1), -1) - if speed_value == -1: + speed_value = napalm.base.helpers.convert(float, + match.group(1), -1.0) + + if speed_value == -1.0: continue speed_unit = match.group(2) if speed_unit.lower() == "gbps": - speed_value *= 1000 + speed_value *= 1000.0 result[iface]["speed"] = speed_value return result From d034e1fd81299c41234208b3ed0f2b41bc5d9c35 Mon Sep 17 00:00:00 2001 From: Sebastian Schaack Date: Sun, 1 Aug 2021 22:23:39 +0200 Subject: [PATCH 23/60] nxos_ssh now returns float instead of int --- napalm/nxos_ssh/nxos_ssh.py | 12 ++++---- .../5548_7_0_8_N1_1/expected_result.json | 10 +++---- .../alternate1/expected_result.json | 30 +++++++++---------- .../no_delay/expected_result.json | 4 +-- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/napalm/nxos_ssh/nxos_ssh.py b/napalm/nxos_ssh/nxos_ssh.py index cfa2ddccf..c8914d2a5 100644 --- a/napalm/nxos_ssh/nxos_ssh.py +++ b/napalm/nxos_ssh/nxos_ssh.py @@ -164,7 +164,7 @@ def parse_intf_section(interface): if speed_exist: match = re.search(re_speed, interface, flags=re.M) - speed = int(match.group("speed")) + speed = float(match.group("speed")) mtu = int(match.group("mtu")) speed_unit = match.group("speed_unit") speed_unit = speed_unit.rstrip(",") @@ -174,9 +174,9 @@ def parse_intf_section(interface): interface ) raise ValueError(msg) - speed = int(round(speed / 1000.0)) + speed = float(speed / 1000.0) else: - speed = -1 + speed = -1.0 description = "" for x_pattern in [re_description_1, re_description_2]: @@ -686,19 +686,19 @@ def get_interfaces(self): 'is_up': True, 'last_flapped': -1.0, 'mac_address': u'a493.4cc1.67a7', - 'speed': 100}, + 'speed': 100.0}, u'Vlan100': { 'description': u'Data Network', 'is_enabled': True, 'is_up': True, 'last_flapped': -1.0, 'mac_address': u'a493.4cc1.67a7', - 'speed': 100}, + 'speed': 100.0}, u'Vlan200': { 'description': u'Voice Network', 'is_enabled': True, 'is_up': True, 'last_flapped': -1.0, 'mac_address': u'a493.4cc1.67a7', - 'speed': 100}} + 'speed': 100.0}} """ interfaces = {} command = "show interface" diff --git a/test/nxos_ssh/mocked_data/test_get_interfaces/5548_7_0_8_N1_1/expected_result.json b/test/nxos_ssh/mocked_data/test_get_interfaces/5548_7_0_8_N1_1/expected_result.json index e14baf8ce..e7603c76f 100644 --- a/test/nxos_ssh/mocked_data/test_get_interfaces/5548_7_0_8_N1_1/expected_result.json +++ b/test/nxos_ssh/mocked_data/test_get_interfaces/5548_7_0_8_N1_1/expected_result.json @@ -1,12 +1,12 @@ { "Ethernet154/1/48": { - "is_enabled": true, - "description": "", + "is_enabled": true, + "description": "", "last_flapped": -1.0, "is_up": true, "mac_address": "0C:D9:96:08:0D:71", "mtu": 1500, - "speed": 100 + "speed": 100.0 }, "Ethernet154/1/46": { "is_enabled": true, @@ -15,7 +15,7 @@ "is_up": false, "mac_address": "0C:D9:96:08:0D:6F", "mtu": 1500, - "speed": 0 + "speed": 0.023 }, "Ethernet154/1/47": { "is_enabled": false, @@ -24,7 +24,7 @@ "is_up": false, "mac_address": "0C:D9:96:08:0D:6E", "mtu": 1500, - "speed": 0 + "speed": 0.023 } } diff --git a/test/nxos_ssh/mocked_data/test_get_interfaces/alternate1/expected_result.json b/test/nxos_ssh/mocked_data/test_get_interfaces/alternate1/expected_result.json index 12be611c2..a3b95a391 100644 --- a/test/nxos_ssh/mocked_data/test_get_interfaces/alternate1/expected_result.json +++ b/test/nxos_ssh/mocked_data/test_get_interfaces/alternate1/expected_result.json @@ -6,7 +6,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/10": { "is_enabled": false, @@ -15,7 +15,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/8": { "is_enabled": false, @@ -24,7 +24,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Management0": { "is_enabled": true, @@ -33,7 +33,7 @@ "is_up": true, "mac_address": "2C:C2:60:12:EC:74", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/6": { "is_enabled": true, @@ -42,7 +42,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Loopback0": { "is_enabled": true, @@ -51,7 +51,7 @@ "is_up": true, "mac_address": "", "mtu": 1500, - "speed": 8000 + "speed": 8000.0 }, "Ethernet2/9": { "is_enabled": false, @@ -60,7 +60,7 @@ "is_up": false, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Loopback55": { "is_enabled": true, @@ -69,7 +69,7 @@ "is_up": true, "mac_address": "", "mtu": 1500, - "speed": 8000 + "speed": 8000.0 }, "Ethernet2/7": { "is_enabled": true, @@ -78,7 +78,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Vlan1": { "is_enabled": false, @@ -87,7 +87,7 @@ "is_up": false, "mac_address": "", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/5": { "is_enabled": true, @@ -96,7 +96,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/4": { "is_enabled": true, @@ -105,7 +105,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/3": { "is_enabled": true, @@ -114,7 +114,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/2": { "is_enabled": true, @@ -123,7 +123,7 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Ethernet2/1": { "is_enabled": true, @@ -132,6 +132,6 @@ "is_up": true, "mac_address": "2C:C2:60:4F:FE:B2", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 } } diff --git a/test/nxos_ssh/mocked_data/test_get_interfaces/no_delay/expected_result.json b/test/nxos_ssh/mocked_data/test_get_interfaces/no_delay/expected_result.json index b374e6e45..85a09997c 100644 --- a/test/nxos_ssh/mocked_data/test_get_interfaces/no_delay/expected_result.json +++ b/test/nxos_ssh/mocked_data/test_get_interfaces/no_delay/expected_result.json @@ -6,7 +6,7 @@ "last_flapped": -1.0, "mac_address": "", "mtu": 1500, - "speed": 1000 + "speed": 1000.0 }, "Tunnel901": { "description": "Visitor to *****", @@ -15,6 +15,6 @@ "last_flapped": -1.0, "mac_address": "", "mtu": 1476, - "speed": 1 + "speed": 1.0 } } From 2248263a82d7f079d48e27c3cbba2fbc8eb607f7 Mon Sep 17 00:00:00 2001 From: Sebastian Schaack Date: Sun, 1 Aug 2021 22:41:21 +0200 Subject: [PATCH 24/60] make black happy for junos.py --- napalm/junos/junos.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index c559cd273..5e5ff631e 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -463,8 +463,7 @@ def _convert_to_dict(interfaces): ) if match is None: continue - speed_value = napalm.base.helpers.convert(float, - match.group(1), -1.0) + speed_value = napalm.base.helpers.convert(float, match.group(1), -1.0) if speed_value == -1.0: continue From f7eb16dc8472dddaae3087a991e503d80aeea175 Mon Sep 17 00:00:00 2001 From: Eldon Koyle Date: Thu, 5 Aug 2021 11:38:39 -0600 Subject: [PATCH 25/60] Ignore warnings on device.cu.diff call as well --- napalm/junos/junos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index 7ca5447fc..5eda6f067 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -284,7 +284,7 @@ def load_merge_candidate(self, filename=None, config=None): def compare_config(self): """Compare candidate config with running.""" - diff = self.device.cu.diff() + diff = self.device.cu.diff(ignore_warning=self.ignore_warning) if diff is None: return "" From d30d5b5b872d021773d57485b99697dcd5969088 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 15:10:23 +0000 Subject: [PATCH 26/60] Bump tox from 3.23.1 to 3.24.3 Bumps [tox](https://github.com/tox-dev/tox) from 3.23.1 to 3.24.3. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/master/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/3.23.1...3.24.3) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4008d17e8..da4f34fd7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,5 +8,5 @@ pytest-json==0.4.0 pytest-pythonpath==0.7.3 pylama==7.7.1 mock==4.0.3 -tox==3.23.1 +tox==3.24.3 mypy==0.902 From db1be0d9183fc700344f4938f182aacc61cc4ca9 Mon Sep 17 00:00:00 2001 From: Thomas Bridge Date: Thu, 2 Sep 2021 16:28:10 +0100 Subject: [PATCH 27/60] Fixing the issue with the updated json output in newer versions of NXOS. --- napalm/nxos_ssh/nxos_ssh.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/napalm/nxos_ssh/nxos_ssh.py b/napalm/nxos_ssh/nxos_ssh.py index cfa2ddccf..6a07560e7 100644 --- a/napalm/nxos_ssh/nxos_ssh.py +++ b/napalm/nxos_ssh/nxos_ssh.py @@ -1534,7 +1534,11 @@ def get_vlans(self): for vlan in vlan_table_raw: if "vlanshowplist-ifidx" not in vlan.keys(): vlan["vlanshowplist-ifidx"] = [] - vlans[vlan["vlanshowbr-vlanid"]] = { + if "vlanshowbr-vlanid-utf" in vlan.keys(): + vlan_number = vlan["vlanshowbr-vlanid-utf"] + else: + vlan_number = vlan["vlanshowbr-vlanid"] + vlans[vlan_number] = { "name": vlan["vlanshowbr-vlanname"], "interfaces": self._parse_vlan_ports(vlan["vlanshowplist-ifidx"]), } From e7de07f6128d26d366464179602c4dfa13c3ae41 Mon Sep 17 00:00:00 2001 From: Richard Collins Date: Sat, 11 Sep 2021 21:49:37 -0400 Subject: [PATCH 28/60] update MockDriver and tests for API changes from confirm_commit --- napalm/base/mock.py | 24 ++++++++++++++++++++- test/base/test_mock_driver.py | 12 +++++++++++ test/base/test_mock_driver/confirm_commit.1 | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 test/base/test_mock_driver/confirm_commit.1 diff --git a/napalm/base/mock.py b/napalm/base/mock.py index b56682f49..0ac52f8f1 100644 --- a/napalm/base/mock.py +++ b/napalm/base/mock.py @@ -114,6 +114,7 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None) self.merge = None self.filename = None self.config = None + self._pending_commits = False def _count_calls(self, name): current_count = self.calls.get(name, 0) @@ -168,9 +169,14 @@ def compare_config(self, filename=None, config=None): self._raise_if_closed() return mocked_data(self.path, "compare_config", count)["diff"] - def commit_config(self): + def commit_config(self, message="", revert_in=None): count = self._count_calls("commit_config") self._raise_if_closed() + if revert_in is not None: + if self.has_pending_commit(): + raise napalm.CommitError("Pending commit confirm already in process!") + else: + self._pending_commits = True self.merge = None self.filename = None self.config = None @@ -184,6 +190,22 @@ def discard_config(self): self.config = None mocked_data(self.path, "discard_config", count) + def confirm_commit(self): + count = self._count_calls("confirm_commit") + self._raise_if_closed() + self.merge = None + self.filename = None + self.config = None + self._pending_commits = False + mocked_data(self.path, "confirm_commit", count) + + def has_pending_commit(self): + return self._pending_commits + + def rollback(self): + self.config_session = None + self._pending_commits = False + def _rpc(self, get): """This one is only useful for junos.""" return list(self.cli([get]).values())[0] diff --git a/test/base/test_mock_driver.py b/test/base/test_mock_driver.py index 6ad65b1d5..8715ceb14 100644 --- a/test/base/test_mock_driver.py +++ b/test/base/test_mock_driver.py @@ -146,3 +146,15 @@ def test_configuration_replace(self): d.compare_config() == "a_diff" d.commit_config() d.close() + + def test_configuration_replace_confirm(self): + d = driver("blah", "bleh", "blih", optional_args=optional_args) + d.open() + d.load_replace_candidate(config="asdasdasd") + assert d.merge is False + d.compare_config() == "a_diff" + d.commit_config(message="testcommit", revert_in=120) + assert d.has_pending_commit() is True + d.confirm_commit() + assert d.has_pending_commit() is False + d.close() diff --git a/test/base/test_mock_driver/confirm_commit.1 b/test/base/test_mock_driver/confirm_commit.1 new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/test/base/test_mock_driver/confirm_commit.1 @@ -0,0 +1 @@ +{} From cc4d8fd3f9efa3399c0e4b18238bcce94548913d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Sep 2021 09:22:22 +0000 Subject: [PATCH 29/60] Bump mypy from 0.902 to 0.910 Bumps [mypy](https://github.com/python/mypy) from 0.902 to 0.910. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.902...v0.910) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index da4f34fd7..482201e4a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -9,4 +9,4 @@ pytest-pythonpath==0.7.3 pylama==7.7.1 mock==4.0.3 tox==3.24.3 -mypy==0.902 +mypy==0.910 From b42219454f12cec5dfae1ad14774ae339925c208 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Sep 2021 09:24:59 +0000 Subject: [PATCH 30/60] Bump coveralls from 3.1.0 to 3.2.0 Bumps [coveralls](https://github.com/TheKevJames/coveralls-python) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/TheKevJames/coveralls-python/releases) - [Changelog](https://github.com/TheKevJames/coveralls-python/blob/master/CHANGELOG.md) - [Commits](https://github.com/TheKevJames/coveralls-python/compare/3.1.0...3.2.0) --- updated-dependencies: - dependency-name: coveralls dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 482201e4a..876976856 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ black==21.6b0 -coveralls==3.1.0 +coveralls==3.2.0 ddt==1.4.2 flake8-import-order==0.18.1 pytest==5.4.3 From 55fcd1a3218195ba6b80803c88fc69a37af63dd3 Mon Sep 17 00:00:00 2001 From: Anthony Iheoma Date: Mon, 4 Oct 2021 15:04:02 +0200 Subject: [PATCH 31/60] fix EOS get_bgp_config mismatch between neighbors and peer-group The peer-group syntax is deprecated since EOS 4.23.0 and replaced by 'peer group'. OLD: neighbor 192.168.172.36 peer-group 4-public-anycast-peers NEW: neighbor 192.168.172.36 peer group 4-public-anycast-peers --- napalm/eos/eos.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/napalm/eos/eos.py b/napalm/eos/eos.py index 068710919..a14031cf7 100644 --- a/napalm/eos/eos.py +++ b/napalm/eos/eos.py @@ -1006,6 +1006,10 @@ def parse_options(options, default_value=False): bgp_neighbors[peer_address] = default_neighbor_dict(local_as) if options[0] == "peer-group": bgp_neighbors[peer_address]["__group"] = options[1] + # EOS > 4.23.0 only supports the new syntax + # https://www.arista.com/en/support/advisories-notices/fieldnotices/7097-field-notice-39 + elif options[0] == "peer" and options[1] == "group": + bgp_neighbors[peer_address]["__group"] = options[2] # in the config, neighbor details are lister after # the group is specified for the neighbor: From 92740e7ff4911f80f2baccbca8f1818199a8740c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 15:10:46 +0000 Subject: [PATCH 32/60] Bump pytest-cov from 2.12.1 to 3.0.0 Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.12.1 to 3.0.0. - [Release notes](https://github.com/pytest-dev/pytest-cov/releases) - [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.12.1...v3.0.0) --- updated-dependencies: - dependency-name: pytest-cov dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 876976856..09415a5e0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ coveralls==3.2.0 ddt==1.4.2 flake8-import-order==0.18.1 pytest==5.4.3 -pytest-cov==2.12.1 +pytest-cov==3.0.0 pytest-json==0.4.0 pytest-pythonpath==0.7.3 pylama==7.7.1 From b835bc860930e7b893b23f75c028dd0cad82b0c9 Mon Sep 17 00:00:00 2001 From: Anthony Iheoma Date: Tue, 5 Oct 2021 14:19:00 +0200 Subject: [PATCH 33/60] Ensure the new peer group syntax is supported --- .../expected_result.json | 42 +++++++++++++++++++ ...w_running_config___section_router_bgp.text | 14 +++++++ 2 files changed, 56 insertions(+) create mode 100644 test/eos/mocked_data/test_get_bgp_config/issue1504_alt_peer_group_syntax/expected_result.json create mode 100644 test/eos/mocked_data/test_get_bgp_config/issue1504_alt_peer_group_syntax/show_running_config___section_router_bgp.text diff --git a/test/eos/mocked_data/test_get_bgp_config/issue1504_alt_peer_group_syntax/expected_result.json b/test/eos/mocked_data/test_get_bgp_config/issue1504_alt_peer_group_syntax/expected_result.json new file mode 100644 index 000000000..8354f24ba --- /dev/null +++ b/test/eos/mocked_data/test_get_bgp_config/issue1504_alt_peer_group_syntax/expected_result.json @@ -0,0 +1,42 @@ +{ + "IPv6-PEERS-GROUP-NAME": { + "type": "", + "multipath": false, + "apply_groups": [], + "remove_private_as": true, + "multihop_ttl": 0, + "remote_as": 0, + "local_address": "", + "local_as": 64496, + "description": "", + "import_policy": "reject-all", + "export_policy": "reject-all", + "prefix_limit": {}, + "neighbors": { + "2001:db8::0:1": { + "description": "", + "remote_as": 64510, + "local_address": "", + "local_as": 64496, + "nhs": false, + "route_reflector_client": false, + "import_policy": "", + "export_policy": "", + "authentication_key": "", + "prefix_limit": {} + }, + "2001:db8::0:2": { + "description": "", + "remote_as": 64511, + "local_address": "", + "local_as": 64496, + "nhs": false, + "route_reflector_client": false, + "import_policy": "", + "export_policy": "", + "authentication_key": "", + "prefix_limit": {} + } + } + } +} diff --git a/test/eos/mocked_data/test_get_bgp_config/issue1504_alt_peer_group_syntax/show_running_config___section_router_bgp.text b/test/eos/mocked_data/test_get_bgp_config/issue1504_alt_peer_group_syntax/show_running_config___section_router_bgp.text new file mode 100644 index 000000000..384f22972 --- /dev/null +++ b/test/eos/mocked_data/test_get_bgp_config/issue1504_alt_peer_group_syntax/show_running_config___section_router_bgp.text @@ -0,0 +1,14 @@ +router bgp 64496 + maximum-paths 32 + neighbor IPv6-PEERS-GROUP-NAME peer group + neighbor IPv6-PEERS-GROUP-NAME remove-private-as + neighbor IPv6-PEERS-GROUP-NAME route-map reject-all in + neighbor IPv6-PEERS-GROUP-NAME route-map reject-all out + neighbor IPv6-PEERS-GROUP-NAME maximum-routes 100 + neighbor IPv6-PEERS-GROUP-NAME send-community + neighbor 2001:db8::0:1 peer group IPv6-PEERS-GROUP-NAME + neighbor 2001:db8::0:1 remote-as 64510 + neighbor 2001:db8::0:1 maximum-routes 500 + neighbor 2001:db8::0:2 peer group IPv6-PEERS-GROUP-NAME + neighbor 2001:db8::0:2 remote-as 64511 +! From 12aa1fbd3a73bf471a78ef84d8ef016b53e5121d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 15:15:08 +0000 Subject: [PATCH 34/60] Bump ddt from 1.4.2 to 1.4.4 Bumps [ddt](https://github.com/datadriventests/ddt) from 1.4.2 to 1.4.4. - [Release notes](https://github.com/datadriventests/ddt/releases) - [Commits](https://github.com/datadriventests/ddt/compare/1.4.2...1.4.4) --- updated-dependencies: - dependency-name: ddt dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 876976856..45ff91f04 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ black==21.6b0 coveralls==3.2.0 -ddt==1.4.2 +ddt==1.4.4 flake8-import-order==0.18.1 pytest==5.4.3 pytest-cov==2.12.1 From 2170443ff13cebcf2392aa0275ebc8fc7e630f81 Mon Sep 17 00:00:00 2001 From: Jeremiah Millay Date: Tue, 12 Oct 2021 22:52:16 -0400 Subject: [PATCH 35/60] Disable InsecureRequestWarning if ssl_verify is false in nxos driver --- napalm/nxapi_plumbing/api_client.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/napalm/nxapi_plumbing/api_client.py b/napalm/nxapi_plumbing/api_client.py index d403a216d..798e449a7 100644 --- a/napalm/nxapi_plumbing/api_client.py +++ b/napalm/nxapi_plumbing/api_client.py @@ -9,6 +9,7 @@ import requests from requests.auth import HTTPBasicAuth from requests.exceptions import ConnectionError +from requests.packages.urllib3.exceptions import InsecureRequestWarning import json from lxml import etree @@ -60,6 +61,9 @@ def _send_request(self, commands, method): payload = self._build_payload(commands, method) try: + if not self.verify: + requests.packages.urllib3.disable_warnings(InsecureRequestWarning) + response = requests.post( self.url, timeout=self.timeout, From 185f4229b9fa94a1fe37315b86b92a4a3db7da9c Mon Sep 17 00:00:00 2001 From: Jeremiah Millay Date: Tue, 12 Oct 2021 23:34:55 -0400 Subject: [PATCH 36/60] fix typo in docs --- docs/support/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/support/index.rst b/docs/support/index.rst index c003751a0..ec22f2aed 100644 --- a/docs/support/index.rst +++ b/docs/support/index.rst @@ -133,7 +133,7 @@ ____________________________________ * :code:`secret` (ios, nxos_ssh) - Password required to enter privileged exec (enable) (default: ``''``). * :code:`ssh_config_file` (ios, iosxr, junos, nxos_ssh) - File name of OpenSSH configuration file. * :code:`ssh_strict` (ios, iosxr, nxos_ssh) - Automatically reject unknown SSH host keys (default: ``False``, which means unknown SSH host keys will be accepted). -* :code:`ssl_verify` (nxos) - Requests argument, enable the SSL certificates verification. See requests ssl-cert-verification for valide values (default: ``None`` equivalent to ``False``). +* :code:`ssl_verify` (nxos) - Requests argument, enable the SSL certificates verification. See requests ssl-cert-verification for valid values (default: ``None`` equivalent to ``False``). * :code:`transport` (eos, ios, nxos) - Protocol to connect with (see `The transport argument`_ for more information). * :code:`use_keys` (ios, iosxr, nxos_ssh) - Paramiko argument, enable searching for discoverable private key files in ``~/.ssh/`` (default: ``False``). * :code:`eos_autoComplete` (eos) - Allows to set `autoComplete` when running commands. (default: ``None`` equivalent to ``False``) From c74c4b552cdcca320d4658a737ecb1c11f7e9ca8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Oct 2021 07:42:47 +0000 Subject: [PATCH 37/60] Bump tox from 3.24.3 to 3.24.4 Bumps [tox](https://github.com/tox-dev/tox) from 3.24.3 to 3.24.4. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/master/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/3.24.3...3.24.4) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d4257bd7b..c8b46d7bc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,5 +8,5 @@ pytest-json==0.4.0 pytest-pythonpath==0.7.3 pylama==7.7.1 mock==4.0.3 -tox==3.24.3 +tox==3.24.4 mypy==0.910 From 6d672c44aedd81eb0c1b282caeb15a184a283619 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Oct 2021 07:43:32 +0000 Subject: [PATCH 38/60] Bump black from 21.6b0 to 21.9b0 Bumps [black](https://github.com/psf/black) from 21.6b0 to 21.9b0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/commits) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index c8b46d7bc..7949f21e9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -black==21.6b0 +black==21.9b0 coveralls==3.2.0 ddt==1.4.4 flake8-import-order==0.18.1 From fbf2f3f539aca8ea1f6c5de3b4b0737ec62cdb9d Mon Sep 17 00:00:00 2001 From: ubaumann Date: Wed, 13 Oct 2021 16:47:47 +0200 Subject: [PATCH 39/60] Return mtu -1 and speed -1.0 if regex does not find the data in nxos_ssh show interface --- napalm/nxos_ssh/nxos_ssh.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/napalm/nxos_ssh/nxos_ssh.py b/napalm/nxos_ssh/nxos_ssh.py index c8914d2a5..d82083559 100644 --- a/napalm/nxos_ssh/nxos_ssh.py +++ b/napalm/nxos_ssh/nxos_ssh.py @@ -164,17 +164,21 @@ def parse_intf_section(interface): if speed_exist: match = re.search(re_speed, interface, flags=re.M) - speed = float(match.group("speed")) - mtu = int(match.group("mtu")) - speed_unit = match.group("speed_unit") - speed_unit = speed_unit.rstrip(",") - # This was alway in Kbit (in the data I saw) - if speed_unit != "Kbit": - msg = "Unexpected speed unit in show interfaces parsing:\n\n{}".format( - interface - ) - raise ValueError(msg) - speed = float(speed / 1000.0) + if match: + speed = float(match.group("speed")) + mtu = int(match.group("mtu")) + speed_unit = match.group("speed_unit") + speed_unit = speed_unit.rstrip(",") + # This was alway in Kbit (in the data I saw) + if speed_unit != "Kbit": + msg = "Unexpected speed unit in show interfaces parsing:\n\n{}".format( + interface + ) + raise ValueError(msg) + speed = float(speed / 1000.0) + else: + speed = -1.0 + mtu = -1 else: speed = -1.0 From f3f8788b97e03d0d7f5ce6cb85af6c5733f9a36e Mon Sep 17 00:00:00 2001 From: Thomas Bridge Date: Thu, 14 Oct 2021 13:03:32 +0100 Subject: [PATCH 40/60] Tests to cover the cases identified in #1489 --- .../issue_1490_noutf/expected_result.json | 601 ++++++++++++++++++ .../show_vlan_brief___json.txt | 230 +++++++ .../issue_1490_utf/expected_result.json | 601 ++++++++++++++++++ .../issue_1490_utf/show_vlan_brief___json.txt | 261 ++++++++ 4 files changed, 1693 insertions(+) create mode 100644 test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_noutf/expected_result.json create mode 100644 test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_noutf/show_vlan_brief___json.txt create mode 100644 test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_utf/expected_result.json create mode 100644 test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_utf/show_vlan_brief___json.txt diff --git a/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_noutf/expected_result.json b/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_noutf/expected_result.json new file mode 100644 index 000000000..306d83d02 --- /dev/null +++ b/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_noutf/expected_result.json @@ -0,0 +1,601 @@ +{ + "1": { + "name": "default", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/15", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "161": { + "name": "Vlan161", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel34", + "Port-channel35", + "Port-channel36", + "Port-channel37", + "Port-channel38", + "Port-channel39", + "Port-channel40", + "Port-channel41", + "Port-channel42", + "Port-channel43", + "Port-channel100", + "Ethernet1/4", + "Ethernet1/5", + "Ethernet1/6", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/12", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/31", + "Ethernet1/32", + "Ethernet1/33", + "Ethernet1/35", + "Ethernet1/36", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "177": { + "name": "Vlan177", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "185": { + "name": "Vlan185", + "interfaces": [ + "Port-channel12", + "Port-channel26", + "Port-channel27", + "Port-channel28", + "Port-channel29", + "Port-channel34", + "Port-channel35", + "Port-channel37", + "Port-channel40", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/6", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/25", + "Ethernet1/26", + "Ethernet1/27", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/30", + "Ethernet1/31", + "Ethernet1/33", + "Ethernet1/36", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "186": { + "name": "Vlan186", + "interfaces": [ + "Port-channel12", + "Port-channel34", + "Port-channel35", + "Port-channel37", + "Port-channel40", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/6", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/31", + "Ethernet1/33", + "Ethernet1/36", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "187": { + "name": "Vlan187", + "interfaces": [ + "Port-channel12", + "Port-channel34", + "Port-channel35", + "Port-channel37", + "Port-channel40", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/6", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/31", + "Ethernet1/33", + "Ethernet1/36", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "188": { + "name": "Vlan188", + "interfaces": [ + "Port-channel12", + "Port-channel34", + "Port-channel35", + "Port-channel37", + "Port-channel40", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/6", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/31", + "Ethernet1/33", + "Ethernet1/36", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "189": { + "name": "Vlan189", + "interfaces": [ + "Port-channel12", + "Port-channel30", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/34", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "190": { + "name": "Vlan190", + "interfaces": [ + "Port-channel12", + "Port-channel36", + "Port-channel38", + "Port-channel39", + "Port-channel100", + "Ethernet1/4", + "Ethernet1/5", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/35", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "191": { + "name": "Vlan191", + "interfaces": [ + "Port-channel12", + "Port-channel36", + "Port-channel38", + "Port-channel39", + "Port-channel100", + "Ethernet1/4", + "Ethernet1/5", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/35", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "195": { + "name": "Vlan195", + "interfaces": [ + "Port-channel12", + "Port-channel34", + "Port-channel35", + "Port-channel37", + "Port-channel40", + "Port-channel100", + "Ethernet1/6", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/31", + "Ethernet1/33", + "Ethernet1/36", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "331": { + "name": "Vlan331", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1100": { + "name": "Vlan1100", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel31", + "Port-channel32", + "Port-channel33", + "Port-channel44", + "Port-channel45", + "Port-channel46", + "Port-channel100", + "Ethernet1/1", + "Ethernet1/2", + "Ethernet1/3", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/9", + "Ethernet1/10", + "Ethernet1/11", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1101": { + "name": "Vlan1101", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1102": { + "name": "Vlan1102", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1103": { + "name": "Vlan1103", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1104": { + "name": "Vlan1104", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1105": { + "name": "Vlan1105", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1106": { + "name": "Vlan1106", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1107": { + "name": "Vlan1107", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1108": { + "name": "Vlan1108", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1109": { + "name": "Vlan1109", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1110": { + "name": "Vlan1110", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1111": { + "name": "Vlan1111", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1112": { + "name": "Vlan1112", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1113": { + "name": "Vlan1113", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1114": { + "name": "Vlan1114", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1115": { + "name": "Vlan1115", + "interfaces": [""] + }, + "1116": { + "name": "Vlan1116", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1117": { + "name": "Vlan1117", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1118": { + "name": "Vlan1118", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1119": { + "name": "Vlan1119", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + } +} diff --git a/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_noutf/show_vlan_brief___json.txt b/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_noutf/show_vlan_brief___json.txt new file mode 100644 index 000000000..747f95113 --- /dev/null +++ b/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_noutf/show_vlan_brief___json.txt @@ -0,0 +1,230 @@ +{ + "TABLE_vlanbriefxbrief": { + "ROW_vlanbriefxbrief": [ + { + "vlanshowbr-vlanid": "1", + "vlanshowbr-vlanname": "default", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/15,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "161", + "vlanshowbr-vlanname": "Vlan161", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel34,port-channel35,port-channel36,port-channel37,port-channel38,port-channel39,port-channel40,port-channel41,port-channel42,port-channel43,port-channel100,Ethernet1/4,Ethernet1/5,Ethernet1/6,Ethernet1/7,Ethernet1/8,Ethernet1/12,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/31,Ethernet1/32,Ethernet1/33,Ethernet1/35,Ethernet1/36,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "177", + "vlanshowbr-vlanname": "Vlan177", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "185", + "vlanshowbr-vlanname": "Vlan185", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel26,port-channel27,port-channel28,port-channel29,port-channel34,port-channel35,port-channel37,port-channel40,port-channel41,port-channel42,port-channel100,Ethernet1/6,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/25,Ethernet1/26,Ethernet1/27,Ethernet1/28,Ethernet1/29,Ethernet1/30,Ethernet1/31,Ethernet1/33,Ethernet1/36,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "186", + "vlanshowbr-vlanname": "Vlan186", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel34,port-channel35,port-channel37,port-channel40,port-channel41,port-channel42,port-channel100,Ethernet1/6,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/31,Ethernet1/33,Ethernet1/36,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "187", + "vlanshowbr-vlanname": "Vlan187", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel34,port-channel35,port-channel37,port-channel40,port-channel41,port-channel42,port-channel100,Ethernet1/6,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/31,Ethernet1/33,Ethernet1/36,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "188", + "vlanshowbr-vlanname": "Vlan188", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel34,port-channel35,port-channel37,port-channel40,port-channel41,port-channel42,port-channel100,Ethernet1/6,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/31,Ethernet1/33,Ethernet1/36,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "189", + "vlanshowbr-vlanname": "Vlan189", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel30,port-channel41,port-channel42,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/34,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "190", + "vlanshowbr-vlanname": "Vlan190", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel36,port-channel38,port-channel39,port-channel100,Ethernet1/4,Ethernet1/5,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/35,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "191", + "vlanshowbr-vlanname": "Vlan191", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel36,port-channel38,port-channel39,port-channel100,Ethernet1/4,Ethernet1/5,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/35,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "195", + "vlanshowbr-vlanname": "Vlan195", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel34,port-channel35,port-channel37,port-channel40,port-channel100,Ethernet1/6,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/31,Ethernet1/33,Ethernet1/36,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "331", + "vlanshowbr-vlanname": "Vlan331", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel41,port-channel42,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1100", + "vlanshowbr-vlanname": "Vlan1100", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel31,port-channel32,port-channel33,port-channel44,port-channel45,port-channel46,port-channel100,Ethernet1/1,Ethernet1/2,Ethernet1/3,Ethernet1/7,Ethernet1/8,Ethernet1/9,Ethernet1/10,Ethernet1/11,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1101", + "vlanshowbr-vlanname": "Vlan1101", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1102", + "vlanshowbr-vlanname": "Vlan1102", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1103", + "vlanshowbr-vlanname": "Vlan1103", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1104", + "vlanshowbr-vlanname": "Vlan1104", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1105", + "vlanshowbr-vlanname": "Vlan1105", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1106", + "vlanshowbr-vlanname": "Vlan1106", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1107", + "vlanshowbr-vlanname": "Vlan1107", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1108", + "vlanshowbr-vlanname": "Vlan1108", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1109", + "vlanshowbr-vlanname": "Vlan1109", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1110", + "vlanshowbr-vlanname": "Vlan1110", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1111", + "vlanshowbr-vlanname": "Vlan1111", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1112", + "vlanshowbr-vlanname": "Vlan1112", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1113", + "vlanshowbr-vlanname": "Vlan1113", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1114", + "vlanshowbr-vlanname": "Vlan1114", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1115", + "vlanshowbr-vlanid-utf": "1115", + "vlanshowbr-vlanname": "Vlan1115", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown" + }, + { + "vlanshowbr-vlanid": "1116", + "vlanshowbr-vlanname": "Vlan1116", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1117", + "vlanshowbr-vlanname": "Vlan1117", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1118", + "vlanshowbr-vlanname": "Vlan1118", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1119", + "vlanshowbr-vlanname": "Vlan1119", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + } + ] + } +} diff --git a/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_utf/expected_result.json b/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_utf/expected_result.json new file mode 100644 index 000000000..306d83d02 --- /dev/null +++ b/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_utf/expected_result.json @@ -0,0 +1,601 @@ +{ + "1": { + "name": "default", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/15", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "161": { + "name": "Vlan161", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel34", + "Port-channel35", + "Port-channel36", + "Port-channel37", + "Port-channel38", + "Port-channel39", + "Port-channel40", + "Port-channel41", + "Port-channel42", + "Port-channel43", + "Port-channel100", + "Ethernet1/4", + "Ethernet1/5", + "Ethernet1/6", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/12", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/31", + "Ethernet1/32", + "Ethernet1/33", + "Ethernet1/35", + "Ethernet1/36", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "177": { + "name": "Vlan177", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "185": { + "name": "Vlan185", + "interfaces": [ + "Port-channel12", + "Port-channel26", + "Port-channel27", + "Port-channel28", + "Port-channel29", + "Port-channel34", + "Port-channel35", + "Port-channel37", + "Port-channel40", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/6", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/25", + "Ethernet1/26", + "Ethernet1/27", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/30", + "Ethernet1/31", + "Ethernet1/33", + "Ethernet1/36", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "186": { + "name": "Vlan186", + "interfaces": [ + "Port-channel12", + "Port-channel34", + "Port-channel35", + "Port-channel37", + "Port-channel40", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/6", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/31", + "Ethernet1/33", + "Ethernet1/36", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "187": { + "name": "Vlan187", + "interfaces": [ + "Port-channel12", + "Port-channel34", + "Port-channel35", + "Port-channel37", + "Port-channel40", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/6", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/31", + "Ethernet1/33", + "Ethernet1/36", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "188": { + "name": "Vlan188", + "interfaces": [ + "Port-channel12", + "Port-channel34", + "Port-channel35", + "Port-channel37", + "Port-channel40", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/6", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/31", + "Ethernet1/33", + "Ethernet1/36", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "189": { + "name": "Vlan189", + "interfaces": [ + "Port-channel12", + "Port-channel30", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/34", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "190": { + "name": "Vlan190", + "interfaces": [ + "Port-channel12", + "Port-channel36", + "Port-channel38", + "Port-channel39", + "Port-channel100", + "Ethernet1/4", + "Ethernet1/5", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/35", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "191": { + "name": "Vlan191", + "interfaces": [ + "Port-channel12", + "Port-channel36", + "Port-channel38", + "Port-channel39", + "Port-channel100", + "Ethernet1/4", + "Ethernet1/5", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/35", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "195": { + "name": "Vlan195", + "interfaces": [ + "Port-channel12", + "Port-channel34", + "Port-channel35", + "Port-channel37", + "Port-channel40", + "Port-channel100", + "Ethernet1/6", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/31", + "Ethernet1/33", + "Ethernet1/36", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "331": { + "name": "Vlan331", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel41", + "Port-channel42", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/28", + "Ethernet1/29", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1100": { + "name": "Vlan1100", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel31", + "Port-channel32", + "Port-channel33", + "Port-channel44", + "Port-channel45", + "Port-channel46", + "Port-channel100", + "Ethernet1/1", + "Ethernet1/2", + "Ethernet1/3", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/9", + "Ethernet1/10", + "Ethernet1/11", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1101": { + "name": "Vlan1101", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1102": { + "name": "Vlan1102", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1103": { + "name": "Vlan1103", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1104": { + "name": "Vlan1104", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1105": { + "name": "Vlan1105", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1106": { + "name": "Vlan1106", + "interfaces": [ + "Port-channel12", + "Port-channel22", + "Port-channel23", + "Port-channel24", + "Port-channel25", + "Port-channel100", + "Ethernet1/7", + "Ethernet1/8", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/37", + "Ethernet1/38", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1107": { + "name": "Vlan1107", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1108": { + "name": "Vlan1108", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1109": { + "name": "Vlan1109", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1110": { + "name": "Vlan1110", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1111": { + "name": "Vlan1111", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1112": { + "name": "Vlan1112", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1113": { + "name": "Vlan1113", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1114": { + "name": "Vlan1114", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1115": { + "name": "Vlan1115", + "interfaces": [""] + }, + "1116": { + "name": "Vlan1116", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1117": { + "name": "Vlan1117", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1118": { + "name": "Vlan1118", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + }, + "1119": { + "name": "Vlan1119", + "interfaces": [ + "Port-channel12", + "Port-channel100", + "Ethernet1/21", + "Ethernet1/22", + "Ethernet1/23", + "Ethernet1/24", + "Ethernet1/47", + "Ethernet1/48" + ] + } +} diff --git a/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_utf/show_vlan_brief___json.txt b/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_utf/show_vlan_brief___json.txt new file mode 100644 index 000000000..f92ed3064 --- /dev/null +++ b/test/nxos_ssh/mocked_data/test_get_vlans/issue_1490_utf/show_vlan_brief___json.txt @@ -0,0 +1,261 @@ +{ + "TABLE_vlanbriefxbrief": { + "ROW_vlanbriefxbrief": [ + { + "vlanshowbr-vlanid": "16777216", + "vlanshowbr-vlanid-utf": "1", + "vlanshowbr-vlanname": "default", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/15,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "2701131776", + "vlanshowbr-vlanid-utf": "161", + "vlanshowbr-vlanname": "Vlan161", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel34,port-channel35,port-channel36,port-channel37,port-channel38,port-channel39,port-channel40,port-channel41,port-channel42,port-channel43,port-channel100,Ethernet1/4,Ethernet1/5,Ethernet1/6,Ethernet1/7,Ethernet1/8,Ethernet1/12,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/31,Ethernet1/32,Ethernet1/33,Ethernet1/35,Ethernet1/36,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "29695672732", + "vlanshowbr-vlanid-utf": "177", + "vlanshowbr-vlanname": "Vlan177", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "3103784960", + "vlanshowbr-vlanid-utf": "185", + "vlanshowbr-vlanname": "Vlan185", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel26,port-channel27,port-channel28,port-channel29,port-channel34,port-channel35,port-channel37,port-channel40,port-channel41,port-channel42,port-channel100,Ethernet1/6,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/25,Ethernet1/26,Ethernet1/27,Ethernet1/28,Ethernet1/29,Ethernet1/30,Ethernet1/31,Ethernet1/33,Ethernet1/36,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "3120562176", + "vlanshowbr-vlanid-utf": "186", + "vlanshowbr-vlanname": "Vlan186", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel34,port-channel35,port-channel37,port-channel40,port-channel41,port-channel42,port-channel100,Ethernet1/6,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/31,Ethernet1/33,Ethernet1/36,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "3137338392", + "vlanshowbr-vlanid-utf": "187", + "vlanshowbr-vlanname": "Vlan187", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel34,port-channel35,port-channel37,port-channel40,port-channel41,port-channel42,port-channel100,Ethernet1/6,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/31,Ethernet1/33,Ethernet1/36,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "3154116608", + "vlanshowbr-vlanid-utf": "188", + "vlanshowbr-vlanname": "Vlan188", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel34,port-channel35,port-channel37,port-channel40,port-channel41,port-channel42,port-channel100,Ethernet1/6,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/31,Ethernet1/33,Ethernet1/36,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "3170893824", + "vlanshowbr-vlanid-utf": "189", + "vlanshowbr-vlanname": "Vlan189", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel30,port-channel41,port-channel42,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/34,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "3187671040", + "vlanshowbr-vlanid-utf": "190", + "vlanshowbr-vlanname": "Vlan190", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel36,port-channel38,port-channel39,port-channel100,Ethernet1/4,Ethernet1/5,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/35,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "3204448256", + "vlanshowbr-vlanid-utf": "191", + "vlanshowbr-vlanname": "Vlan191", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel36,port-channel38,port-channel39,port-channel100,Ethernet1/4,Ethernet1/5,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/35,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "3271557120", + "vlanshowbr-vlanid-utf": "195", + "vlanshowbr-vlanname": "Vlan195", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel34,port-channel35,port-channel37,port-channel40,port-channel100,Ethernet1/6,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/31,Ethernet1/33,Ethernet1/36,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "5553258496", + "vlanshowbr-vlanid-utf": "331", + "vlanshowbr-vlanname": "Vlan331", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel41,port-channel42,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/28,Ethernet1/29,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1275330560", + "vlanshowbr-vlanid-utf": "1100", + "vlanshowbr-vlanname": "Vlan1100", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel31,port-channel32,port-channel33,port-channel44,port-channel45,port-channel46,port-channel100,Ethernet1/1,Ethernet1/2,Ethernet1/3,Ethernet1/7,Ethernet1/8,Ethernet1/9,Ethernet1/10,Ethernet1/11,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1292107776", + "vlanshowbr-vlanid-utf": "1101", + "vlanshowbr-vlanname": "Vlan1101", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1308884992", + "vlanshowbr-vlanid-utf": "1102", + "vlanshowbr-vlanname": "Vlan1102", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1325662208", + "vlanshowbr-vlanid-utf": "1103", + "vlanshowbr-vlanname": "Vlan1103", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1342439424", + "vlanshowbr-vlanid-utf": "1104", + "vlanshowbr-vlanname": "Vlan1104", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1359216640", + "vlanshowbr-vlanid-utf": "1105", + "vlanshowbr-vlanname": "Vlan1105", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1375993856", + "vlanshowbr-vlanid-utf": "1106", + "vlanshowbr-vlanname": "Vlan1106", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel22,port-channel23,port-channel24,port-channel25,port-channel100,Ethernet1/7,Ethernet1/8,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/37,Ethernet1/38,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1392771072", + "vlanshowbr-vlanid-utf": "1107", + "vlanshowbr-vlanname": "Vlan1107", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1409548288", + "vlanshowbr-vlanid-utf": "1108", + "vlanshowbr-vlanname": "Vlan1108", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1426325504", + "vlanshowbr-vlanid-utf": "1109", + "vlanshowbr-vlanname": "Vlan1109", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1443102720", + "vlanshowbr-vlanid-utf": "1110", + "vlanshowbr-vlanname": "Vlan1110", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1459879936", + "vlanshowbr-vlanid-utf": "1111", + "vlanshowbr-vlanname": "Vlan1111", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1476657152", + "vlanshowbr-vlanid-utf": "1112", + "vlanshowbr-vlanname": "Vlan1112", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1493434368", + "vlanshowbr-vlanid-utf": "1113", + "vlanshowbr-vlanname": "Vlan1113", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1510211584", + "vlanshowbr-vlanid-utf": "1114", + "vlanshowbr-vlanname": "Vlan1114", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1526988800", + "vlanshowbr-vlanid-utf": "1115", + "vlanshowbr-vlanname": "Vlan1115", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown" + }, + { + "vlanshowbr-vlanid": "1543766016", + "vlanshowbr-vlanid-utf": "1116", + "vlanshowbr-vlanname": "Vlan1116", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1560543232", + "vlanshowbr-vlanid-utf": "1117", + "vlanshowbr-vlanname": "Vlan1117", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1577320448", + "vlanshowbr-vlanid-utf": "1118", + "vlanshowbr-vlanname": "Vlan1118", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + }, + { + "vlanshowbr-vlanid": "1594097664", + "vlanshowbr-vlanid-utf": "1119", + "vlanshowbr-vlanname": "Vlan1119", + "vlanshowbr-vlanstate": "active", + "vlanshowbr-shutstate": "noshutdown", + "vlanshowplist-ifidx": "port-channel12,port-channel100,Ethernet1/21,Ethernet1/22,Ethernet1/23,Ethernet1/24,Ethernet1/47,Ethernet1/48" + } + ] + } +} From 03bc7aacd455167b07140ea3628f3874dae13d31 Mon Sep 17 00:00:00 2001 From: ubaumann Date: Thu, 14 Oct 2021 18:22:52 +0200 Subject: [PATCH 41/60] Update nxos_ssh interface speed regex --- napalm/nxos_ssh/nxos_ssh.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/napalm/nxos_ssh/nxos_ssh.py b/napalm/nxos_ssh/nxos_ssh.py index d82083559..ad422320e 100644 --- a/napalm/nxos_ssh/nxos_ssh.py +++ b/napalm/nxos_ssh/nxos_ssh.py @@ -97,7 +97,7 @@ def parse_intf_section(interface): re_is_enabled_3 = r"^.* is down.*Administratively down.*$" re_mac = r"^\s+Hardware:\s+(?P.*),\s+address:\s+(?P\S+) " re_speed = ( - r"\s+MTU (?P\S+)\s+bytes,\s+BW\s+(?P\S+)\s+(?P\S+).*$" + r"\s+(MTU (?P\S+)\s+bytes)?,\s+BW\s+(?P\S+)\s+(?P\S+).*$" ) re_mtu_nve = r"\s+MTU (?P\S+)\s+bytes.*$" re_description_1 = r"^\s+Description:\s+(?P.*) (?:MTU|Internet)" @@ -164,21 +164,18 @@ def parse_intf_section(interface): if speed_exist: match = re.search(re_speed, interface, flags=re.M) - if match: - speed = float(match.group("speed")) - mtu = int(match.group("mtu")) - speed_unit = match.group("speed_unit") - speed_unit = speed_unit.rstrip(",") - # This was alway in Kbit (in the data I saw) - if speed_unit != "Kbit": - msg = "Unexpected speed unit in show interfaces parsing:\n\n{}".format( - interface - ) - raise ValueError(msg) - speed = float(speed / 1000.0) - else: - speed = -1.0 - mtu = -1 + speed_data = match.groupdict(-1) + speed = float(speed_data["speed"]) + mtu = int(speed_data["mtu"]) + speed_unit = speed_data["speed_unit"] + speed_unit = speed_unit.rstrip(",") + # This was alway in Kbit (in the data I saw) + if speed_unit != "Kbit": + msg = "Unexpected speed unit in show interfaces parsing:\n\n{}".format( + interface + ) + raise ValueError(msg) + speed = float(speed / 1000.0) else: speed = -1.0 From b69d8462e8e639e742c06b29c0ef668f798bb990 Mon Sep 17 00:00:00 2001 From: ubaumann Date: Thu, 14 Oct 2021 18:54:28 +0200 Subject: [PATCH 42/60] black nxos_ssh.py --- napalm/nxos_ssh/nxos_ssh.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/napalm/nxos_ssh/nxos_ssh.py b/napalm/nxos_ssh/nxos_ssh.py index ad422320e..fc5bcd590 100644 --- a/napalm/nxos_ssh/nxos_ssh.py +++ b/napalm/nxos_ssh/nxos_ssh.py @@ -96,9 +96,7 @@ def parse_intf_section(interface): re_is_enabled_2 = r"^admin state is (?P\S+), " re_is_enabled_3 = r"^.* is down.*Administratively down.*$" re_mac = r"^\s+Hardware:\s+(?P.*),\s+address:\s+(?P\S+) " - re_speed = ( - r"\s+(MTU (?P\S+)\s+bytes)?,\s+BW\s+(?P\S+)\s+(?P\S+).*$" - ) + re_speed = r"\s+(MTU (?P\S+)\s+bytes)?,\s+BW\s+(?P\S+)\s+(?P\S+).*$" re_mtu_nve = r"\s+MTU (?P\S+)\s+bytes.*$" re_description_1 = r"^\s+Description:\s+(?P.*) (?:MTU|Internet)" re_description_2 = r"^\s+Description:\s+(?P.*)$" From ac68698357df45608bb4248e295947c785f21de2 Mon Sep 17 00:00:00 2001 From: ubaumann Date: Fri, 22 Oct 2021 11:23:45 +0200 Subject: [PATCH 43/60] Add nxos get interfaces missing mtu test --- .../missing_mtu/expected_result.json | 56 +++++++ .../missing_mtu/show_interface.txt | 155 ++++++++++++++++++ 2 files changed, 211 insertions(+) create mode 100644 test/nxos_ssh/mocked_data/test_get_interfaces/missing_mtu/expected_result.json create mode 100644 test/nxos_ssh/mocked_data/test_get_interfaces/missing_mtu/show_interface.txt diff --git a/test/nxos_ssh/mocked_data/test_get_interfaces/missing_mtu/expected_result.json b/test/nxos_ssh/mocked_data/test_get_interfaces/missing_mtu/expected_result.json new file mode 100644 index 000000000..e82b4050b --- /dev/null +++ b/test/nxos_ssh/mocked_data/test_get_interfaces/missing_mtu/expected_result.json @@ -0,0 +1,56 @@ +{ + "Management0": { + "is_enabled": true, + "description": "", + "last_flapped": -1.0, + "is_up": true, + "mac_address": "2C:C2:60:12:EC:74", + "mtu": 1500, + "speed": 1000 + }, + "Ethernet2/1": { + "is_enabled": true, + "description": "Testing port descriptions", + "last_flapped": -1.0, + "is_up": true, + "mac_address": "2C:C2:60:4F:FE:B2", + "mtu": -1, + "speed": 1000 + }, + "Ethernet2/2": { + "is_enabled": true, + "description": "", + "last_flapped": -1.0, + "is_up": true, + "mac_address": "2C:C2:60:4F:FE:B2", + "mtu": -1, + "speed": 1000 + }, + "Loopback0": { + "is_enabled": true, + "description": "", + "last_flapped": -1.0, + "is_up": true, + "mac_address": "", + "mtu": 1500, + "speed": 8000 + }, + "Loopback55": { + "is_enabled": true, + "description": "", + "last_flapped": -1.0, + "is_up": true, + "mac_address": "", + "mtu": -1, + "speed": 8000 + }, + "Vlan1": { + "is_enabled": false, + "description": "", + "last_flapped": -1.0, + "is_up": false, + "mac_address": "", + "mtu": -1, + "speed": 1000 + } +} diff --git a/test/nxos_ssh/mocked_data/test_get_interfaces/missing_mtu/show_interface.txt b/test/nxos_ssh/mocked_data/test_get_interfaces/missing_mtu/show_interface.txt new file mode 100644 index 000000000..bb7adbf6d --- /dev/null +++ b/test/nxos_ssh/mocked_data/test_get_interfaces/missing_mtu/show_interface.txt @@ -0,0 +1,155 @@ +mgmt0 is up +admin state is up + Hardware: Ethernet, address: 2cc2.6012.ec74 (bia 2cc2.6012.ec74) + Internet Address is 10.0.0.71/24 + MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec + reliability 245/255, txload 1/255, rxload 1/255 + Encapsulation ARPA, medium is broadcast + Port mode is routed + full-duplex, 1000 Mb/s + Auto-Negotiation is turned on + Auto-mdix is turned off + EtherType is 0x0000 + 1 minute input rate 7208 bits/sec, 8 packets/sec + 1 minute output rate 28432 bits/sec, 10 packets/sec + Rx + 2322661 input packets 2284638 unicast packets 38022 multicast packets + 1 broadcast packets 260628011 bytes + Tx + 2084700 output packets 2046680 unicast packets 38018 multicast packets + 2 broadcast packets 472741923 bytes +Ethernet2/1 is up +admin state is up, Dedicated Interface + Hardware: Ethernet, address: 2cc2.604f.feb2 (bia 2cc2.605e.5dba) + Description: Testing port descriptions + Internet Address is 10.10.10.10/24 +, BW 1000000 Kbit, DLY 10 usec + reliability 255/255, txload 1/255, rxload 1/255 + Encapsulation ARPA, medium is broadcast + Port mode is routed + full-duplex, 1000 Mb/s + Beacon is turned off + Auto-Negotiation is turned off + Input flow-control is off, output flow-control is off + Auto-mdix is turned off + Switchport monitor is off + EtherType is 0x8100 + EEE (efficient-ethernet) : n/a + Last link flapped 3week(s) 5day(s) + Last clearing of "show interface" counters never + 1 interface resets + Load-Interval #1: 0 seconds + 0 seconds input rate 0 bits/sec, 0 packets/sec + 0 seconds output rate 0 bits/sec, 0 packets/sec + input rate 0 bps, 0 pps; output rate 0 bps, 0 pps + Load-Interval #2: 0 seconds + 0 seconds input rate 0 bits/sec, 0 packets/sec + 0 seconds output rate 0 bits/sec, 0 packets/sec + input rate 0 bps, 0 pps; output rate 0 bps, 0 pps + RX + 0 unicast packets 0 multicast packets 0 broadcast packets + 0 input packets 0 bytes + 0 jumbo packets 0 storm suppression packets + 0 runts 0 giants 0 CRC/FCS 0 no buffer + 0 input error 0 short frame 0 overrun 0 underrun 0 ignored + 0 watchdog 0 bad etype drop 0 bad proto drop 0 if down drop + 0 input with dribble 0 input discard + 0 Rx pause + TX + 0 unicast packets 0 multicast packets 0 broadcast packets + 0 output packets 0 bytes + 0 jumbo packets + 0 output error 0 collision 0 deferred 0 late collision + 0 lost carrier 0 no carrier 0 babble 0 output discard + 0 Tx pause +Ethernet2/2 is up +admin state is up, Dedicated Interface + Hardware: Ethernet, address: 2cc2.604f.feb2 (bia 2cc2.602f.90f4) + Internet Address is 10.100.100.1/24 +, BW 1000000 Kbit, DLY 10 usec + reliability 255/255, txload 1/255, rxload 1/255 + Encapsulation ARPA, medium is broadcast + Port mode is routed + full-duplex, 1000 Mb/s + Beacon is turned off + Auto-Negotiation is turned off + Input flow-control is off, output flow-control is off + Auto-mdix is turned off + Switchport monitor is off + EtherType is 0x8100 + EEE (efficient-ethernet) : n/a + Last link flapped 3week(s) 5day(s) + Last clearing of "show interface" counters never + 1 interface resets + Load-Interval #1: 0 seconds + 0 seconds input rate 0 bits/sec, 0 packets/sec + 0 seconds output rate 0 bits/sec, 0 packets/sec + input rate 0 bps, 0 pps; output rate 0 bps, 0 pps + Load-Interval #2: 0 seconds + 0 seconds input rate 0 bits/sec, 0 packets/sec + 0 seconds output rate 0 bits/sec, 0 packets/sec + input rate 0 bps, 0 pps; output rate 0 bps, 0 pps + RX + 0 unicast packets 0 multicast packets 0 broadcast packets + 0 input packets 0 bytes + 0 jumbo packets 0 storm suppression packets + 0 runts 0 giants 0 CRC/FCS 0 no buffer + 0 input error 0 short frame 0 overrun 0 underrun 0 ignored + 0 watchdog 0 bad etype drop 0 bad proto drop 0 if down drop + 0 input with dribble 0 input discard + 0 Rx pause + TX + 0 unicast packets 0 multicast packets 0 broadcast packets + 0 output packets 0 bytes + 0 jumbo packets + 0 output error 0 collision 0 deferred 0 late collision + 0 lost carrier 0 no carrier 0 babble 0 output discard + 0 Tx pause +loopback0 is up +admin state is up + Hardware: Loopback + Internet Address is 1.1.2.225/32 + MTU 1500 bytes, BW 8000000 Kbit, DLY 5000 usec + reliability 255/255, txload 1/255, rxload 1/255 + Encapsulation LOOPBACK, medium is broadcast + Port mode is routed + Auto-mdix is turned off + 0 packets input 0 bytes + 0 multicast frames 0 compressed + 0 input errors 0 frame 0 overrun 0 fifo + 0 packets output 0 bytes 0 underruns + 0 output errors 0 collisions 0 fifo + 0 out_carrier_errors +loopback55 is up +admin state is up + Hardware: Loopback + Internet Address is 1.1.1.37/24 +, BW 8000000 Kbit, DLY 5000 usec + reliability 255/255, txload 1/255, rxload 1/255 + Encapsulation LOOPBACK, medium is broadcast + Port mode is routed + Auto-mdix is turned off + 0 packets input 0 bytes + 0 multicast frames 0 compressed + 0 input errors 0 frame 0 overrun 0 fifo + 0 packets output 0 bytes 0 underruns + 0 output errors 0 collisions 0 fifo + 0 out_carrier_errors +Vlan1 is down (Administratively down), line protocol is down, autostate enabled + Hardware is EtherSVI, address is 2cc2.605e.5de8 +, BW 1000000 Kbit, DLY 10 usec, + reliability 255/255, txload 1/255, rxload 1/255 + Encapsulation ARPA, loopback not set + Keepalive not supported + ARP type: ARPA + Last clearing of "show interface" counters never + 60 seconds input rate 0 bits/sec, 0 packets/sec + 60 seconds output rate 0 bits/sec, 0 packets/sec + Load-Interval #2: 5 minute (300 seconds) + input rate 0 bps, 0 pps; output rate 0 bps, 0 pps + L3 Switched: + input: 0 pkts, 0 bytes - output: 0 pkts, 0 bytes + L3 in Switched: + ucast: 0 pkts, 0 bytes - mcast: 0 pkts, 0 bytes + L3 out Switched: + ucast: 0 pkts, 0 bytes - mcast: 0 pkts, 0 bytes From e5f40cfa3a5c8f83e739c97bdf8f7a6f0fafd3df Mon Sep 17 00:00:00 2001 From: shenganzhang <51085557+shenganzhang@users.noreply.github.com> Date: Thu, 4 Nov 2021 00:36:00 -0500 Subject: [PATCH 44/60] Update test_unit.py --- test/base/validate/test_unit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/base/validate/test_unit.py b/test/base/validate/test_unit.py index d9654f6e2..7f831eddf 100644 --- a/test/base/validate/test_unit.py +++ b/test/base/validate/test_unit.py @@ -1,5 +1,6 @@ """Tests for the validate methods.""" import pytest +import copy from napalm.base import validate @@ -403,7 +404,7 @@ class TestValidate: @pytest.mark.parametrize("src, dst, result", _compare_getter) def test__compare_getter_list(self, src, dst, result): """Test for _compare_getter_list.""" - assert validate.compare(src, dst) == result + assert validate.compare(copy.deepcopy(src), copy.deepcopy(dst)) == copy.deepcopy(result) def test_numeric_comparison(self): assert validate._compare_numeric("<2", 1) From d4061d7c9ee5003bc6d2733f7d265862a8f5370f Mon Sep 17 00:00:00 2001 From: Kirk Byers Date: Mon, 15 Nov 2021 11:28:19 -0800 Subject: [PATCH 45/60] Pin Netmiko to Netmiko version 3 (#1513) --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b9c30b48c..539088f0d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ jinja2 netaddr pyYAML pyeapi>=0.8.2 -netmiko>=3.1.0 +netmiko>=3.3.0,<4.0.0 junos-eznc>=2.2.1 ciscoconfparse scp From 86a0155b02b4d130135224e307599bb1b9f76581 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Nov 2021 15:10:56 +0000 Subject: [PATCH 46/60] Bump black from 21.9b0 to 21.11b1 Bumps [black](https://github.com/psf/black) from 21.9b0 to 21.11b1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/commits) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7949f21e9..d87a9adf6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -black==21.9b0 +black==21.11b1 coveralls==3.2.0 ddt==1.4.4 flake8-import-order==0.18.1 From 689ab2f28154beba3c27c3b218147ddf3c6bacf4 Mon Sep 17 00:00:00 2001 From: Eldon Koyle Date: Tue, 23 Nov 2021 13:59:16 -0700 Subject: [PATCH 47/60] if we are ignoring warnings, also ignore them on discard --- napalm/junos/junos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py index 37f6ba4db..3fc36d28c 100644 --- a/napalm/junos/junos.py +++ b/napalm/junos/junos.py @@ -383,7 +383,7 @@ def confirm_commit(self): def discard_config(self): """Discard changes (rollback 0).""" - self.device.cu.rollback(rb_id=0) + self.device.cu.rollback(rb_id=0, ignore_warning=self.ignore_warning) if not self.lock_disable and not self.session_config_lock: self._unlock() if self.config_private: From 4d53d1d4a10da841736229fc624fa47cd6ba0829 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Nov 2021 09:10:34 +0000 Subject: [PATCH 48/60] Bump coveralls from 3.2.0 to 3.3.1 Bumps [coveralls](https://github.com/TheKevJames/coveralls-python) from 3.2.0 to 3.3.1. - [Release notes](https://github.com/TheKevJames/coveralls-python/releases) - [Changelog](https://github.com/TheKevJames/coveralls-python/blob/master/CHANGELOG.md) - [Commits](https://github.com/TheKevJames/coveralls-python/compare/3.2.0...3.3.1) --- updated-dependencies: - dependency-name: coveralls dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d87a9adf6..f7b3077f1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,5 @@ black==21.11b1 -coveralls==3.2.0 +coveralls==3.3.1 ddt==1.4.4 flake8-import-order==0.18.1 pytest==5.4.3 From 85a82096c1b22fdc6fa4dbed23b807823c7a731a Mon Sep 17 00:00:00 2001 From: Shengan Zhang Date: Thu, 2 Dec 2021 17:02:08 -0600 Subject: [PATCH 49/60] reformat by black --- test/base/validate/test_unit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/base/validate/test_unit.py b/test/base/validate/test_unit.py index 7f831eddf..08b333f39 100644 --- a/test/base/validate/test_unit.py +++ b/test/base/validate/test_unit.py @@ -404,7 +404,9 @@ class TestValidate: @pytest.mark.parametrize("src, dst, result", _compare_getter) def test__compare_getter_list(self, src, dst, result): """Test for _compare_getter_list.""" - assert validate.compare(copy.deepcopy(src), copy.deepcopy(dst)) == copy.deepcopy(result) + assert validate.compare( + copy.deepcopy(src), copy.deepcopy(dst) + ) == copy.deepcopy(result) def test_numeric_comparison(self): assert validate._compare_numeric("<2", 1) From d2bc808d4f6480df6b5e9ef3cfa6101ce7b54478 Mon Sep 17 00:00:00 2001 From: OsirisS13 Date: Mon, 20 Dec 2021 14:57:33 +1000 Subject: [PATCH 50/60] Add support for optional_args to iosxr_netconf.py Added the ability to pass in optional arguments to the iosxr_netconf driver. Note these are used as supplied and not passed through the netmiko_helpers base function. --- napalm/iosxr_netconf/iosxr_netconf.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/napalm/iosxr_netconf/iosxr_netconf.py b/napalm/iosxr_netconf/iosxr_netconf.py index 654ae31cc..b43692f10 100644 --- a/napalm/iosxr_netconf/iosxr_netconf.py +++ b/napalm/iosxr_netconf/iosxr_netconf.py @@ -69,6 +69,7 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None) if optional_args is None: optional_args = {} + self.netmiko_optional_args = optional_args self.port = optional_args.get("port", 830) self.lock_on_connect = optional_args.get("config_lock", False) self.key_file = optional_args.get("key_file", None) @@ -91,6 +92,7 @@ def open(self): key_filename=self.key_file, timeout=self.timeout, device_params={"name": "iosxr"}, + **self.netmiko_optional_args, ) if self.lock_on_connect: self._lock() @@ -442,7 +444,7 @@ def get_interfaces(self): "is_up": False, "mac_address": "", "description": "", - "speed": -1.0, + "speed": -1, "last_flapped": -1.0, } @@ -489,15 +491,14 @@ def get_interfaces(self): napalm.base.helpers.mac, raw_mac, raw_mac ) speed = napalm.base.helpers.convert( - float, + int, napalm.base.helpers.convert( - float, + int, self._find_txt(interface_tree, "./int:bandwidth", namespaces=C.NS), 0, ) * 1e-3, ) - mtu = int( self._find_txt(interface_tree, "./int:mtu", default="", namespaces=C.NS) ) From 1e8a049d1fe091bcb033eabc7c793207d3bffa4e Mon Sep 17 00:00:00 2001 From: icovada Date: Sun, 23 Jan 2022 19:49:20 +0100 Subject: [PATCH 51/60] Escape vlan_name before building regex string (#1546) Co-authored-by: icovada --- napalm/ios/ios.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/napalm/ios/ios.py b/napalm/ios/ios.py index 7a90ccb02..bc8ddf6ad 100644 --- a/napalm/ios/ios.py +++ b/napalm/ios/ios.py @@ -3598,7 +3598,7 @@ def _get_vlan_from_id(self): for vlan_id, vlan_name in find_vlan: output = self._send_command("show vlan id {}".format(vlan_id)) interface_regex = r"{}\s+{}\s+\S+\s+([A-Z][a-z].*)$".format( - vlan_id, vlan_name + vlan_id, re.escape(vlan_name) ) interfaces = re.findall(interface_regex, output, re.MULTILINE) if len(interfaces) == 1: From cbae1b9a1b029216d6e864a7b85c9a5e4c226fa1 Mon Sep 17 00:00:00 2001 From: DavidVentura Date: Tue, 25 Jan 2022 21:45:11 +0100 Subject: [PATCH 52/60] Fix #1547 --- napalm/ios/ios.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/napalm/ios/ios.py b/napalm/ios/ios.py index bc8ddf6ad..6bbdc8299 100644 --- a/napalm/ios/ios.py +++ b/napalm/ios/ios.py @@ -3427,6 +3427,10 @@ def get_network_instances(self, name=""): else: return instances + if "Invalid input detected" in sh_vrf_detail: + # No VRF support + return instances + for vrf in sh_vrf_detail.split("\n\n"): first_part = vrf.split("Address family")[0] From 2c73a3af1e793b4142bd6ea05e009f2b1e7a62bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Feb 2022 16:34:46 +0000 Subject: [PATCH 53/60] Bump pytest-pythonpath from 0.7.3 to 0.7.4 Bumps [pytest-pythonpath](https://github.com/bigsassy/pytest-pythonpath) from 0.7.3 to 0.7.4. - [Release notes](https://github.com/bigsassy/pytest-pythonpath/releases) - [Commits](https://github.com/bigsassy/pytest-pythonpath/commits) --- updated-dependencies: - dependency-name: pytest-pythonpath dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index f7b3077f1..672e35301 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,7 +5,7 @@ flake8-import-order==0.18.1 pytest==5.4.3 pytest-cov==3.0.0 pytest-json==0.4.0 -pytest-pythonpath==0.7.3 +pytest-pythonpath==0.7.4 pylama==7.7.1 mock==4.0.3 tox==3.24.4 From c5bd6ad8dd9460616cbc5bd6a80b34ca07e1c33d Mon Sep 17 00:00:00 2001 From: OsirisS13 Date: Fri, 11 Feb 2022 15:03:18 +1000 Subject: [PATCH 54/60] Revert minor formatting changes in iosxr_netconf.py --- napalm/iosxr_netconf/iosxr_netconf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/napalm/iosxr_netconf/iosxr_netconf.py b/napalm/iosxr_netconf/iosxr_netconf.py index b43692f10..8f64151ac 100644 --- a/napalm/iosxr_netconf/iosxr_netconf.py +++ b/napalm/iosxr_netconf/iosxr_netconf.py @@ -444,7 +444,7 @@ def get_interfaces(self): "is_up": False, "mac_address": "", "description": "", - "speed": -1, + "speed": -1.0, "last_flapped": -1.0, } @@ -491,9 +491,9 @@ def get_interfaces(self): napalm.base.helpers.mac, raw_mac, raw_mac ) speed = napalm.base.helpers.convert( - int, + float, napalm.base.helpers.convert( - int, + float, self._find_txt(interface_tree, "./int:bandwidth", namespaces=C.NS), 0, ) From e8a38cbacbd728ceab2cfaebdba0409f411c334b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Feb 2022 16:20:25 +0000 Subject: [PATCH 55/60] Bump mypy from 0.910 to 0.931 Bumps [mypy](https://github.com/python/mypy) from 0.910 to 0.931. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.910...v0.931) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 672e35301..01911af13 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -9,4 +9,4 @@ pytest-pythonpath==0.7.4 pylama==7.7.1 mock==4.0.3 tox==3.24.4 -mypy==0.910 +mypy==0.931 From dc8a58552bd7b12576776439f2088d3db110454b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Feb 2022 16:55:05 +0000 Subject: [PATCH 56/60] Bump tox from 3.24.4 to 3.24.5 Bumps [tox](https://github.com/tox-dev/tox) from 3.24.4 to 3.24.5. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/master/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/3.24.4...3.24.5) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 01911af13..7ccb27df2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,5 +8,5 @@ pytest-json==0.4.0 pytest-pythonpath==0.7.4 pylama==7.7.1 mock==4.0.3 -tox==3.24.4 +tox==3.24.5 mypy==0.931 From a0117431f678776478713c7b40932d065648fcbd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Feb 2022 17:02:20 +0000 Subject: [PATCH 57/60] Bump tox from 3.23.1 to 3.24.3 Bumps [tox](https://github.com/tox-dev/tox) from 3.23.1 to 3.24.3. - [Release notes](https://github.com/tox-dev/tox/releases) - [Changelog](https://github.com/tox-dev/tox/blob/master/docs/changelog.rst) - [Commits](https://github.com/tox-dev/tox/compare/3.23.1...3.24.3) --- updated-dependencies: - dependency-name: tox dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 7ccb27df2..6f238e0c3 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -black==21.11b1 +black==22.1.0 coveralls==3.3.1 ddt==1.4.4 flake8-import-order==0.18.1 From 88480c24d4c8f344aa6d960dd96550602a14539b Mon Sep 17 00:00:00 2001 From: Mircea Ulinic Date: Sat, 12 Feb 2022 17:05:14 +0000 Subject: [PATCH 58/60] Black format for version 22.1.0 --- docs/conf.py | 8 +- test/base/validate/test_unit.py | 378 ++++++++++++++++---------------- 2 files changed, 193 insertions(+), 193 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 06e9baed6..cf56e0537 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -213,7 +213,7 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ("index", "napalm.tex", u"NAPALM Documentation", u"David Barroso", "manual") + ("index", "napalm.tex", "NAPALM Documentation", "David Barroso", "manual") ] # The name of an image file (relative to this directory) to place at the top of @@ -241,7 +241,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). -man_pages = [("index", "napalm", u"NAPALM Documentation", [u"David Barroso"], 1)] +man_pages = [("index", "napalm", "NAPALM Documentation", ["David Barroso"], 1)] # If true, show URL addresses after external links. # man_show_urls = False @@ -256,8 +256,8 @@ ( "index", "napalm", - u"NAPALM Documentation", - u"David Barroso", + "NAPALM Documentation", + "David Barroso", "napalm", "One line description of project.", "Miscellaneous", diff --git a/test/base/validate/test_unit.py b/test/base/validate/test_unit.py index 08b333f39..108862994 100644 --- a/test/base/validate/test_unit.py +++ b/test/base/validate/test_unit.py @@ -8,96 +8,96 @@ ( {"list": [r"\d{2}", 1, 2]}, [1, 2, 33], - {u"complies": True, u"extra": [], u"missing": [], u"present": [r"\d{2}", 1, 2]}, + {"complies": True, "extra": [], "missing": [], "present": [r"\d{2}", 1, 2]}, ), ( {"list": [1, 2, 3]}, [1, 2, 3, 4, 5], - {u"complies": True, u"extra": [], u"missing": [], u"present": [1, 2, 3]}, + {"complies": True, "extra": [], "missing": [], "present": [1, 2, 3]}, ), ( {"list": [2, 1, 3]}, [3, 2, 1], - {u"complies": True, u"extra": [], u"missing": [], u"present": [2, 1, 3]}, + {"complies": True, "extra": [], "missing": [], "present": [2, 1, 3]}, ), ( {"list": [1, 2, {"list": [1, 2]}]}, [1, 2, [1, 2]], # {u'complies': True, u'extra': [], u'missing': [], u'present': [1, 2, [1, 2]]} { - u"complies": True, - u"extra": [], - u"missing": [], - u"present": [1, 2, {"list": [1, 2]}], + "complies": True, + "extra": [], + "missing": [], + "present": [1, 2, {"list": [1, 2]}], }, ), ( {"list": [r"\d{2}", 4, 3]}, [1, 2, 3], - {u"complies": False, u"extra": [], u"missing": [r"\d{2}", 4], u"present": [3]}, + {"complies": False, "extra": [], "missing": [r"\d{2}", 4], "present": [3]}, ), ( {"list": [{"list": [1, 2]}, 3]}, [1, 2, 3], { - u"complies": False, - u"extra": [], - u"missing": [{"list": [1, 2]}], - u"present": [3], + "complies": False, + "extra": [], + "missing": [{"list": [1, 2]}], + "present": [3], }, ), ( {"_mode": "strict", "list": [1, 2, 3]}, [1, 2, 3], - {u"complies": True, u"extra": [], u"missing": [], u"present": [1, 2, 3]}, + {"complies": True, "extra": [], "missing": [], "present": [1, 2, 3]}, ), ( {"_mode": "strict", "list": [1, 2, 3]}, [1, 2, 3, 4, 5], - {u"complies": False, u"extra": [4, 5], u"missing": [], u"present": [1, 2, 3]}, + {"complies": False, "extra": [4, 5], "missing": [], "present": [1, 2, 3]}, ), ( {"_mode": "strict", "list": [2, 1, 3]}, [3, 2, 1], - {u"complies": True, u"extra": [], u"missing": [], u"present": [2, 1, 3]}, + {"complies": True, "extra": [], "missing": [], "present": [2, 1, 3]}, ), ( {"_mode": "strict", "list": [1, 2, {"_mode": "strict", "list": [1, 2]}]}, [1, 2, [1, 2]], # {u'complies': True, u'extra': [], u'missing': [], u'present': [1, 2, [1, 2]]} { - u"complies": True, - u"extra": [], - u"missing": [], - u"present": [1, 2, {"list": [1, 2]}], + "complies": True, + "extra": [], + "missing": [], + "present": [1, 2, {"list": [1, 2]}], }, ), ( {"_mode": "strict", "list": [4, 3]}, [1, 2, 3], - {u"complies": False, u"extra": [1, 2], u"missing": [4], u"present": [3]}, + {"complies": False, "extra": [1, 2], "missing": [4], "present": [3]}, ), ( {"_mode": "strict", "list": [{"_mode": "strict", "list": [1, 2]}, 3]}, [1, 2, 3], { - u"complies": False, - u"extra": [1, 2], - u"missing": [{"list": [1, 2]}], - u"present": [3], + "complies": False, + "extra": [1, 2], + "missing": [{"list": [1, 2]}], + "present": [3], }, ), ( {"a": 1, "b": 2, "c": 3}, {"a": 1, "b": 2, "c": 3}, { - u"complies": True, - u"extra": [], - u"missing": [], - u"present": { - "a": {u"complies": True, u"nested": False}, - "b": {u"complies": True, u"nested": False}, - "c": {u"complies": True, u"nested": False}, + "complies": True, + "extra": [], + "missing": [], + "present": { + "a": {"complies": True, "nested": False}, + "b": {"complies": True, "nested": False}, + "c": {"complies": True, "nested": False}, }, }, ), @@ -105,18 +105,18 @@ {"a": 1, "b": 2, "c": 3}, {"a": 2, "b": 2, "c": 3}, { - u"complies": False, - u"extra": [], - u"missing": [], - u"present": { + "complies": False, + "extra": [], + "missing": [], + "present": { "a": { - u"actual_value": 2, - u"expected_value": 1, - u"complies": False, - u"nested": False, + "actual_value": 2, + "expected_value": 1, + "complies": False, + "nested": False, }, - "b": {u"complies": True, u"nested": False}, - "c": {u"complies": True, u"nested": False}, + "b": {"complies": True, "nested": False}, + "c": {"complies": True, "nested": False}, }, }, ), @@ -124,17 +124,17 @@ {"a": 1, "b": 2, "c": 3}, {"b": 1, "c": 3}, { - u"complies": False, - u"extra": [], - u"missing": ["a"], - u"present": { + "complies": False, + "extra": [], + "missing": ["a"], + "present": { "b": { - u"actual_value": 1, - u"expected_value": 2, - u"complies": False, - u"nested": False, + "actual_value": 1, + "expected_value": 2, + "complies": False, + "nested": False, }, - "c": {u"complies": True, u"nested": False}, + "c": {"complies": True, "nested": False}, }, }, ), @@ -142,13 +142,13 @@ {"a": 1, "b": 2, "c": {"A": 1, "B": 2}}, {"a": 1, "b": 2, "c": {"A": 1, "B": 2}}, { - u"complies": True, - u"extra": [], - u"missing": [], - u"present": { - "a": {u"complies": True, u"nested": False}, - "b": {u"complies": True, u"nested": False}, - "c": {u"complies": True, u"nested": True}, + "complies": True, + "extra": [], + "missing": [], + "present": { + "a": {"complies": True, "nested": False}, + "b": {"complies": True, "nested": False}, + "c": {"complies": True, "nested": True}, }, }, ), @@ -156,12 +156,12 @@ {"a": 1, "b": 2, "c": {"A": 1, "B": 2}}, {"a": 1, "b": 2, "d": {"A": 1, "B": 2}}, { - u"complies": False, - u"extra": [], - u"missing": ["c"], - u"present": { - "a": {u"complies": True, u"nested": False}, - "b": {u"complies": True, u"nested": False}, + "complies": False, + "extra": [], + "missing": ["c"], + "present": { + "a": {"complies": True, "nested": False}, + "b": {"complies": True, "nested": False}, }, }, ), @@ -169,29 +169,29 @@ {"a": 1, "b": 2, "c": {"A": 3, "B": 2}}, {"a": 1, "b": 2, "c": {"A": 1, "B": 2}}, { - u"complies": False, - u"extra": [], - u"missing": [], - u"present": { - "a": {u"complies": True, u"nested": False}, - "b": {u"complies": True, u"nested": False}, + "complies": False, + "extra": [], + "missing": [], + "present": { + "a": {"complies": True, "nested": False}, + "b": {"complies": True, "nested": False}, "c": { - u"complies": False, - u"diff": { - u"complies": False, - u"extra": [], - u"missing": [], - u"present": { + "complies": False, + "diff": { + "complies": False, + "extra": [], + "missing": [], + "present": { "A": { - u"actual_value": 1, - u"expected_value": 3, - u"complies": False, - u"nested": False, + "actual_value": 1, + "expected_value": 3, + "complies": False, + "nested": False, }, - "B": {u"complies": True, u"nested": False}, + "B": {"complies": True, "nested": False}, }, }, - u"nested": True, + "nested": True, }, }, }, @@ -200,28 +200,28 @@ {"a": 1, "b": 2, "c": {"A": 3, "B": 2}}, {"a": 1, "b": 2, "c": {"A": 1}}, { - u"complies": False, - u"extra": [], - u"missing": [], - u"present": { - "a": {u"complies": True, u"nested": False}, - "b": {u"complies": True, u"nested": False}, + "complies": False, + "extra": [], + "missing": [], + "present": { + "a": {"complies": True, "nested": False}, + "b": {"complies": True, "nested": False}, "c": { - u"complies": False, - u"diff": { - u"complies": False, - u"extra": [], - u"missing": ["B"], - u"present": { + "complies": False, + "diff": { + "complies": False, + "extra": [], + "missing": ["B"], + "present": { "A": { - u"actual_value": 1, - u"expected_value": 3, - u"complies": False, - u"nested": False, + "actual_value": 1, + "expected_value": 3, + "complies": False, + "nested": False, } }, }, - u"nested": True, + "nested": True, }, }, }, @@ -230,13 +230,13 @@ {"_mode": "strict", "a": 1, "b": 2, "c": 3}, {"a": 1, "b": 2, "c": 3}, { - u"complies": True, - u"extra": [], - u"missing": [], - u"present": { - "a": {u"complies": True, u"nested": False}, - "b": {u"complies": True, u"nested": False}, - "c": {u"complies": True, u"nested": False}, + "complies": True, + "extra": [], + "missing": [], + "present": { + "a": {"complies": True, "nested": False}, + "b": {"complies": True, "nested": False}, + "c": {"complies": True, "nested": False}, }, }, ), @@ -244,18 +244,18 @@ {"_mode": "strict", "a": 1, "b": 2, "c": 3}, {"a": 2, "b": 2, "c": 3}, { - u"complies": False, - u"extra": [], - u"missing": [], - u"present": { + "complies": False, + "extra": [], + "missing": [], + "present": { "a": { - u"actual_value": 2, - u"expected_value": 1, - u"complies": False, - u"nested": False, + "actual_value": 2, + "expected_value": 1, + "complies": False, + "nested": False, }, - "b": {u"complies": True, u"nested": False}, - "c": {u"complies": True, u"nested": False}, + "b": {"complies": True, "nested": False}, + "c": {"complies": True, "nested": False}, }, }, ), @@ -263,17 +263,17 @@ {"_mode": "strict", "a": 1, "b": 2, "c": 3}, {"b": 1, "c": 3}, { - u"complies": False, - u"extra": [], - u"missing": ["a"], - u"present": { + "complies": False, + "extra": [], + "missing": ["a"], + "present": { "b": { - u"actual_value": 1, - u"expected_value": 2, - u"complies": False, - u"nested": False, + "actual_value": 1, + "expected_value": 2, + "complies": False, + "nested": False, }, - "c": {u"complies": True, u"nested": False}, + "c": {"complies": True, "nested": False}, }, }, ), @@ -281,13 +281,13 @@ {"_mode": "strict", "a": 1, "b": 2, "c": {"_mode": "strict", "A": 1, "B": 2}}, {"a": 1, "b": 2, "c": {"A": 1, "B": 2}}, { - u"complies": True, - u"extra": [], - u"missing": [], - u"present": { - "a": {u"complies": True, u"nested": False}, - "b": {u"complies": True, u"nested": False}, - "c": {u"complies": True, u"nested": True}, + "complies": True, + "extra": [], + "missing": [], + "present": { + "a": {"complies": True, "nested": False}, + "b": {"complies": True, "nested": False}, + "c": {"complies": True, "nested": True}, }, }, ), @@ -295,12 +295,12 @@ {"_mode": "strict", "a": 1, "b": 2, "c": {"_mode": "strict", "A": 1, "B": 2}}, {"a": 1, "b": 2, "d": {"A": 1, "B": 2}}, { - u"complies": False, - u"extra": ["d"], - u"missing": ["c"], - u"present": { - "a": {u"complies": True, u"nested": False}, - "b": {u"complies": True, u"nested": False}, + "complies": False, + "extra": ["d"], + "missing": ["c"], + "present": { + "a": {"complies": True, "nested": False}, + "b": {"complies": True, "nested": False}, }, }, ), @@ -308,29 +308,29 @@ {"_mode": "strict", "a": 1, "b": 2, "c": {"_mode": "strict", "A": 3, "B": 2}}, {"a": 1, "b": 2, "c": {"A": 1, "B": 2}}, { - u"complies": False, - u"extra": [], - u"missing": [], - u"present": { - "a": {u"complies": True, u"nested": False}, - "b": {u"complies": True, u"nested": False}, + "complies": False, + "extra": [], + "missing": [], + "present": { + "a": {"complies": True, "nested": False}, + "b": {"complies": True, "nested": False}, "c": { - u"complies": False, - u"diff": { - u"complies": False, - u"extra": [], - u"missing": [], - u"present": { + "complies": False, + "diff": { + "complies": False, + "extra": [], + "missing": [], + "present": { "A": { - u"actual_value": 1, - u"expected_value": 3, - u"complies": False, - u"nested": False, + "actual_value": 1, + "expected_value": 3, + "complies": False, + "nested": False, }, - "B": {u"complies": True, u"nested": False}, + "B": {"complies": True, "nested": False}, }, }, - u"nested": True, + "nested": True, }, }, }, @@ -339,28 +339,28 @@ {"_mode": "strict", "a": 1, "b": 2, "c": {"_mode": "strict", "A": 3, "B": 2}}, {"a": 1, "b": 2, "c": {"A": 1, "C": 4}}, { - u"complies": False, - u"extra": [], - u"missing": [], - u"present": { - "a": {u"complies": True, u"nested": False}, - "b": {u"complies": True, u"nested": False}, + "complies": False, + "extra": [], + "missing": [], + "present": { + "a": {"complies": True, "nested": False}, + "b": {"complies": True, "nested": False}, "c": { - u"complies": False, - u"diff": { - u"complies": False, - u"extra": ["C"], - u"missing": ["B"], - u"present": { + "complies": False, + "diff": { + "complies": False, + "extra": ["C"], + "missing": ["B"], + "present": { "A": { - u"actual_value": 1, - u"expected_value": 3, - u"complies": False, - u"nested": False, + "actual_value": 1, + "expected_value": 3, + "complies": False, + "nested": False, } }, }, - u"nested": True, + "nested": True, }, }, }, @@ -369,28 +369,28 @@ {"_mode": "strict", "a": 1, "b": 2, "c": {"_mode": "strict", "A": 3, "B": 2}}, {"a": 1, "b": 2, "c": {"A": 1, "C": 4}}, { - u"complies": False, - u"extra": [], - u"missing": [], - u"present": { - "a": {u"complies": True, u"nested": False}, - "b": {u"complies": True, u"nested": False}, + "complies": False, + "extra": [], + "missing": [], + "present": { + "a": {"complies": True, "nested": False}, + "b": {"complies": True, "nested": False}, "c": { - u"complies": False, - u"diff": { - u"complies": False, - u"extra": ["C"], - u"missing": ["B"], - u"present": { + "complies": False, + "diff": { + "complies": False, + "extra": ["C"], + "missing": ["B"], + "present": { "A": { - u"actual_value": 1, - u"expected_value": 3, - u"complies": False, - u"nested": False, + "actual_value": 1, + "expected_value": 3, + "complies": False, + "nested": False, } }, }, - u"nested": True, + "nested": True, }, }, }, From 32969bc6adde4f2866ebca4719da5a4c620bc783 Mon Sep 17 00:00:00 2001 From: Mircea Ulinic Date: Sat, 12 Feb 2022 18:28:20 +0000 Subject: [PATCH 59/60] Make pylama happy --- test/nxapi_plumbing/test_config.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/nxapi_plumbing/test_config.py b/test/nxapi_plumbing/test_config.py index 1941fcca4..5fbc193b3 100644 --- a/test/nxapi_plumbing/test_config.py +++ b/test/nxapi_plumbing/test_config.py @@ -50,16 +50,16 @@ def test_config_jsonrpc_raises_NXAPICommandError_on_non_200_config_error( ): with pytest.raises( NXAPICommandError, match='The command "bogus command" gave the error' - ) as e: - result = mock_pynxos_device.config("bogus command") + ): + mock_pynxos_device.config("bogus command") @pytest.mark.parametrize("mock_pynxos_device_xml", [500], indirect=True) def test_config_xml_raises_NXAPIPostError_on_non_200_post_error(mock_pynxos_device_xml): with pytest.raises( NXAPIPostError, match="Invalid status code returned on NX-API POST" - ) as e: - result = mock_pynxos_device_xml.config("logging history size 200") + ): + mock_pynxos_device_xml.config("logging history size 200") @pytest.mark.parametrize("mock_pynxos_device_xml", [200], indirect=True) @@ -68,5 +68,5 @@ def test_config_xml_raises_NXAPICommandError_on_200_config_error( ): with pytest.raises( NXAPICommandError, match='The command "bogus command" gave the error' - ) as e: - result = mock_pynxos_device_xml.config("bogus command") + ): + mock_pynxos_device_xml.config("bogus command") From 82ee0ccff95a460ed2d2d4b61f9038f28a04d96f Mon Sep 17 00:00:00 2001 From: Mircea Ulinic Date: Sat, 12 Feb 2022 18:39:11 +0000 Subject: [PATCH 60/60] Release version 3.4.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b6857fa2e..3290b713b 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ setup( name="napalm", - version="3.3.1", + version="3.4.0", packages=find_packages(exclude=("test*",)), test_suite="test_base", author="David Barroso, Kirk Byers, Mircea Ulinic",