Changelogs >

Nornir-salt

PyUp actively tracks 437,546 Python packages for vulnerabilities to keep your Python environments secure.

Scan your dependencies

2022.1.30

BUG

1. Changed FC, FB, FX, FR filters pydantic models to non strict str type, so that can give any value such as number or boolean, as they are converted to strings anyway by FFun

4.8.0

9. Added dependency extras - netmiko, napalm, scrapli, pyats, netconf, gnmi, restconf, dataprocessor - to simplify installation using `pip install nornir-salt[xyz]`

3.4.1

3.3.0

2.11.0

1.0.0

0.13.2

BUGS

1. Improved `cfg_form_commands ` utility function `\\n` handling for send config tasks

CHANGES

1. Improved `netmik_send_config ` method to find prompt before entering enable mode, Arista was failing to enter enable mode due to is_alive method calls

0.13.1

FEATURES/FIXES

1. ncclient_call transaction added support for edit_rpc, edit_arg and commit_arg arguments to have better control over transaction execution, for example can use edit_rpc="load_configration" to call Juniper proprietary load_confgiuration_rpc, or use commit_arg to specify validate=True argument to validate config before commit if supported by device. Enhanced handling of Juniper proprietary commit RPC to support commit_confirmed for Juniper devices 6

CHANGES

1. Improved nclient_call task yangdantic model
2. Enhanced ncclient_call transaction function to better handle return results

0.13.0

0.12.0

CHANGES

0. Deprecated Python 3.6 support, pinned requirement for Python >=3.7,<4.0

0.11.1

BUGS

1. Fixed pydantic model to enlist missing TestsProcessor test function alias names

0.11.0

from nornir_salt import netmiko_send_commands

but starting with 0.11.0 need to use:

from nornir_salt.plugins.tasks import netmiko_send_commands

0.10.1

CHANGES

1. SaltEventProcessor updated to use `datetime` module to add milliseconds to timestamps
2. Code refactoring, added `utils` folder to contain various functions for re-use across the code base
3. Updated `netmiko_send_commands`, `scrapli_send_commands`, `pyats_send_commands` and `napalm_send_commands` to use `cli_form_commands` utils function
4. Updated `netmiko_send_commands`, `scrapli_send_commands` to use `cli_send_command`s utils function
5. Code refactoring for `netmikko_send_config`, `scrapli_send_config`, `pyats_send_config`, `napalm_configure` using `cfg_form_commands` utils function
6. `http_call` task add `raise_fo_status` to requests response object to raise if experienced any errors
7. TabulateFormatter changed to honor `headers` argument for `terse and brief` `tabulate` argument values
8. For connections task changed the way how task name formed to make it more human readable and informative
9. `connections` task `conn_list` changed `connection_type` to `connection_plugin`, also plugin name extracted instead of <class xyz>
10. SaltEventProcessor no merges identity dictionary as is with events data, meaning can add any information into idenity dictionary and that will be emited on saltevent bus
11. Updated RetryRunner to handle multiple connections establishment for custom tasks `CONNECTION_NAME` variable or `connection_name` task parameter - can specify comma separated string to list connections to establish

BUGS

1. Fixed issue 2 bug by making sure to pop `connection_name` from task arguments within QueueRunner
2. Fixed docs spelling using pylint spelling check plugin (pyenchant) and sphinxcontrib-spelling RST plugin
3. Discovered issue in `scrapli-netconf` with determining if request failed, adjusted logic in `scrapli_netconf_call` task to account for it, raised [scrapli-netconf github issue]( https://github.com/scrapli/nornir_scrapli/issues/108)

FEATURES

1. Added utils `MakePlugin` function to emit boilerplate code for task and custom test function plugins.
2. Added `repeat, stop_patern, return_last` and `repeat_interval` support to `netmiko_send_commands` and `scrapli_send_commands plugins` to run commands certain amount of times
3. Added `conn_open` function to `connections` task plugin
4. Added to `ncclient_call` and `scrapli_netconf_call` tasks support for glob pattern `capab_filter` for `server_apabilities` function
5. Added RetryRunner task parameters - `run_connect_retry`, `run_task_retry`, `run_creds_retry`, `run_num_workers`, `run_num_connectors` to influence task execution logic on a per-task basis
6. Added support for `creds_retry` option to RetryRunner to specify a list of credentials to try connecting to devices.
7. Added FFun `FH` filter to filter by hostname values using glob patterns, similar to `FB` but for host's hostname parameter

0.9.0

FEATURES

1. `ToFileProcessor added `skip_failed` argument to control if want to save failed tasks
2. Added `add_host` argument to `TestsProcessor` custom test function to address github ticket 1 and allow passing host object to custom function for processing
3. FFun added `FM` - Filter platforM - filter hosts by platform names using glob patterns str or list of patterns
4. FFun added a list `FFun_functions` with names of all Fx function i.e. `FFun_functions = ["FB", "FP" ...etc]` - this is to facilitate kwargs filtering
5. Task `sleep`, added `sleep_random` timer support, e.g. `sleep_random=(1,5)` or `sleep_random=5` to sleep random time within given interval on a per-host basis
6. Added `TestsProcessor` `ContainsTest` support for `count_le` and `count_ge` arguments.

CHANGES

1. Updated `TestsProcessor` to not process/test results if has failed tasks
2. Updated `TestsProcessor` contains function to convert pattern to string
3. Updated `napalm_configure, scrapli_send_config, netmiko_send_config and pyats_send_config` to try and source config from `host.data.__task__["config"]`
4. PyATSUnicon - when making up connections options if "telnet" in platform name use protocol "telnet" instead of "shh"

BUGS

1. Fixed `RetryRunner` jumphost re-connection handling after closing connection to it
2. Fixed `RetryRunner` to not try connecting to device directly if connection via jumphost failed
3. Fixed `RetryRunner` jumphost intermittent connectivity handling bt no longer using host["exception"] to record errors
4. Improved `TestsProcessor` failed tasks handling making sure skip them and log an error if all tasks are failed for that particular test

0.8.4

0.8.0

BUGS

1. ResultSerialiser improved handling of non supported types for results by converting them to string as a lastage effort
2. Fixed `ncclient_call` `transaction` (previously named `locked`) function commit-confirmed handling

FEATURES

1. Added `PyATSUnicon` connection plugin to interact with devices using Genie library
2. Added `pyats_send_commands` task plugin to send commands over CLI to devices using Genie->PyATS->Unicon libraries, supporting onnections pools and output parsing
3. Added `pyats_send_config` task plugin to send config over CLI to devices using Genie->PyATS->Unicon libraries
4. Updated `HostsKeepalive` function to support pyats connection
5. Significantly improved `transaction` handling for `ncclient_call` and `scrapli_netconf_call` task plugins by checking device capabilities and using them to decide on additional steps such as validate or commit-confirmed
6. Added task plugin `pyats_genie_api` to call any Genie device api
7. Added `InventoryFun` function to interact with nornir inventory, these are the `InventoryFun` functions available:

- create_host/create
- update_host/update
- delete_host/delete
- read_host/read
- read_inventory
- load
- list_hosts

CHANGES

1. `ncclient_call` task renamed `locked` function to `transaction`
2. `scrapli_netconf_call` task renamed `locked` function to `transaction`

0.7.0

FEATURES

1. Added `commit_final_dealy` argument for `netmiko_send_config` task plugin to use with commit confirm feature.
2. Added `napalm_send_commands` task plugin to send commands to devices using NAPALM `cli` method
3. Added `ntfsm` parser function to `DataProcessor` to parse CLi output using TextFSM ntc-templates repository
4. Extended `parse_ttp` function to source templates from `ttp_templates` based on host platform and task command
5. Added new task `sleep` to command Nornir to sleep/pause for certain time
6. Added `terse` tabulate argument to TabulateFormatterto emit same columns as `brief` but in a more dense format to occupy less lines
7. Added `batch` keyword to `netmiko_send_config` task to send config commands in batches, useful if need to push big configurations
8. Added `SaltEventProcessor` to emit SaltStack events on task execution progress.

BUGS

1. When was using err_msg with eval test function and assert in expression, if assert fails, err_msg not used as exception, updated EvalTest logic to prefer using err_msg
2. `FFun` when supplying integer as a pattern was failing, made sure to convert pattern to string for all FFun functions

CHANGES

1. TestsProcessor EvalTest - improved err_msg handling by making it always preferred even when assert used.
2. `netmiko_send_config` no longer uses nornir-netmiko netmiko_send_config task, instead interacts with Netmiko connection directly.
3. Change logging level to be debug for `DataProcessor` if it fails to import third party libraries

0.6.9

0.6.1

BUG

1. Fixed checks for lod_filter for DataProcessor for integer compare operations - le, ge, lt etc, as it was returning full results if value was string

0.6.0

BUGS

1. Fixed netmiko_send_commands and scrapli_send_commands task to ignore empty commands
2. Fixed `DataProcessor` lod_filter/key_filter glob check integers handling

FEATURES

1. Added `jmespath` function to `DataProcessor`
2. `DataProcessor` `find` function extended to support `xpath` and `jmespath` functions
3. Added connection plugin `PyGNMIPlugin` and `pygnmi_call` task plugin
4. `DataProcessor` added new filtering checks `eq, ge, gt, le ,lt, contains` for `find`, `lof_filter` and `key_filter` functions
5. Added `iplkp` function to `DataProcessor` to replace IP addresses with CSV or DNS lookup values

CHANGES

1. `http_call` updated to use more advanced logic to form target url and changed to assigns call method name to task name

0.5.1

BUGS

1. Fixed requirements

0.5.0

1. Added support for ``FB`` to accept list of patterns or comma separated string with patterns
2. Added ``FC`` - filter contains - new filter to filter based on containment
3. Added ``FR`` - filter regex - new filter to filter host names based on regex match
4. Added ``FN`` - filter negate - to introduce match negate, e.g. if ``FB="ABC*"`` and ``FN=True`` - will match all hosts that do NOT have "ABC*" pattern in their names
5. Added ``DataProcessor`` processor plugin with below functions to simplify Nornir results post-processing:

formatters - structured data to text:
- to_str
- to_json
- to_pprint
- to_yaml

loaders - text to structured data:
- load_xml
- load_json

filters:
- flake
- key_filter - filter dictionary keys
- xpath - XML xpath
- match - similar to include
- xml_flake - XML flatten key filter
- lod_filter - list of dictionaries filter
- find

transformers:
- xml_to_json
- xml_flatten
- xml_rm_ns
- path
- flatten
- unflatten

parsers:
- parse_ttp
- run_ttp

6. Added ``DumpResults`` function plugin to save full results of task execution to local file system
7. Added new task plugins to work with files saved by ``ToFileProcessor``: ``file_read, file_list, file_rm, file_diff, files``
8. Added ``HTTPPlugin`` connection plugin to query API over HTTP using requests
9. Added ``http_call`` task plugin to run any ``requests`` methods against HTTP API endpoints
10. Ncclient ``ncclient_call`` task plugin can now interact with devices behind SSH jumphosts if using ``RetryRunner``
11. Added ``sortby`` and ``reverse`` keywords to ``TabulateFormatter`` to sort table results
12. ``TabulateFormatter`` added new ``extend`` directive to form table out of list of dictionaries results
13. Added new connections tasks to handle connections: ``conn_list, conn_close, connections``

BUGS

1. Improved ``TestsProcesor`` to better handle errors in ``task_instance_completed`` method, without it, if exception happens during that method call worker thread halts and never responds
2. Fixed ``send_command_ps`` to raise ``TimeoutError`` instead of ``NetmikoTimeoutError``
3. Fixed ``DiffProcessor`` logic not to run if any of tasks failed

CHANGES

1. Removed formatting ``fmt`` option from ``ncclient_call`` and ``scrapli_netconf_call`` tasks - instead need to use ``DataProcessor`` to format/transform results
2. Removed ``FindString, ParseTTP, ToFile, TestFuncs`` functions from codebase as their functionality replaced with processors plugins

0.4.0

CHANGES

1. Test functions use ResultSerialiser output instead of Nornir results object, that is to be able to pass Nornir results between processes using queues
2. Renamed ``ContainsLinesTest`` ``lines`` argument to ``pattern`` to keep arguments uniform
3. Changes if empty FL list supplied, none of the hosts matched, i.e. supplying FL=[] will not match any host effectively stopping task execution.
4. ResultSerialized will return exception parameter set to None value instead of 'None' string if no exception was raised within task execution
5. Removed netmiko_kwargs argument from netmiko_send_commands task plugin, instead whatever additional supplied arguments used - **kwargs

FEATURES

1. Added support for new return structure to ResultSerialiser
2. RunTestSuite has support for brief output
3. Test functions' tabulate formatter has support for brief output
4. Added support for ``serialize`` argument to ``CustomFunctionTest`` function to opt for results type passed to it
5. ``ContainsTest`` has support for ``count`` argument to count the number of pattern ``occurrences``
6. ``RunTestSuite`` has support for ``print_results`` argument to colour print the results to terminal
7. Added new task netmiko_send_command_ps and extended netmiko_send_commands task to support use_ps
8. Added ToFile processor plugin, ToFile function will be deprecated later on
9. Added TestsProcessor plugin and support for ContainsTest, ContainsLinesTest, EqualTest, CustomFunctionTest, CerberusTest, EvalTest tests
10. Updated promptless mode call - use_ps can be a boolean or dictionary, if dictionary used as **kwargs for ps call
11. Added ncclient connection plugin
12. Added scrapli_netconf_call task plugin
13. Added ncclient_call task plugin
14. Added TabulateFormatter function to represent results in a text-table formatter
15. Made RetryRunner to add stats to result for connection and task execution run attempts
16. FFun added check_if_has_filter argument to check if has Fx filter supplied in kwargs - used by salt nornir proxy minion
17. Added ``scrapli_send_commands`` task plugin
18. Added netmiko_send_config task plugin
19. Modified netmiko_send_command task plugin to support split_lines keyword for use_ps mode to allow sending multi line strings to devices


BUGS

1. ResultSerialized was not returning results if underscored grouped task failed, changed conditions logic to account for such a case
2. ResultSerialized was returning failed task attempt instead of successful one, updated RetryRunner to set "skip_results" to True for previously failed attempts

0.3.1

FEATURES

1. Added ToFile function

0.3.0

CHANGES

1. Removed reference to self for connectors and workers queues, added queues and threads objects explicit deletion at the end.
2. Instead of dead pill, connectors and threads use event object to signal stop.
3. Instead of counting execution time, implemented threading.Timer for task_timeout
4. Moved worker and connector threads functions to global space, presumably making code cleaner and easier to follow.

BUGS

1. ResultSerialiser returning exception object on error, resulting in failure to pickle it and causing process to crash, changed to return host result instead
as it generally contains error information

FEATURES

1. Added HostsKeepalive function to run hosts' connections keep-alive checks
2. Added docs - https://nornir-salt.readthedocs.io/en/latest/

0.2.4

New Features

- Added "FindString" function to search through match results dictionary produced by ResultsSerialiser in a way similar to Cisco "include" or Juniper "match" pipe commands.

0.2.3

BUG fixes

- Fixed ResultSerialiser code typo/bug
- Fixed RetryRunner task wait while loop logic, improved task completion detection and logging

0.2.2

BUG Fixes
- Improved ResultSerialiser function to detect failed tasks based on exception presence

0.2.1

BUG Fixes
- Fixed RetryRunner to properly detect tasks completion for all hosts
- Fixed RetryRunner to not timeout due to queue.get before all tasks completed

0.2.0

BUG Fixes
1. Fixed FFun has_filter breaking Nornir object initialization
2. Fixed RetryRunner to close connections before retrying them

FEATURES
1. Added tcp_ping task
2. RetryRunner - added reconnect_on_fail boolean parameter to reconnect to host on task failure
3. RetryRunner - added support for task_timeout timer to wait for task to complete for all hosts

CHANGES
1. RetryRunner - replaced LOCK acquire/release handling using with statement
2. Updated requirements to include Nornir, Netmiko, nornir_netmiko and nornir_napalm modules
3. Improved Task Failure detection logic for RetryRunner
4. Improoved RetryRunner reconnection logic and task completion detection

0.1.1

BUG Fixes
1. Fixed FFun has_filter breaking Nornir object initialization
2. Fixed RetryRunner to close connections before retrying them

0.1.0

Changelog
- Added FFun helper function
- Fixed RetryRunner issues with connecting via jumphost when host does not have extras defined
- Fixed RetryRunner connection retry logic for jumphosts