8000 Release 2.0.0 by dbarrosop · Pull Request #288 · nornir-automation/nornir · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Release 2.0.0 #288

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

Merged
merged 134 commits into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
aa14a7c
Removed unmerged feature from changelog
dbarrosop Jul 12, 2018
aec37d2
emove support for <py36 (#174)
dbarrosop Jul 17, 2018
d9fd9a2
Migrate to ruamel.yaml and add `ordered_dict` parameter to `load_json…
dbarrosop Jul 17, 2018
78758d0
Filter object (#176)
dbarrosop Jul 17, 2018
6de87ee
Add annotations to nornir.plugins and mypy to CI (#187)
dmfigol Jul 18, 2018
0a1027e
remove ordereddict as it's not needed in py3.6+ (#190)
dbarrosop Jul 19, 2018
562ce4e
code reformatted with newer black (#191)
dbarrosop Jul 19, 2018
19d05bf
Fix #166 (#193)
dmfigol Jul 22, 2018
ef6645f
Remove deprecated ruamel.yaml API calls (#192)
dmfigol Jul 22, 2018
50804be
Allow filtering by list, ie F(nornir_nos__in=[eos, junos]) (#197)
dbarrosop Jul 23, 2018
c46facb
Add initial explanation of DSL.
tyler-8 Jul 25, 2018
1fa1c92
Merge pull request #198 from tyler-8/develop
ktbyers Jul 25, 2018
e4e9419
implement any/all filtering for collections (#203)
dbarrosop Jul 28, 2018
49d1a8b
Docs (#212)
dbarrosop Jul 28, 2018
2084658
Add AnsibleInventory support for host_vars and group_vars with *.yml …
dmfigol Jul 30, 2018
eba2a71
Adding inventory plugin for netbox (#180)
dbarrosop Jul 30, 2018
371bbee
Refactor connection plugins (#195)
dbarrosop Jul 30, 2018
976cace
Merge branch 'develop' of github.com:nornir-automation/nornir into re…
dbarrosop Aug 3, 2018
b5a49a7
update black
dbarrosop Aug 3, 2018
735a8af
Merge pull request #220 from nornir-automation/rebase-2.0
dbarrosop Aug 3, 2018
7974652
consolidate inventory attributes
dbarrosop Aug 5, 2018
7d9945f
device_type is now platform
dbarrosop Aug 6, 2018
d1fc315
black
dbarrosop Aug 7, 2018
57d6eb8
Update inventory.ipynb
erikturk Aug 7, 2018
5244e2d
Remove old Python 2 import
ogenstad Aug 8, 2018
7f95ff9
Merge pull request #226 from nornir-automation/py2_import
dbarrosop Aug 8, 2018
0bbded1
Merge pull request #225 from erikturk/patch-1
dbarrosop Aug 8, 2018
d32b11e
fix signature and rename configuration_options to advanced_options to…
dbarrosop Aug 9, 2018
4825e23
add tests to validate parameters resolution
dbarrosop Aug 9, 2018
46d7b3d
fix breaking change from ruamel.yaml
dbarrosop Aug 9, 2018
b437401
fixes to documentation
dbarrosop Aug 10, 2018
0a4d26e
pass _options without requiring indentation
dbarrosop Aug 12, 2018
32a8531
added tutorial on how to handle connections
dbarrosop Aug 12, 2018
773113a
test jupyter notebooks
dbarrosop Aug 12, 2018
29ba624
added upgrading notes
dbarrosop Aug 12, 2018
e463e54
enable nbval test in travis
dbarrosop Aug 12, 2018
1c7a0af
address comments
dbarrosop Aug 13, 2018
07c7113
consolidate inventory attributes
dbarrosop Aug 13, 2018
72d664f
Patch connection close (#218)
ktbyers Aug 13, 2018
a412666
Fix napalm plugin port reference (#228)
ktbyers Aug 14, 2018
f489808
Add setters for first-level Nornir inventory attributes (#229)
ktbyers Aug 14, 2018
de9eba1
Migrate how tos to testable notebooks (#227)
dbarrosop Aug 16, 2018
b1751e6
Fixing issue with napalm plugin if port but no optional_args (#231)
ktbyers Aug 16, 2018
eae5b96
use C load for ruamel.yaml (#232)
dbarrosop Aug 26, 2018
2554177
fix tests
dbarrosop Aug 26, 2018
9436de1
Add class methods for plugins registration in Connections class
dmfigol Aug 26, 2018
c135c19
Add tests for connections plugin registration/deregistration
dmfigol Aug 27, 2018
9d153d4
Modify connection plugins registration
dmfigol Aug 28, 2018
f8a106a
Merge pull request #235 from dmfigol/augment-connections
ktbyers Aug 29, 2018
e39e614
refactor configuration
dbarrosop Aug 30, 2018
f9dfb40
trying to make mypy happy
dbarrosop Aug 30, 2018
8252296
Merge branch '2.0' of github.com:nornir-automation/nornir into pydantic
dbarrosop Aug 30, 2018
5d6c31d
progress
dbarrosop Aug 31, 2018
333dbd3
tests passing
dbarrosop Sep 2, 2018
9cc059d
final touches to the inventory rework
dbarrosop Sep 3, 2018
63e329f
Data is now GlobalState
dbarrosop Sep 3, 2018
809c864
add a fixture to reset_failed_hosts
dbarrosop Sep 3, 2018
e2fec9c
fix defaults
dbarrosop Sep 3, 2018
53978f1
fix howtos
dbarrosop Sep 3, 2018
2720a0f
undo GlobalState as a class object
dbarrosop Sep 3, 2018
e310735
progress
dbarrosop Sep 4, 2018
620d446
progress
dbarrosop Sep 4, 2018
6105052
fix tests
dbarrosop Sep 4, 2018
88115da
progress
dbarrosop Sep 9, 2018
4a3efbe
fix mypy
dbarrosop Sep 9, 2018
dfea375
we need to fix doc references
dbarrosop Sep 9, 2018
7127dbb
fix circular reference
dbarrosop Sep 9, 2018
7d8aa5e
fix cyclic import
dbarrosop Sep 9, 2018
67bab3b
fix sphinx
dbarrosop Sep 9, 2018
615228a
mypy fixes
dbarrosop Sep 15, 2018
4cf47f8
fix attributes resolution
dbarrosop Sep 15, 2018
e3feae4
fix bug in tutorial
dbarrosop Sep 15, 2018
d106aec
minor bugfix
dbarrosop Sep 21, 2018
1afe62c
inhering from host atrributes
dbarrosop Sep 23, 2018
37a6db1
resolve connection_options recursively
dbarrosop Sep 23, 2018
0c0dd5f
fix nbval
dbarrosop Sep 24, 2018
55e129f
Always go into enable mode for config changes (#251)
ktbyers Oct 2, 2018
ac82aa0
stop printing coverage by default
dbarrosop Oct 7, 2018
4d9d839
separate serializing function for the configuration
dbarrosop Oct 7, 2018
46bef2e
refactor config to have everything inside a section
dbarrosop Oct 13, 2018
067b042
document the configuration
dbarrosop Oct 13, 2018
32c69eb
fix docs for exceptions
dbarrosop Oct 13, 2018
a639ce0
blackify
dbarrosop Oct 13, 2018
60f336c
pylamafy
dbarrosop Oct 13, 2018
2686173
fix mypy
dbarrosop Oct 13, 2018
b34d09c
add missing directory
dbarrosop Oct 14, 2018
29a7a9e
fix typos
dbarrosop Oct 16, 2018
78fcec9
fixes #258
dbarrosop Oct 16, 2018
7c7c85c
change logger names __name__
dbarrosop Oct 19, 2018
75820ae
fix deserializer types
dbarrosop Oct 19, 2018
147ef56
classmethod should follow cls convention
dbarrosop Oct 19, 2018
1924649
various fixes
dbarrosop Oct 19, 2018
900af24
Merge pull request #254 from nornir-automation/config_continue
dbarrosop Oct 19, 2018
37a72b1
addressing PR comments
dbarrosop Oct 23, 2018
e29aa1a
Merge pull request #243 from nornir-automation/inventory_rework
dbarrosop Oct 23, 2018
0d35888
remove need of Config object in the Inventory and Hosts
dbarrosop Oct 24, 2018
5a6bb1a
fix documentation
dbarrosop Oct 24, 2018
5973f77
Merge pull request #263 from nornir-automation/no_config
dbarrosop Oct 27, 2018
b9083a5
Merge branch 'develop' of github.com:nornir-automation/nornir into 2.…
dbarrosop Oct 27, 2018
8056a32
added children_of_group method to inventory
dbarrosop Oct 27, 2018
916b3b4
bugfix: globalstate wasn't being handled properly
dbarrosop Oct 27, 2018
07191d5
updated tutorial for nornir 2.0.0
dbarrosop Oct 27, 2018
4c25c9f
fix sphinx
dbarrosop Oct 27, 2018
2164105
Merge remote-tracking branch 'upstream/master' into 2.0.0-beta
walidamer711 Oct 30, 2018
c916502
Update the netmiko map with nxos_ssh
walidamer711 Oct 30, 2018
1cdd805
Add enable argument to Netmiko send_command to make enable support ea…
ktbyers Oct 31, 2018
dc0911e
Merge pull request #268 from walidamer711/2.0.0-beta
dbarrosop Nov 9, 2018
be11ea2
fixes #270
dbarrosop Nov 9, 2018
0864833
Update docstring
ktbyers Nov 9, 2018
f55b9d5
Updating docstrings to fix errors.
ktbyers Nov 9, 2018
0c7c637
Merge pull request #269 from ktbyers/netmiko_enable
ktbyers Nov 9, 2018
e5b8983
Merge pull request #272 from nornir-automation/fix-270
dbarrosop Nov 9, 2018
409e7cb
Fixed an issue deserializing ansible inventory
dbarrosop Nov 11, 2018
8b96415
Fixed an issue deserializing netbox inventory
dbarrosop Nov 11, 2018
ce18365
Add query capabilities to netbox
dbarrosop Nov 11, 2018
c7dbbd7
Merge pull request #275 from nornir-automation/filter_netbox
dbarrosop Nov 13, 2018
b528342
Merge pull request #274 from nornir-automation/inv_plugins_data
dbarrosop Nov 13, 2018
5d76da5
Release new beta
dbarrosop Nov 13, 2018
3211f1f
Merge pull request #276 from nornir-automation/bump_beta_version
dbarrosop Nov 14, 2018
4165ff6
initial plugin support for netmiko save_config() method
wvandeun Nov 8, 2018
e53b660
Update inventory.ipynb
r-bhikhie Nov 16, 2018
1f4f44b
Merge pull request #277 from r-bhikhie/patch-1
ktbyers Nov 16, 2018
81c7434
Minor corrections to some docstrings
ktbyers Nov 19, 2018
a0ba0b8
resolve falsey vars correctly
dbarrosop Nov 20, 2018
444e9dd
Changed to is not None, changed comments, formatted to black
omershtivi1 Nov 24, 2018
837bf85
Merge pull request #283 from omershtivi/fix_contrib
dbarrosop Nov 26, 2018
15d58c4
Merge pull request #271 from enzzzy/plugin_netmiko_save_config
ktbyers Nov 26, 2018
ef322d3
Update grouping_tasks.ipynb
billgrant Nov 26, 2018
fc4c565
Merge pull request #284 from billgrant/patch-1
dbarrosop Nov 28, 2018
0c4a025
Merge pull request #280 from nornir-automation/bug_in_var_resolution
dbarrosop Dec 5, 2018
522e465
bump verstion to 2.0.0 and update changelog
dbarrosop Dec 16, 2018
2c4ae55
fix CI
dbarrosop Dec 16, 2018
976e264
add echo_data plugin (#285)
dbarrosop Dec 17, 2018
fee75ff
Merge pull request #286 from nornir-automation/release
dbarrosop Dec 17, 2018
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,6 @@ output/
.DS_Store

.pytest_cache/
.mypy_cache/

.vscode
11 changes: 11 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
build:
image: latest

python:
version: 3.6
pip_install: true

formats: []

requirements_file: docs/requirements.txt
9 changes: 6 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ addons:
- pandoc
language: python
python:
- 2.7
- 3.4
- 3.5
- 3.6
matrix:
include:
- python: 3.6
env: TOXENV=py36
- python: 3.6
env: TOXENV=sphinx
- python: 3.6
env: TOXENV=black
- python: 3.6
env: TOXENV=pylama
- python: 3.6
env: TOXENV=mypy
- python: 3.6
env: TOXENV=nbval
install:
- pip install tox tox-travis coveralls
script:
Expand Down
17 changes: 16 additions & 1 deletion CHANGELOG.rst
F438
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2.0.0 - December 17 2018
========================

For details about upgrading to 2.0.0 see the [https://nornir.readthedocs.io/en/2.0.0-beta/upgrading/1_to_2.html](notes).

+ [CORE_ENHANCEMENTS] Lots of core enhancements, too many to document
+ [CORE_ENHANCEMENTS] Changes on how the inventory
+ [CORE_ENHANCEMENTS] New ``F`` object for advanced filtering of hosts [docs](file:///Users/dbarroso/workspace/nornir/docs/_build/html/howto/advanced_filtering.html)
+ [CORE_ENHANCEMENTS] Improvements on how to serialize/deserialize user facing data like the configuration and the inventory
+ [CORE_ENHANCEMENTS] Connections are now their own type of plugin
+ [CORE_ENHANCEMENTS] Ability to handle connections manually [docs](file:///Users/dbarroso/workspace/nornir/docs/_build/html/howto/handling_connections.html)
+ [CORE_BUGFIX] Lots
+ [PLUGIN_BUGFIX] Lots
+ [PLUGIN_NEW] netmiko_save_config
+ [PLUGIN_NEW] echo_data

1.1.0 - July 12 2018
====================

Expand All @@ -6,7 +22,6 @@
+ [TESTS] replace nsot container with requests-mock #172
+ [PLUGIN_IMPROVEMENT] Support SSH Agent forwarding for paramiko SSH connections #159
+ [PLUGIN_IMPROVEMENT] allow passing options to napalm getters #156
+ [CORE_NEW_FEATURE] Filter object #155
+ [PLUGIN_BUGFIX] Fix for SSH and API port mapping issues #154
+ [CORE_NEW_FEATURE] add to_dict function so the inventory is serializable #146
+ [CORE_BUGFIX] Fix issues with using built-in and overwriting variable with loop variable #144
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ In order to run tests locally you need to have `Docker <https://docs.docker.com/

.. code-block:: bash

pip -r requirements-dev.txt
pip install -r requirements-dev.txt

Running tests
-------------
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Nornir
=======
Nornir is a pure Python automation framework intented to be used directly from Python. While most automation frameworks use their own DSL which you use to describe what you want to have done, Nornir lets you control everything from Python.
Nornir is a pure Python automation framework intented to be used directly from Python. While most automation frameworks use their own Domain Specific Language (DSL) which you use to describe what you want to have done, Nornir lets you control everything from Python.

One of the benefits we want to highlight with this approach is the ease of troubleshooting, if something goes wrong you can just use your existing debug tools directly from Python (just add a line of `import pdb` & `pdb.set_trace()` and you're good to go). Doing the same using a DSL can be quite time consuming.

Expand Down
44 changes: 22 additions & 22 deletions docs/_data_templates/configuration-parameters.j2
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
The configuration parameters will be set by the :doc:`Nornir.core.configuration.Config </ref/api/configuration>` class.
{% macro document_section(section, schema) %}
{{ section }}
{{ "-" * section|length }}

{% for k, v in params|dictsort %}
----------
{% for k, v in schema["properties"].items() -%}

{{ k }}
----------------------------------
``{{ k }}``
{{ "_" * (k|length + 4) }}

.. list-table::
:widths: 15 85

.. raw:: html
* - **Description**
- {{ v["description"] }}
* - **Type**
- ``{{ v["type"] }}``
* - **Default**
- {{ "``{}``".format(v["default"]) if v["default"] else "" }}
* - **Required**
- ``{{ v["required"] or false }}``
* - **Environment Variable**
- ``{{ "NORNIR_{}_{}".format(section, k).upper() }}``

<table border="1" class="docutils">
<th>Environment variable</th>
<th>Type</th>
<th>Default</th>
<tr>
{% if v['type'] in ('str', 'int', 'bool') %}
<td>{{ v['env'] or 'BRIGADE_' + k|upper }}</td>
{% else %}
<td>N/A</td>
{% endif %}
<td>{{ v['type'] }}</td>
<td>{{ v['default_doc'] or v['default'] }}</td>
</tr>
</table>

{{ v['description'] }}
{% endfor %}
{%- endmacro %}

{% for k, v in schema["properties"].items() if k not in ["user_defined"] %}
{{ document_section(k, v) }}
{% endfor %}
22 changes: 12 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@
import os
import sys

from jinja2 import Environment
from jinja2 import FileSystemLoader
from jinja2 import Environment, FileSystemLoader

sys.path.insert(0, os.path.abspath("../"))

from nornir.core.deserializer.configuration import Config # noqa

from nornir.core.configuration import CONF # noqa

# -- General configuration ------------------------------------------------
BASEPATH = os.path.dirname(__file__)
BASEPATH = os.path.abspath(os.path.dirname(__file__))

# If your documentation needs a minimal Sphinx version, state it here.
#
Expand All @@ -54,7 +53,7 @@

# General information about the project.
project = "nornir"
copyright = "2017, David Barroso"
copyright = "2018, David Barroso"
author = "David Barroso"

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -173,13 +172,18 @@
]


def skip_slots(app, what, name, obj, skip, options):
if obj.__class__.__name__ == "member_descriptor":
return True
return None


def build_configuration_parameters(app):
"""Create documentation for configuration parameters."""

env = Environment(loader=FileSystemLoader("{0}/_data_templates".format(BASEPATH)))
template_file = env.get_template("configuration-parameters.j2")
data = {}
data["params"] = CONF
data["schema"] = Config.schema()
rendered_template = template_file.render(**data)
output_dir = "{0}/configuration/generated".format(BASEPATH)
with open("{}/parameters.rst".format(output_dir), "w") as f:
Expand All @@ -189,7 +193,5 @@ def build_configuration_parameters(app):
def setup(app):
"""Map methods to states of the documentation build."""
app.connect("builder-inited", build_configuration_parameters)
app.connect("autodoc-skip-member", skip_slots)
app.add_stylesheet("css/custom.css")


build_configuration_parameters(None)
23 changes: 19 additions & 4 deletions docs/configuration/index.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
Configuration
=============

Each configuration parameter are applied in the following order:
The configuration is comprised of a set of sections and parameters for those sections. You can set the configuration programmatically using nornir by passing a dictionary of options for each section, by using a YAML file, by setting the corresponding environment variables or by a combination of the three. The order of preference from less to more preferred is "configuration file" -> "env variable" -> "code".

1. Environment variable
2. Parameter in configuration file / object
3. Default value
An example using ``InitNornir`` would be::

nr = InitNornir(
core={"num_workers": 20},
logging={"file": "mylogs", "level": "debug"}
)

A similar example using a ``yaml`` file:

.. include:: ../howto/advanced_filtering/config.yaml
:code: yaml

Next, you can find each section and their corresponding options.

.. include:: generated/parameters.rst

user_defined
------------

You can set any ``<k, v>`` pair you want here and you will have it available under your configuration object, i.e. ``nr.config.user_defined.my_app_option``.
Loading
0