Skip to content

Commit

Permalink
Develop (#12)
Browse files Browse the repository at this point in the history
- expose "timeout_ops"
- 3.9 to ci
- better readme
- bump to match big ol scrapli release day
  • Loading branch information
carlmontanari authored Oct 11, 2020
1 parent 049e159 commit 3fded7a
Show file tree
Hide file tree
Showing 36 changed files with 1,079 additions and 47 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
max-parallel: 1
matrix:
os: [ubuntu-latest]
version: [3.8]
version: [3.9]
steps:
- uses: actions/checkout@v2
- name: set up python ${{ matrix.version }}
Expand All @@ -30,7 +30,7 @@ jobs:
max-parallel: 9
matrix:
os: [ubuntu-latest, macos-latest]
version: [3.6, 3.7, 3.8, 3.9-dev]
version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: set up python ${{ matrix.version }}
Expand All @@ -41,9 +41,9 @@ jobs:
# not super friendly looking, but easy way to get major.minor version so we can easily exec only the specific
# version we are targeting with nox, while still having versions like 3.9.0a4
run: |
echo "::set-env name=FRIENDLY_PYTHON_VERSION::$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")"
- name: install libxml2 and libxslt seems to only be needed for 3.9 dev image for some reason
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.9-dev'
echo "FRIENDLY_PYTHON_VERSION=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")" >> $GITHUB_ENV
- name: install libxml2 and libxslt seems to only be needed for 3.9 image for some reason
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.9'
run: |
sudo apt install libxml2-dev
sudo apt install libxslt-dev
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up python 3.8
- name: set up python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: setup publish env
run: |
python -m pip install --upgrade pip
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/weekly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
max-parallel: 1
matrix:
os: [ubuntu-latest]
version: [3.8]
version: [3.9]
steps:
- uses: actions/checkout@v2
- name: set up python ${{ matrix.version }}
Expand All @@ -33,7 +33,7 @@ jobs:
max-parallel: 9
matrix:
os: [ubuntu-latest, macos-latest]
version: [3.6, 3.7, 3.8, 3.9-dev]
version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: set up python ${{ matrix.version }}
Expand All @@ -44,9 +44,9 @@ jobs:
# not super friendly looking, but easy way to get major.minor version so we can easily exec only the specific
# version we are targeting with nox, while still having versions like 3.9.0a4
run: |
echo "::set-env name=FRIENDLY_PYTHON_VERSION::$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")"
- name: install libxml2 and libxslt seems to only be needed for 3.9 dev image for some reason
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.9-dev'
echo "FRIENDLY_PYTHON_VERSION=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")" >> $GITHUB_ENV
- name: install libxml2 and libxslt seems to only be needed for 3.9 image for some reason
if: matrix.os == 'ubuntu-latest' && matrix.version == '3.9'
run: |
sudo apt install libxml2-dev
sudo apt install libxslt-dev
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
lint:
python -m isort nornir_scrapli/
python -m isort examples/
python -m isort tests/
python -m black nornir_scrapli/
python -m black examples/
python -m black tests/
python -m pylama nornir_scrapli/
python -m pydocstyle nornir_scrapli/
Expand Down
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ Feel free to join the very awesome networktocode slack workspace [here](https://
- [Quick Start Guide](#quick-start-guide)
- [Installation](#installation)
- [A Simple Example](#a-simple-example)
- [Additional Examples](#additional-examples)
- [Supported Platforms](#supported-platforms)
- [Documentation](#documentation)
- [General Information](#general-information)
- [Available Tasks](#available-tasks)
- [Telnet/SSH Tasks](#scrapli-core-tasks)
- [NETCONF Tasks](#scrapli-netconf-tasks)
- [Available Functions](#available-functions)


# Quick Start Guide
Expand Down Expand Up @@ -73,6 +77,11 @@ iosxe-1:
auth_strict_key: False
```

**NOTE:** `scrapli-netconf` has no concept (at the moment!) of "platforms" - it simply implements RFC compliant
NETCONF RPCs, so you do not need to pass `iosxr`, `junos` or anything like that to the `scrapli_netconf` connection
options section!


```python
from nornir import InitNornir
from nornir_scrapli.tasks import (
Expand Down Expand Up @@ -145,7 +154,13 @@ When using the `scrapli-netconf` tasks the result object `result` will be the st
), such as the `elapsed_time`, `raw_result`, `xml_result`, etc. -- you can see this in the above example!


## Supported Platforms
## Additional Examples

- [NETCONF Usage](/examples/basic_netconf_usage)
- [Structured Data](/examples/structured_data)


# Supported Platforms

nornir_scrapli supports the "core" scrapli drivers, the GenericDriver (for use with linux hosts generally speaking
), and the [scrapli_community](https://github.com/scrapli/scrapli_community) platforms as well! See
Expand Down Expand Up @@ -287,4 +302,13 @@ Lock the datastore on the device
Unlock the datastore on the device
- [netconf_rpc](https://scrapli.github.io/scrapli_netconf/docs/scrapli_netconf/index.html#scrapli_netconf.NetconfScrape.rpc) -
Send a "bare" RPC to the device
- netconf_validate - Execute the `validate` rpc against a given datastore
- netconf_validate - Execute the `validate` rpc against a given datastore


# Available Functions

- [print_structured_result](/nornir_scrapli) -- this function is very similar to the "normal" `print_result` function
that now ships with the `nornir_utils` library (historically with nornir "core"), except it contains several
additional arguments, most importantly the `parser` argument allows you to select `textfsm` or `genie` to decide
which parser to use to parse the unstructured data stored in the results object. Please see the structured
results example [here](/examples/structured_data) for more details.
2 changes: 1 addition & 1 deletion docs/nornir_scrapli/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1 class="title">Package <code>nornir_scrapli</code></h1>
</summary>
<pre><code class="python">&#34;&#34;&#34;scrapli&#39;s plugin for nornir&#34;&#34;&#34;

__version__ = &#34;2020.09.23&#34;</code></pre>
__version__ = &#34;2020.10.10&#34;</code></pre>
</details>
</section>
<section>
Expand Down
Loading

0 comments on commit 3fded7a

Please sign in to comment.