Skip to content

Commit

Permalink
Merge pull request #740 from nornir-automation/prepare_3.2.0
Browse files Browse the repository at this point in the history
prepare 3.2.0 release
  • Loading branch information
dbarrosop authored Nov 16, 2021
2 parents b68a48d + 3a9a04b commit 30671a3
Show file tree
Hide file tree
Showing 12 changed files with 822 additions and 601 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Changelog
==========

3.2.0 - November 16 2021
------------------------

- update gha snok/install-poetry (#736) @dbarrosop
- Update pygments because of vulnerabilities (#732) @ubaumann
- Replace pkg_resources with importlib (#731) @ubaumann
- Fix GitHub actions MacOS arch failure (#729) @ktbyers
- Minor doc error on NORNIR_RUNNER_OPTIONS environment variable (#725) @ktbyers
- Correct configuration order preference error (#728) @ktbyers
- Update task_results.ipynb (#715) @MajesticFalcon
- fixing domain name typo (#704) @marco-minervino
- update ruamel dependency (#694) @itdependsnetworks
- fixed stubs for mypy 0.900 (#696) @dbarrosop

3.1.1 - April 26 2021
---------------------

Expand Down
2 changes: 1 addition & 1 deletion nornir/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def run(
return result

def dict(self):
""" Return a dictionary representing the object. """
"""Return a dictionary representing the object."""
return {"data": self.data.dict(), "inventory": self.inventory.dict()}

def close_connections(self, on_good=True, on_failed=False):
Expand Down
6 changes: 4 additions & 2 deletions nornir/core/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ def __init__(
self.transform_function = self.Parameters.transform_function.resolve(
transform_function
)
self.transform_function_options = self.Parameters.transform_function_options.resolve(
transform_function_options
self.transform_function_options = (
self.Parameters.transform_function_options.resolve(
transform_function_options
)
)

def dict(self) -> Dict[str, Any]:
Expand Down
2 changes: 1 addition & 1 deletion nornir/core/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ def open_connection(
return conn_obj

def close_connection(self, connection: str) -> None:
""" Close the connection"""
"""Close the connection"""
conn_name = connection
if conn_name not in self.connections:
raise ConnectionNotOpen(conn_name)
Expand Down
2 changes: 1 addition & 1 deletion nornir/core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ def reset_failed_hosts(self) -> None:
self.failed_hosts = set()

def dict(self) -> Dict[str, Any]:
""" Return a dictionary representing the object. """
"""Return a dictionary representing the object."""
return {item: getattr(self, item) for item in GlobalState.__slots__}
14 changes: 11 additions & 3 deletions nornir/init_nornir.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
from nornir.core.state import GlobalState


def load_inventory(config: Config,) -> Inventory:
def load_inventory(
config: Config,
) -> Inventory:
InventoryPluginRegister.auto_register()
inventory_plugin = InventoryPluginRegister.get_plugin(config.inventory.plugin)
inv = inventory_plugin(**config.inventory.options).load()
Expand All @@ -28,14 +30,20 @@ def load_inventory(config: Config,) -> Inventory:
return inv


def load_runner(config: Config,) -> RunnerPlugin:
def load_runner(
config: Config,
) -> RunnerPlugin:
RunnersPluginRegister.auto_register()
runner_plugin = RunnersPluginRegister.get_plugin(config.runner.plugin)
runner = runner_plugin(**config.runner.options)
return runner


def InitNornir(config_file: str = "", dry_run: bool = False, **kwargs: Any,) -> Nornir:
def InitNornir(
config_file: str = "",
dry_run: bool = False,
**kwargs: Any,
) -> Nornir:
"""
Arguments:
config_file(str): Path to the configuration file (optional)
Expand Down
Loading

0 comments on commit 30671a3

Please sign in to comment.