Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix references to py23_compat #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ notifications:
sudo: false
language: python
python:
- 2.7
- 3.6
- 3.7
install:
- pip install tox-travis
- pip install coveralls
Expand Down
9 changes: 4 additions & 5 deletions napalm_ftos/ftos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
3 changes: 1 addition & 2 deletions test/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py34,py35,py36
envlist = py34,py35,py36,py37

[testenv]
deps =
Expand Down