Skip to content

Commit

Permalink
Merge pull request #44 from nautobot/develop
Browse files Browse the repository at this point in the history
Bump Version to 2.2.0
  • Loading branch information
itdependsnetworks authored Nov 12, 2021
2 parents 8f9cf9d + db67435 commit 95bafff
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.9"
python-version: "3.9.7"
- name: "Install Python Packages for Linting"
run: "pip install --upgrade pip wheel invoke toml black"
- name: "Linting: Black"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## v2.2.0

- (#41) Added jinja2 filter pass to generate config
- (#42) Added Cisco ASA mapping to default mapping

## v2.1.2

- (#40) Fix nornir inventory defaults

## v2.1.1

- (#31) Migrate from Travis-CI to GitHub Actions for CI
Expand Down
1 change: 1 addition & 0 deletions nornir_nautobot/plugins/tasks/dispatcher/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
_DEFAULT_DRIVERS_MAPPING = {
"default": "nornir_nautobot.plugins.tasks.dispatcher.default.NautobotNornirDriver",
"default_netmiko": "nornir_nautobot.plugins.tasks.dispatcher.default.NetmikoNautobotNornirDriver",
"cisco_asa": "nornir_nautobot.plugins.tasks.dispatcher.cisco_asa.NautobotNornirDriver",
"cisco_nxos": "nornir_nautobot.plugins.tasks.dispatcher.cisco_nxos.NautobotNornirDriver",
"cisco_ios": "nornir_nautobot.plugins.tasks.dispatcher.cisco_ios.NautobotNornirDriver",
"cisco_xr": "nornir_nautobot.plugins.tasks.dispatcher.cisco_xr.NautobotNornirDriver",
Expand Down
7 changes: 7 additions & 0 deletions nornir_nautobot/plugins/tasks/dispatcher/cisco_asa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""network_importer driver for cisco_asa."""

from .default import NetmikoNautobotNornirDriver as DefaultNautobotNornirDriver


class NautobotNornirDriver(DefaultNautobotNornirDriver):
"""Driver for Cisco ASA."""
11 changes: 10 additions & 1 deletion nornir_nautobot/plugins/tasks/dispatcher/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import os
import socket
from typing import Optional
import jinja2

from netmiko.ssh_exception import NetmikoAuthenticationException, NetmikoTimeoutException
Expand Down Expand Up @@ -147,7 +148,13 @@ def compliance_config(

@staticmethod
def generate_config(
task: Task, logger, obj, jinja_template: str, jinja_root_path: str, output_file_location: str
task: Task,
logger,
obj,
jinja_template: str,
jinja_root_path: str,
output_file_location: str,
jinja_filters: Optional[dict] = None,
) -> Result:
"""A small wrapper around template_file Nornir task.
Expand All @@ -157,6 +164,7 @@ def generate_config(
obj (Device): A Nautobot Device Django ORM object instance.
jinja_template (str): The file location of the actual Jinja template.
jinja_root_path (str): The file folder where the file will be saved to.
jinja_filters (dict): The filters which will be added to the jinja2 environment.
output_file_location (str): The filename where the file will be saved to.
Returns:
Expand All @@ -168,6 +176,7 @@ def generate_config(
task=template_file,
template=jinja_template,
path=jinja_root_path,
jinja_filters=jinja_filters,
)[0].result
except NornirSubTaskError as exc:
if isinstance(exc.result.exception, jinja2.exceptions.UndefinedError): # pylint: disable=no-else-raise
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nornir-nautobot"
version = "2.1.2"
version = "2.2.0"
description = "Nornir Nautobot"
authors = ["Network to Code, LLC <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 95bafff

Please sign in to comment.