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

Release 3.1.0 #1252

Merged
merged 57 commits into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
0f2a2ec
Allow username detection on older Cisco ios versions
dlundgren Feb 7, 2020
5038a71
Merge branch 'develop' into dl/ios-username-detection
ktbyers May 2, 2020
061e297
Bugfix/ios get interfaces counters mgmt0 (#1201)
ExaneServerTeam May 9, 2020
928807f
Version 3.0.1 (#1202)
mirceaulinic May 9, 2020
b29c554
Junos: close configuration in case configure_private is set to avoid …
spinoshi May 9, 2020
82cda2b
Bugfix/ios get optics input na (#1206)
ExaneServerTeam May 11, 2020
ebee025
Bugfix/ios get optics support vss (#1208)
ExaneServerTeam May 11, 2020
a4092da
Bump pytest from 5.4.1 to 5.4.2 (#1204)
dependabot-preview[bot] May 11, 2020
3cd0c0d
Update README.md and setup.py so branch has some differences (#1209)
ktbyers May 12, 2020
be90c15
Initial version for nxos_ssh get_optics
ExaneServerTeam May 14, 2020
f4e8222
Make black happy
ExaneServerTeam May 14, 2020
02b9ba4
Remove unneeded debug comments
ExaneServerTeam May 14, 2020
a87bada
Add sample test
ExaneServerTeam May 14, 2020
62d3980
Add another interface case to escape from
ExaneServerTeam May 14, 2020
7d335d5
Fix cmd_verify and null character on NX-OS (#1214)
ktbyers May 14, 2020
84c48dc
Bump ddt from 1.3.1 to 1.4.1 (#1219)
dependabot-preview[bot] May 15, 2020
1076311
Add eos_fn0039_config optional arg to toggle FN 0039 on config comman…
mirceaulinic May 15, 2020
ff91f79
Harden Regexp + NA current support
ExaneServerTeam May 15, 2020
1d9ff61
Clarify in the docs that NAPALM 3 is Python 3.6+ only (#1222)
mirceaulinic May 19, 2020
907344f
Bump pytest-cov from 2.8.1 to 2.9.0 (#1228)
dependabot-preview[bot] May 25, 2020
3e676cb
Fixing get_bgp_neighbors and asdot notation on NX-OS (#1230)
ktbyers May 27, 2020
230a9c4
fix: force_no_enable enabled on ios and nx only
tynany Jun 22, 2020
c0fb2ac
fix: enable for non-cisco devices
tynany Jun 22, 2020
b429b38
fix: force_no_enable try/except
tynany Jun 22, 2020
7989e67
added lxml text retrieval not to fail if no text avail (#1242)
hellt Jun 30, 2020
4904efd
Merge branch 'develop' into develop
mirceaulinic Jun 30, 2020
cad362f
Fix #1247 by making PEM naming consistent (#1248)
steffann Jul 1, 2020
5b7d26b
Bump pytest from 5.4.2 to 5.4.3 (#1232)
dependabot-preview[bot] Jul 1, 2020
2501bfe
Merge branch 'develop' into dl/ios-username-detection
mirceaulinic Jul 7, 2020
7057b72
Bump tox from 3.15.0 to 3.16.1 (#1246)
dependabot-preview[bot] Jul 7, 2020
428e922
Bump coveralls from 2.0.0 to 2.1.0 (#1250)
dependabot-preview[bot] Jul 7, 2020
ad5c5e4
Merge branch 'develop' into feature/nxos_ssh_get_optics
mirceaulinic Jul 7, 2020
7085671
Bump pytest-cov from 2.9.0 to 2.10.0 (#1237)
dependabot-preview[bot] Jul 7, 2020
7524459
Bugfix/ios get optics metric fix (#1220)
ExaneServerTeam Jul 7, 2020
b300596
Merge branch 'develop' into feature/nxos_ssh_get_optics
mirceaulinic Jul 7, 2020
a062ede
format: remove trailing whitespace
tynany Jul 8, 2020
15f6cbe
Merge branch 'develop' of github.com:tynany/napalm into develop
tynany Jul 8, 2020
4c44c63
Merge branch 'develop' into develop
tynany Jul 8, 2020
7b4af8a
Version 3.0.2
mirceaulinic Jul 8, 2020
3a001fa
Merge branch 'master' into develop
mirceaulinic Jul 8, 2020
c9a30d4
Merge branch 'develop' into rel-3.0.2
ktbyers Jul 8, 2020
f8f2782
Merge pull request #1251 from napalm-automation/rel-3.0.2
mirceaulinic Jul 9, 2020
733e703
Bump coveralls from 2.1.0 to 2.1.1
dependabot-preview[bot] Jul 9, 2020
d0df828
Merge pull request #1253 from napalm-automation/dependabot/pip/covera…
mirceaulinic Jul 9, 2020
2232f6c
Merge remote-tracking branch 'upstream/develop' into dl/ios-username-…
dlundgren Jul 9, 2020
75a4f6f
Try `| section username` first, then try `| include username`
dlundgren Jul 9, 2020
1d9fd36
Merge pull request #1121 from dlundgren/dl/ios-username-detection
mirceaulinic Jul 13, 2020
052ced8
Version 3.1.0
mirceaulinic Jul 13, 2020
44c8f35
Merge branch 'develop' into feature/nxos_ssh_get_optics
mirceaulinic Jul 13, 2020
57a5997
Merge branch 'develop' into develop
mirceaulinic Jul 13, 2020
6529ad1
Merge pull request #1240 from tynany/develop
mirceaulinic Jul 13, 2020
ac35ddf
Merge branch 'develop' into feature/nxos_ssh_get_optics
mirceaulinic Jul 14, 2020
b5dc69b
Bump tox from 3.16.1 to 3.17.1
dependabot-preview[bot] Jul 16, 2020
d12fa31
Merge pull request #1257 from napalm-automation/dependabot/pip/tox-3.…
mirceaulinic Jul 16, 2020
a2743ea
Merge pull request #1215 from ExaneServerTeam/feature/nxos_ssh_get_op…
mirceaulinic Jul 16, 2020
e964304
Bump tox from 3.17.1 to 3.18.0
dependabot-preview[bot] Jul 24, 2020
70cf5bf
Merge pull request #1259 from napalm-automation/dependabot/pip/tox-3.…
mirceaulinic Jul 27, 2020
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![PyPI](https://img.shields.io/pypi/v/napalm.svg)](https://pypi.python.org/pypi/napalm)
[![PyPI versions](https://img.shields.io/pypi/pyversions/napalm.svg)](https://pypi.python.org/pypi/napalm)
[![Build Status](https://travis-ci.org/napalm-automation/napalm.svg?branch=master)](https://travis-ci.org/napalm-automation/napalm)
[![Coverage Status](https://coveralls.io/repos/github/napalm-automation/napalm/badge.svg)](https://coveralls.io/github/napalm-automation/napalm)
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
Expand Down Expand Up @@ -31,6 +32,9 @@ Install
pip install napalm
```

*Note*: Beginning with release 3.0.0 and later, NAPALM offers support for
Python 3.6+ only.


Upgrading
=========
Expand Down
10 changes: 7 additions & 3 deletions docs/installation/index.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
Installation
============


Full installation
-----------------

You can install napalm with pip:

.. code-block:: bash

pip install napalm

That will install all the drivers currently available.
That will install all the core drivers currently available.

.. note::

Beginning with release 3.0.0 and later, NAPALM offers support for Python
3.6+ only.


OS Package Managers
Expand Down
7 changes: 5 additions & 2 deletions napalm/base/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def textfsm_extractor(cls, template_name, raw_text):
def find_txt(xml_tree, path, default="", namespaces=None):
"""
Extracts the text value from an XML tree, using XPath.
In case of error, will return a default value.
In case of error or text element unavailability, will return a default value.

:param xml_tree: the XML Tree object. Assumed is <type 'lxml.etree._Element'>.
:param path: XPath to be applied, in order to extract the desired data.
Expand All @@ -265,7 +265,10 @@ def find_txt(xml_tree, path, default="", namespaces=None):
if xpath_length and xpath_applied[0] is not None:
xpath_result = xpath_applied[0]
if isinstance(xpath_result, type(xml_tree)):
value = xpath_result.text.strip()
if xpath_result.text:
value = xpath_result.text.strip()
else:
value = default
else:
value = xpath_result
else:
Expand Down
16 changes: 12 additions & 4 deletions napalm/ios/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,13 +799,21 @@ def get_optics(self):
for optics_entry in split_output.splitlines():
# Example, Te1/0/1 34.6 3.29 -2.0 -3.5
try:
optics_entry = optics_entry.strip("-")
split_list = optics_entry.split()
except ValueError:
return {}

int_brief = split_list[0]
output_power = split_list[3]
input_power = split_list[4]
current = 0
if len(split_list) == 5:
int_brief = split_list[0]
output_power = split_list[3]
input_power = split_list[4]
elif len(split_list) >= 6:
int_brief = split_list[0]
current = split_list[3]
output_power = split_list[4]
input_power = split_list[5]

port = canonical_interface_name(int_brief)

Expand Down Expand Up @@ -841,7 +849,7 @@ def get_optics(self):
"max": -100.0,
},
"laser_bias_current": {
"instant": 0.0,
"instant": (float(current) if "current" else -100.0),
"avg": 0.0,
"min": 0.0,
"max": 0.0,
Expand Down
3 changes: 3 additions & 0 deletions napalm/junos/junos.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,9 @@ def get_environment(self):
structured_object_data["class"] = current_class

if structured_object_data["class"] == "Power":
# Make sure naming is consistent
sensor_object = sensor_object.replace("PEM", "Power Supply")

# Create a dict for the 'power' key
try:
environment_data["power"][sensor_object] = {}
Expand Down
7 changes: 3 additions & 4 deletions napalm/nxos/nxos.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from napalm.base.exceptions import CommandErrorException
from napalm.base.exceptions import ReplaceConfigException
from napalm.base.helpers import generate_regex_or
from napalm.base.helpers import as_number
from napalm.base.netmiko_helpers import netmiko_args
import napalm.base.constants as c

Expand Down Expand Up @@ -962,17 +963,15 @@ def get_bgp_neighbors(self):

for neighbor_dict in neighbors_list:
neighborid = napalm.base.helpers.ip(neighbor_dict["neighborid"])
remoteas = napalm.base.helpers.as_number(
neighbor_dict["neighboras"]
)
remoteas = as_number(neighbor_dict["neighboras"])
state = str(neighbor_dict["state"])

bgp_state = bgp_state_dict[state]
afid_dict = af_name_dict[int(af_dict["af-id"])]
safi_name = afid_dict[int(saf_dict["safi"])]

result_peer_dict = {
"local_as": int(vrf_dict["vrf-local-as"]),
"local_as": as_number(vrf_dict["vrf-local-as"]),
"remote_as": remoteas,
"remote_id": neighborid,
"is_enabled": bgp_state["is_enabled"],
Expand Down
8 changes: 4 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
black==19.10b0
coveralls==2.0.0
coveralls==2.1.0
ddt==1.4.1
flake8-import-order==0.18.1
pytest==5.4.2
pytest-cov==2.8.1
pytest==5.4.3
pytest-cov==2.10.0
pytest-json==0.4.0
pytest-pythonpath==0.7.3
pylama==7.7.1
mock==4.0.2
tox==3.15.0
tox==3.16.1
Loading