From 38e05496d8770aaac1ca6f1f41d1a3047e077793 Mon Sep 17 00:00:00 2001 From: Brian Wiborg Date: Tue, 7 Jul 2020 11:11:40 +0200 Subject: [PATCH 1/3] :bug: Fix references to py23_compat --- napalm_ftos/ftos.py | 9 ++++----- test/unit/conftest.py | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/napalm_ftos/ftos.py b/napalm_ftos/ftos.py index 2b39512..b3711d7 100644 --- a/napalm_ftos/ftos.py +++ b/napalm_ftos/ftos.py @@ -21,7 +21,6 @@ from napalm.base.helpers import textfsm_extractor from napalm.base.helpers import mac, ip from napalm.base.netmiko_helpers import netmiko_args -from napalm.base.utils import py23_compat from napalm.base import NetworkDriver from napalm.base.exceptions import ConnectionException @@ -123,7 +122,7 @@ def get_bgp_neighbors_detail(self, neighbor_address=u''): "up": (entry['connection_state'] == 'ESTABLISHED'), "local_as": -1, # unimplemented "router_id": ip(entry['router_id']), - "local_address": py23_compat.text_type(entry['local_address']), + "local_address": str(entry['local_address']), "routing_table": u'', # unimplemented "local_address_configured": False, # unimplemented "local_port": entry['local_port'], @@ -370,7 +369,7 @@ def get_interfaces(self): iface = { 'is_enabled': False, 'is_up': False, - 'description': py23_compat.text_type(entry['description']), + 'description': str(entry['description']), 'mac_address': u'', 'last_flapped': 0.0, # in seconds 'speed': 0, # in megabits @@ -725,8 +724,8 @@ def traceroute(self, destination, source=u'', ttl=255, timeout=2, vrf=u''): for probe in probes: trace[ttl]['probes'][ctr] = { 'rtt': float(probe), - 'ip_address': ip(py23_compat.text_type(entry['hop'])), - 'host_name': py23_compat.text_type(entry['hop']), + 'ip_address': ip(str(entry['hop'])), + 'host_name': str(entry['hop']), } ctr += 1 diff --git a/test/unit/conftest.py b/test/unit/conftest.py index 64885d6..058ade7 100644 --- a/test/unit/conftest.py +++ b/test/unit/conftest.py @@ -3,7 +3,6 @@ from napalm.base.test import conftest as parent_conftest from napalm.base.test.double import BaseTestDouble -from napalm.base.utils import py23_compat from napalm_ftos import ftos @@ -55,7 +54,7 @@ def send_command(self, command, **kwargs): filename = '{}.txt'.format(self.sanitize_text(command)) full_path = self.find_file(filename) result = self.read_txt_file(full_path) - return py23_compat.text_type(result) + return str(result) def disconnect(self): """Fake driver, don't do anything.""" From c58022d2decd9f903a510ea28ff5fc6c10a46499 Mon Sep 17 00:00:00 2001 From: Brian Wiborg Date: Tue, 7 Jul 2020 11:33:52 +0200 Subject: [PATCH 2/3] :wrench: Remove Pyhon2; fully support Python3 --- setup.py | 5 +++-- tox.ini | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 368640d..2386cc9 100644 --- a/setup.py +++ b/setup.py @@ -29,9 +29,10 @@ def parse_reqs(file_path): classifiers=[ 'Topic :: Utilities', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Operating System :: POSIX :: Linux', 'Operating System :: Microsoft :: Windows', diff --git a/tox.ini b/tox.ini index 64c7df9..9bedbe6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py34,py35,py36 +envlist = py34,py35,py36,py37 [testenv] deps = From c74edebfea06349987cbfd228c198d1e34a73c0c Mon Sep 17 00:00:00 2001 From: Brian Wiborg Date: Tue, 7 Jul 2020 11:40:05 +0200 Subject: [PATCH 3/3] :wrench: Fix Python support in .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 98de1d5..644252f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,8 @@ notifications: sudo: false language: python python: -- 2.7 - 3.6 +- 3.7 install: - pip install tox-travis - pip install coveralls