Skip to content

Commit 01e83de

Browse files
authored
Merge pull request #536 from napalm-automation/develop
Release 2.1.0
2 parents 30cbfb4 + 136c335 commit 01e83de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1446
-183
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[![PyPI](https://img.shields.io/pypi/v/napalm.svg)](https://pypi.python.org/pypi/napalm)
22
[![Build Status](https://travis-ci.org/napalm-automation/napalm.svg?branch=master)](https://travis-ci.org/napalm-automation/napalm)
3+
[![Coverage Status](https://coveralls.io/repos/github/napalm-automation/napalm/badge.svg)](https://coveralls.io/github/napalm-automation/napalm)
34

45

56
NAPALM

Diff for: docs/development/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Some useful information for development purposes.
88
:maxdepth: 1
99

1010
testing_framework
11+
triage

Diff for: docs/development/triage.rst

+231
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
.. _triaging:
2+
3+
Triaging Issues and Pull Requests
4+
=================================
5+
6+
.. note::
7+
8+
This document serves mainly as a reference for the NAPALM maintainers,
9+
but the users are equally welcome to read this document and understand our
10+
process, and eventually suggest improvements.
11+
12+
We triage Issues and Pull Requests (PR) using GitHub features only:
13+
14+
- :ref:`triage-labels`
15+
- :ref:`triage-milestone`
16+
- :ref:`triage-projects`
17+
18+
.. _triage-labels:
19+
20+
Labels
21+
++++++
22+
23+
.. _triage-driver-labels:
24+
25+
Driver labels
26+
-------------
27+
28+
Each platform supported by NAPALM has associated a label, e.g., ``junos``, ``eos``,
29+
``ios``, ``iosxr``, ``vyos``, etc. It is mandatory that the maintainer to apply
30+
one or more of these labels.
31+
32+
.. _triage-api-change-label:
33+
34+
``api change``
35+
--------------
36+
37+
If the Issue would imply a change in the API, or the PR introduces changes in
38+
the API. By API change we refer to changes in the getters output structure,
39+
methods signature, or any core changes that must be uniformly introduced across
40+
all the drivers.
41+
42+
.. _triage-awesome-label:
43+
44+
``awesome``
45+
-----------
46+
47+
When someone adds or proposes something really awesome.
48+
49+
.. _triage-base-label:
50+
51+
``base``
52+
--------
53+
54+
When base components are affected, e.g., `get_network_driver`, the validate
55+
functionality, or the testing framework.
56+
57+
.. _triage-blocked-label:
58+
59+
``blocked``
60+
-----------
61+
62+
Added in case we block the PR temporarly, or an Issue is currently blocked by
63+
other internal or external factors (PRs pending to be merged, other bugs to be
64+
solved a priori, etc.)
65+
66+
.. _triage-bug-label:
67+
68+
``bug``
69+
-------
70+
71+
Whenever the behaviour reported in the Issue is different than it should, or the
72+
PR kills a bug.
73+
74+
.. _triage-cannot-reproduce:
75+
76+
``cannot reproduce``
77+
--------------------
78+
79+
This refers to Issues only, and it is added when the maintainer(s) cannot
80+
reproduce the behaviour reported.
81+
82+
.. _triage-core-label:
83+
84+
``core``
85+
--------
86+
87+
When any core components (drivers) are affected.
88+
89+
.. _triage-deprecation-label:
90+
91+
``deprecation``
92+
---------------
93+
94+
Added only to PRs, when a API deprecation is introduced.
95+
96+
.. _triage-documentation-label:
97+
98+
``documentation``
99+
-----------------
100+
101+
Can be added to both Issues and PRs, anything related to the documentation.
102+
103+
.. _triage-duplicate-label:
104+
105+
``duplicate``
106+
-------------
107+
108+
Applicable to Issues only, to be added before closing a duplicate.
109+
110+
.. _triage-feature-label:
111+
112+
``feature``
113+
-----------
114+
115+
When a new feature is introduced, or the user requests a new feature.
116+
117+
.. _triage-good-first-issue:
118+
119+
``good first issue``
120+
--------------------
121+
122+
While we want to encourage the community to contribute more and more frequent,
123+
many engineers are still afraid of complex tasks. This label marks simple fixes
124+
that new contributors can address. It is recommended that this label to be
125+
accompanied by an explanation and a pointer for the new contributors.
126+
127+
.. _triage-help-wanted:
128+
129+
``help wanted``
130+
---------------
131+
132+
This marks an Issue were we ask the community for help, or we need more details
133+
on a particular topic (e.g., outputs from different platforms, explanation, etc.)
134+
from any volunteer from the community.
135+
136+
Once we have all the details required, the maintainer has to remove this label
137+
even though it does not start working on it immediately.
138+
139+
.. _triage-high-severity-label:
140+
141+
``high severity``
142+
-----------------
143+
144+
Whenever a :ref:`triage-bug-label` affects severely one or more features, making
145+
it basically unusable.
146+
147+
.. _triage-info-needed-label:
148+
149+
``info needed``
150+
---------------
151+
152+
We add this label when we need more details and further explanation from the user
153+
that reports an Issue. Once we received everything needed, we can remove that
154+
label.
155+
156+
.. _triage-investigation-label:
157+
158+
``investigation``
159+
-----------------
160+
161+
We need to investigate the problem further.
162+
163+
.. _triage-new-driver:
164+
165+
``new driver``
166+
--------------
167+
168+
When we discuss the possibility to add a new core driver.
169+
170+
.. _triage-new-method:
171+
172+
``new method``
173+
--------------
174+
175+
When we discuss the possibility or implement a new method to one or more drivers.
176+
The method does not necessarily need to be a completely new one to NAPALM.
177+
178+
.. _triage-vendor-bug-label:
179+
180+
``vendor bug``
181+
--------------
182+
183+
When the bug is casued by a vendor stupidity.
184+
185+
.. _triage-milestone:
186+
187+
Milestone
188+
+++++++++
189+
190+
The milestones are used to group the Issues and the Pull Requests from a
191+
different angle:
192+
193+
.. _triage-version-milestone:
194+
195+
Version
196+
-------
197+
198+
The Issue will be solved, or the PR will be included in this release.
199+
200+
.. _triage-approved-milestone:
201+
202+
``APPROVED``
203+
------------
204+
205+
It means that we accept the Issue or the PR, but we don't have a schedule yet
206+
for when the Issue will be solved, or the PR will be included in a release.
207+
208+
.. _triage-blocked-milestone:
209+
210+
``BLOCKED``
211+
-----------
212+
213+
This groups the Issues or the PRs we could not accept for the reasons marked
214+
using the labels.
215+
216+
.. _triage-discussion-milestone:
217+
218+
``DISCUSSION``
219+
--------------
220+
221+
The Issue or the PR needs further discussion.
222+
223+
224+
.. _triage-projects:
225+
226+
Projects
227+
++++++++
228+
229+
Any major change that may consist on several Pull Requests should be groupped
230+
into a GitHub Project.
231+

Diff for: napalm/_SUPPORTED_DRIVERS.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
SUPPORTED_DRIVERS = [
2+
"base",
23
"eos",
34
"ios",
45
"iosxr",

Diff for: napalm/base/__init__.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ def get_network_driver(module_name, prepend=True):
8181
# Can also request using napalm_[SOMETHING]
8282
if 'napalm' not in module_install_name and prepend is True:
8383
module_install_name = 'napalm.{name}'.format(name=module_install_name)
84-
module = importlib.import_module(module_install_name)
84+
try:
85+
module = importlib.import_module("custom_" + module_install_name)
86+
except ImportError:
87+
module = importlib.import_module(module_install_name)
8588
except ImportError:
8689
raise ModuleImportError(
8790
'Cannot import "{install_name}". Is the library installed?'.format(

Diff for: napalm/base/base.py

+7
Original file line numberDiff line numberDiff line change
@@ -1583,3 +1583,10 @@ def compliance_report(self, validation_file=None, validation_source=None):
15831583
"""
15841584
return validate.compliance_report(self, validation_file=validation_file,
15851585
validation_source=validation_source)
1586+
1587+
def _canonical_int(self, interface):
1588+
"""Expose the helper function within this class."""
1589+
if self.use_canonical_interface is True:
1590+
return napalm.base.helpers.canonical_interface_name(interface, update_os_mapping=None)
1591+
else:
1592+
return interface

Diff for: napalm/base/canonical_map.py

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
from __future__ import print_function
2+
from __future__ import unicode_literals
3+
4+
5+
base_interfaces = {
6+
"ATM": "ATM",
7+
"AT": "ATM",
8+
"EOBC": "EOBC",
9+
"EO": "EOBC",
10+
"Ethernet": "Ethernet",
11+
"Eth": "Ethernet",
12+
"Et": "Ethernet",
13+
"FastEthernet": "FastEthernet",
14+
"FastEth": "FastEthernet",
15+
"FastE": "FastEthernet",
16+
"Fast": "FastEthernet",
17+
"Fas": "FastEthernet",
18+
"FE": "FastEthernet",
19+
"Fa": "FastEthernet",
20+
"Fddi": "Fddi",
21+
"FD": "Fddi",
22+
"FortyGigabitEthernet": "FortyGigabitEthernet",
23+
"FortyGigEthernet": "FortyGigabitEthernet",
24+
"FortyGigEth": "FortyGigabitEthernet",
25+
"FortyGigE": "FortyGigabitEthernet",
26+
"FortyGig": "FortyGigabitEthernet",
27+
"FGE": "FortyGigabitEthernet",
28+
"FO": "FortyGigabitEthernet",
29+
"Fo": "FortyGigabitEthernet",
30+
"GigabitEthernet": "GigabitEthernet",
31+
"GigEthernet": "GigabitEthernet",
32+
"GigEth": "GigabitEthernet",
33+
"GigE": "GigabitEthernet",
34+
"Gig": "GigabitEthernet",
35+
"GE": "GigabitEthernet",
36+
"Gi": "GigabitEthernet",
37+
"HundredGigabitEthernet": "HundredGigabitEthernet",
38+
"HundredGigEthernet": "HundredGigabitEthernet",
39+
"HundredGigEth": "HundredGigabitEthernet",
40+
"HundredGigE": "HundredGigabitEthernet",
41+
"HundredGig": "HundredGigabitEthernet",
42+
"Hu": "HundredGigabitEthernet",
43+
"Loopback": "Loopback",
44+
"Lo": "Loopback",
45+
"Management": "Management",
46+
"Mgmt": "Management",
47+
"Ma": "Management",
48+
"Management_short": "Ma",
49+
"MFR": "MFR",
50+
"Multilink": "Multilink",
51+
"Mu": "Multilink",
52+
"PortChannel": "PortChannel",
53+
"Port-Channel": "PortChannel",
54+
"Po": "PortChannel",
55+
"POS": "POS",
56+
"PO": "POS",
57+
"Serial": "Serial",
58+
"Se": "Serial",
59+
"S": "Serial",
60+
"TenGigabitEthernet": "TenGigabitEthernet",
61+
"TenGigEthernet": "TenGigabitEthernet",
62+
"TenGigEth": "TenGigabitEthernet",
63+
"TenGig": "TenGigabitEthernet",
64+
"TeGig": "TenGigabitEthernet",
65+
"Ten": "TenGigabitEthernet",
66+
"T": "TenGigabitEthernet",
67+
"Te": "TenGigabitEthernet",
68+
"Tunnel": "Tunnel",
69+
"Tun": "Tunnel",
70+
"Tu": "Tunnel",
71+
"Virtual-Access": "Virtual-Access",
72+
"Vi": "Virtual-Access",
73+
"Virtual-Template": "Virtual-Template",
74+
"Vt": "Virtual-Template",
75+
"VLAN": "VLAN",
76+
"V": "VLAN",
77+
"Vl": "VLAN"
78+
}
79+
80+
reverse_mapping = {
81+
"ATM": "At",
82+
"EOBC": "EO",
83+
"Ethernet": "Et",
84+
"FastEthernet": "Fa",
85+
"Fddi": "FD",
86+
"FortyGigabitEthernet": "Fo",
87+
"GigabitEthernet": "Gi",
88+
"HundredGigabitEthernet": "Hu",
89+
"Loopback": "Lo",
90+
"Management": "Ma",
91+
"MFR": "MFR",
92+
"Multilink": "Mu",
93+
"PortChannel": "Po",
94+
"POS": "PO",
95+
"Serial": "Se",
96+
"TenGigabitEthernet": "Te",
97+
"Tunnel": "Tu",
98+
"Virtual-Access": "Vi",
99+
"Virtual-Template": "Vt",
100+
"VLAN": "Vl"
101+
}

0 commit comments

Comments
 (0)