Skip to content

Commit

Permalink
Merge pull request #99 from nautobot/develop
Browse files Browse the repository at this point in the history
Release 2.5
  • Loading branch information
jvanderaa authored Aug 2, 2023
2 parents 0f4cedd + 666d67d commit cf574c0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 121 deletions.
5 changes: 5 additions & 0 deletions docs/dev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v2.5.0

- (#93) Updates Nornir-Netmiko to 1.0.0 release
- (#97) Adds Jinja Environment option to generate_config

## v2.4.0

- (#61) Be more clear on error messages by @itdependsnetworks
Expand Down
3 changes: 3 additions & 0 deletions nornir_nautobot/plugins/tasks/dispatcher/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def generate_config(
jinja_root_path: str,
output_file_location: str,
jinja_filters: Optional[dict] = None,
jinja_env: Optional[jinja2.Environment] = None,
) -> Result:
"""A small wrapper around template_file Nornir task.
Expand All @@ -172,6 +173,7 @@ def generate_config(
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.
jinja_env (jinja2.Environment): The jinja2 environment to use. If not provided, nornir will create one.
output_file_location (str): The filename where the file will be saved to.
Returns:
Expand All @@ -184,6 +186,7 @@ def generate_config(
template=jinja_template,
path=jinja_root_path,
jinja_filters=jinja_filters,
jinja_env=jinja_env,
)[0].result
except NornirSubTaskError as exc:
if isinstance(exc.result.exception, jinja2.exceptions.UndefinedError): # pylint: disable=no-else-raise
Expand Down
Loading

0 comments on commit cf574c0

Please sign in to comment.