Skip to content

Commit

Permalink
Merge branch 'develop' into doc-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceaulinic committed Nov 15, 2017
2 parents e13ff89 + 4db8bcf commit f1d55be
Show file tree
Hide file tree
Showing 212 changed files with 962 additions and 3,946 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -51,6 +51,7 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/_static/

.idea
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions README.md
@@ -1,5 +1,6 @@
[![PyPI](https://img.shields.io/pypi/v/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)


NAPALM
Expand Down
43 changes: 16 additions & 27 deletions docs/cli.rst
Expand Up @@ -137,27 +137,16 @@ The debugging mode is also quite useful and it's recommended you use it to repor
2017-08-15 15:14:23,527 - napalm - DEBUG - Starting napalm's debugging tool
2017-08-15 15:14:23,527 - napalm - DEBUG - Gathering napalm packages
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-ansible==0.7.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-base==0.24.3
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-eos==0.6.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-fortios==0.4.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-ios==0.7.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-iosxr==0.5.4
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-junos==0.12.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-nxos==0.6.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-panos==0.4.0
2017-08-15 15:14:23,541 - napalm - DEBUG - napalm-pluribus==0.5.1
2017-08-15 15:14:23,542 - napalm - DEBUG - napalm-ros==0.2.2
2017-08-15 15:14:23,542 - napalm - DEBUG - napalm-vyos==0.1.3
2017-08-15 15:14:23,542 - napalm - DEBUG - napalm==1.2.0
2017-08-15 15:14:23,542 - napalm - DEBUG - napalm==2.0.0
2017-08-15 15:14:23,542 - napalm - DEBUG - get_network_driver - Calling with args: ('eos',), {}
2017-08-15 15:14:23,551 - napalm - DEBUG - get_network_driver - Successful
2017-08-15 15:14:23,551 - napalm - DEBUG - __init__ - Calling with args: (<class 'napalm_eos.eos.EOSDriver'>, 'localhost', 'vagrant'), {'password': u'*******', 'optional_args': {u'port': 12443}, 'timeout': 60}
2017-08-15 15:14:23,551 - napalm - DEBUG - __init__ - Calling with args: (<class 'napalm.eos.eos.EOSDriver'>, 'localhost', 'vagrant'), {'password': u'*******', 'optional_args': {u'port': 12443}, 'timeout': 60}
2017-08-15 15:14:23,551 - napalm - DEBUG - __init__ - Successful
2017-08-15 15:14:23,551 - napalm - DEBUG - pre_connection_tests - Calling with args: (<napalm_eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,551 - napalm - DEBUG - open - Calling with args: (<napalm_eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,551 - napalm - DEBUG - pre_connection_tests - Calling with args: (<napalm.eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,551 - napalm - DEBUG - open - Calling with args: (<napalm.eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,586 - napalm - DEBUG - open - Successful
2017-08-15 15:14:23,586 - napalm - DEBUG - connection_tests - Calling with args: (<napalm_eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,587 - napalm - DEBUG - get_facts - Calling with args: (<napalm_eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,586 - napalm - DEBUG - connection_tests - Calling with args: (<napalm.eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,587 - napalm - DEBUG - get_facts - Calling with args: (<napalm.eos.eos.EOSDriver object at 0x105d58bd0>,), {}
2017-08-15 15:14:23,622 - napalm - DEBUG - Gathered facts:
{
"os_version": "4.15.2.1F-2759627.41521F",
Expand Down Expand Up @@ -188,28 +177,28 @@ The debugging mode is also quite useful and it's recommended you use it to repor
"fqdn": "myhost"
}
2017-08-15 15:14:23,622 - napalm - DEBUG - get_facts - Successful
2017-08-15 15:14:23,622 - napalm - DEBUG - load_merge_candidate - Calling with args: (<napalm_eos.eos.EOSDriver object at 0x105d58bd0>,), {'filename': 'new_config.txt'}
2017-08-15 15:14:23,622 - napalm - DEBUG - load_merge_candidate - Calling with args: (<napalm.eos.eos.EOSDriver object at 0x105d58bd0>,), {'filename': 'new_config.txt'}
2017-08-15 15:14:23,894 - napalm - ERROR - load_merge_candidate - Failed: Error [1000]: CLI command 3 of 5 'hostname a_new-hostname' failed: could not run command [ Host name is invalid. Host name must contain only alphanumeric characters, '.' and '-'.
It must begin and end with an alphanumeric character.]

================= Traceback =================

Traceback (most recent call last):
File "/Users/dbarroso/.virtualenvs/napalm/bin/napalm", line 11, in <module>
load_entry_point('napalm-base', 'console_scripts', 'napalm')()
File "/Users/dbarroso/workspace/napalm/napalm-base/napalm_base/clitools/cl_napalm.py", line 285, in main
load_entry_point('napalm', 'console_scripts', 'napalm')()
File "/Users/dbarroso/workspace/napalm/napalm/napalm.base/clitools/cl_napalm.py", line 285, in main
run_tests(args)
File "/Users/dbarroso/workspace/napalm/napalm-base/napalm_base/clitools/cl_napalm.py", line 270, in run_tests
File "/Users/dbarroso/workspace/napalm/napalm/napalm.base/clitools/cl_napalm.py", line 270, in run_tests
configuration_change(device, args.config_file, args.strategy, args.dry_run)
File "/Users/dbarroso/workspace/napalm/napalm-base/napalm_base/clitools/cl_napalm.py", line 224, in configuration_change
File "/Users/dbarroso/workspace/napalm/napalm/napalm.base/clitools/cl_napalm.py", line 224, in configuration_change
strategy_method(device, filename=config_file)
File "/Users/dbarroso/workspace/napalm/napalm-base/napalm_base/clitools/cl_napalm.py", line 27, in wrapper
File "/Users/dbarroso/workspace/napalm/napalm/napalm.base/clitools/cl_napalm.py", line 27, in wrapper
r = func(*args, **kwargs)
File "/Users/dbarroso/workspace/napalm/napalm-base/napalm_base/clitools/cl_napalm.py", line 202, in call_load_merge_candidate
File "/Users/dbarroso/workspace/napalm/napalm/napalm.base/clitools/cl_napalm.py", line 202, in call_load_merge_candidate
return device.load_merge_candidate(*args, **kwargs)
File "/Users/dbarroso/workspace/napalm/napalm-eos/napalm_eos/eos.py", line 176, in load_merge_candidate
File "/Users/dbarroso/workspace/napalm/napalm-eos/napalm.eos/eos.py", line 176, in load_merge_candidate
self._load_config(filename, config, False)
File "/Users/dbarroso/workspace/napalm/napalm-eos/napalm_eos/eos.py", line 168, in _load_config
File "/Users/dbarroso/workspace/napalm/napalm-eos/napalm.eos/eos.py", line 168, in _load_config
raise MergeConfigException(e.message)
napalm_base.exceptions.MergeConfigException: Error [1000]: CLI command 3 of 5 'hostname a_new-hostname' failed: could not run command [ Host name is invalid. Host name must contain only alphanumeric characters, '.' and '-'.
napalm.base.exceptions.MergeConfigException: Error [1000]: CLI command 3 of 5 'hostname a_new-hostname' failed: could not run command [ Host name is invalid. Host name must contain only alphanumeric characters, '.' and '-'.
It must begin and end with an alphanumeric character.]
2 changes: 1 addition & 1 deletion docs/contributing/index.rst
Expand Up @@ -21,7 +21,7 @@ The best way to propose a new method is as follows to send a PR with the propose
In addition, before merging we will want an implementation for any driver of your choice.

For example:
- `get_config proposal <https://github.com/napalm-automation/napalm-base/pull/69/files>`_ - That particular example had an issue that some had raised as a reference but that's not mandatory. You can create an issue first but that's optional.
- `get_config proposal <https://github.com/napalm-automation/napalm/pull/69/files>`_ - That particular example had an issue that some had raised as a reference but that's not mandatory. You can create an issue first but that's optional.
- `get_config implementation for EOS <https://github.com/napalm-automation/napalm-eos/pull/38/files>`_ - Before the PR was merged an implementation was provided as a proof of concept. This is mandatory. This PRs doesn't have to arrive at the same time as the previous one but it will be required. Note that the rules for "`Implementing an already defined method`_" apply to this PR.

Implementing an already defined method
Expand Down
14 changes: 7 additions & 7 deletions docs/development/testing_framework.rst
Expand Up @@ -8,7 +8,7 @@ ________

The testing framework has the following features:

1. Same tests across all vendors. Tests defined in ``napalm_base/test/getters.py`` are shared across all drivers.
1. Same tests across all vendors. Tests defined in ``napalm.base/test/getters.py`` are shared across all drivers.
2. Multiple test cases per test.
3. Target of the test can be configured with environmental variables.
4. Expected output is compared against the actual output of the test result.
Expand Down Expand Up @@ -57,17 +57,17 @@ Multiple test cases::
lots_of_peers no_peers normal
(napalm) ➜ napalm-eos git:(test_framework) ✗ py.test test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors
...
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[lots_of_peers] <- ../napalm-base/napalm_base/test/getters.py PASSED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[no_peers] <- ../napalm-base/napalm_base/test/getters.py PASSED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[normal] <- ../napalm-base/napalm_base/test/getters.py PASSED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[lots_of_peers] <- ../napalm/napalm.base/test/getters.py PASSED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[no_peers] <- ../napalm/napalm.base/test/getters.py PASSED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[normal] <- ../napalm/napalm.base/test/getters.py PASSED
Missing test cases::

(napalm) ➜ napalm-eos git:(test_framework) ✗ ls test/unit/mocked_data/test_get_bgp_neighbors
ls: test/unit/mocked_data/test_get_bgp_neighbors: No such file or directory
(napalm) ➜ napalm-eos git:(test_framework) ✗ py.test test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors
...
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[no_test_case_found] <- ../napalm-base/napalm_base/test/getters.py FAILED
test/unit/test_getters.py::TestGetter::test_get_bgp_neighbors[no_test_case_found] <- ../napalm/napalm.base/test/getters.py FAILED
========================================================= FAILURES ==========================================================
___________________________________ TestGetter.test_get_bgp_neighbors[no_test_case_found] ___________________________________
Expand All @@ -88,14 +88,14 @@ Missing test cases::
> pytest.fail("No test case for '{}' found".format(func.__name__))
E Failed: No test case for 'test_get_bgp_neighbors' found
../napalm-base/napalm_base/test/getters.py:64: Failed
../napalm/napalm.base/test/getters.py:64: Failed
================================================= 1 failed in 0.12 seconds ==================================================

Method not implemented::

(napalm) ➜ napalm-eos git:(test_framework) ✗ py.test test/unit/test_getters.py::TestGetter::test_get_probes_config
...
test/unit/test_getters.py::TestGetter::test_get_probes_config[no_test_case_found] <- ../napalm-base/napalm_base/test/getters.py SKIPPED
test/unit/test_getters.py::TestGetter::test_get_probes_config[no_test_case_found] <- ../napalm/napalm.base/test/getters.py SKIPPED
================================================= 1 skipped in 0.09 seconds =================================================

Expand Down
36 changes: 16 additions & 20 deletions docs/index.rst
Expand Up @@ -17,38 +17,34 @@ Supported Network Operating Systems:
* Cisco IOS
* Cisco IOS-XR
* Cisco NX-OS
* Fortinet Fortios
* IBM
* Juniper JunOS
* Mikrotik RouterOS
* Palo Alto NOS
* Pluribus
* Vyos

extras
______

In addition to the core drivers napalm also supports community driven drivers. You can find more information about them here:

TBD Link to extras/core drivers' documentation

Selecting the right driver
--------------------------

You can select the driver you need by doing the following:

.. code-block:: python
>>> from napalm_base import get_network_driver
>>> from napalm import get_network_driver
>>> get_network_driver('eos')
<class napalm_eos.eos.EOSDriver at 0x10ebad6d0>
<class napalm.eos.eos.EOSDriver at 0x10ebad6d0>
>>> get_network_driver('iosxr')
<class napalm_iosxr.iosxr.IOSXRDriver at 0x10ec90050>
<class napalm.iosxr.iosxr.IOSXRDriver at 0x10ec90050>
>>> get_network_driver('junos')
<class napalm_junos.junos.JunOSDriver at 0x10f96f328>
>>> get_network_driver('fortios')
<class napalm_fortios.fortios.FortiOSDriver at 0x10f96fc18>
>>> get_network_driver('ibm')
<class napalm_ibm.ibm.IBMDriver at 0x10f8f61f0>
<class napalm.ibm.ibm.IBMDriver at 0x10f8f61f0>
>>> get_network_driver('nxos')
<class napalm_nxos.nxos.NXOSDriver at 0x10f9304c8>
<class napalm.nxos.nxos.NXOSDriver at 0x10f9304c8>
>>> get_network_driver('ios')
<class napalm_ios.ios.IOSDriver at 0x10f9b0738>
>>> get_network_driver('pluribus')
<class napalm_pluribus.pluribus.PluribusDriver at 0x80103e530>
<class napalm.ios.ios.IOSDriver at 0x10f9b0738>
Check the tutorials to see how to use the library in more detail, Supported Devices will provide you with detailed support information and caveats and the NetworkDriver section explains which methods are available for you to use.
Documentation
=============
Expand Down
34 changes: 13 additions & 21 deletions docs/installation/index.rst
Expand Up @@ -21,44 +21,36 @@ If you want to install just a subset of the available modules you can just pick

.. code-block:: bash
pip install napalm-eos napalm-junos
pip install --install-option="eos" --install-option="junos" napalm
That will install only the `eos` and the `junos` drivers. If you want to remove or add a module later on you can just use `pip` to do it:
That will install only the ``eos`` and the ``junos`` drivers. If you want to add an extra driver later you can use ``pip --force-reinstall -U`` to do it:

.. code-block:: bash
pip uninstall napalm-junos
pip install napalm-ios
pip install --install-option="ios" --force-reinstall -U napalm
Check the ['Supported Network Operating Systems'](http://napalm.readthedocs.io/en/latest/support/index.html) section for more information about supported modules.

Upgrading
---------

We plan to upgrade napalm as fast as possible. Adding new methods and bugfixes. To upgrade napalm it's as simple as repeating the steps you performed while installing but adding the `-U` flag. For example:
Note you can pass those options to a requirements file as well:

.. code-block:: bash
pip install napalm -U
or:
# requrements.txt
napalm --install-option="ios" --install-option="eos"
.. code-block:: bash
pip install napalm-eos napalm-junos -U
Check the `supported devices`_ section for more information on supported drivers.

Dependencies
------------

Although dependencies for the transport libraries are solved by `pip`, on some operating systems there are some particular requirements:
Although dependencies for the transport libraries are solved by ``pip``, on some operating systems there are some particular requirements:

.. toctree::
:maxdepth: 1

junos
iosxr
ios
panos
pluribus
vyos
iosxr
junos


.. _supported devices: ../support/index.html
25 changes: 0 additions & 25 deletions docs/installation/panos.rst

This file was deleted.

24 changes: 0 additions & 24 deletions docs/installation/pluribus.rst

This file was deleted.

25 changes: 0 additions & 25 deletions docs/installation/vyos.rst

This file was deleted.

19 changes: 0 additions & 19 deletions docs/support/fortios.rst

This file was deleted.

13 changes: 0 additions & 13 deletions docs/support/ibm.rst

This file was deleted.

0 comments on commit f1d55be

Please sign in to comment.