Skip to content

Commit

Permalink
Merge pull request #322 from networktocode/develop
Browse files Browse the repository at this point in the history
1.5.0 release
  • Loading branch information
itdependsnetworks committed Jul 24, 2023
2 parents 26180f6 + d38a038 commit 1e7355b
Show file tree
Hide file tree
Showing 87 changed files with 5,899 additions and 1,620 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
allow:
- dependency-type: "direct"
22 changes: 17 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
- name: "Linting: black"
run: "poetry run invoke black"
bandit:
Expand All @@ -28,6 +30,8 @@ jobs:
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
- name: "Linting: bandit"
run: "poetry run invoke bandit"
needs:
Expand All @@ -41,6 +45,8 @@ jobs:
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
- name: "Type-Hints: mypy"
run: "poetry run invoke mypy"
needs:
Expand All @@ -54,6 +60,8 @@ jobs:
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
- name: "Linting: pydocstyle"
run: "poetry run invoke pydocstyle"
needs:
Expand All @@ -67,6 +75,8 @@ jobs:
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
- name: "Linting: flake8"
run: "poetry run invoke flake8"
needs:
Expand All @@ -80,6 +90,8 @@ jobs:
uses: "actions/checkout@v2"
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
- name: "Linting: yamllint"
run: "poetry run invoke yamllint"
needs:
Expand All @@ -88,7 +100,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: "ubuntu-20.04"
env:
PYTHON_VER: "${{ matrix.python-version }}"
Expand Down Expand Up @@ -125,7 +137,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.7"]
python-version: ["3.11"]
env:
PYTHON_VER: "${{ matrix.python-version }}"
steps:
Expand Down Expand Up @@ -161,7 +173,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: "ubuntu-20.04"
env:
PYTHON_VER: "${{ matrix.python-version }}"
Expand Down Expand Up @@ -208,7 +220,7 @@ jobs:
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.9"
python-version: "3.11"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
Expand Down Expand Up @@ -237,7 +249,7 @@ jobs:
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.9"
python-version: "3.11"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/oui_filepull.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "OUI-Updates"

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
schedule:
- cron: "0 8 * * 4"

Expand All @@ -11,19 +11,20 @@ jobs:
env:
BRANCH_NAME: "OUI_Updates"
steps:
- name: "Delete existing branch"
run: "git branch -D $BRANCH_NAME || true"
# Checkout repo
- name: "Check out code"
uses: "actions/checkout@v2"
with:
ref: "develop"
# Delete old branch if it exists
- name: "Delete existing branch"
run: "git branch -D $BRANCH_NAME || true"
# Create branch for Flatbot
- name: "Create Flatbot branch"
run: "git checkout -b $BRANCH_NAME"
# Push new branch so Flatbot can make its commit
- name: "Push Flatbot branch"
run: "git push --set-upstream origin $BRANCH_NAME"
run: "git push -f --set-upstream origin $BRANCH_NAME"
# This step installs Deno, which is a new Javascript runtime that improves on Node. Can be used for an optional postprocessing step
- name: "Setup deno"
uses: "denoland/setup-deno@main"
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/proto_filepull.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "Protocol-Updates"

on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
schedule:
- cron: "0 8 * * 4"

Expand All @@ -16,12 +16,15 @@ jobs:
uses: "actions/checkout@v2"
with:
ref: "develop"
# Delete old branch if it exists
- name: "Delete existing branch"
run: "git branch -D $BRANCH_NAME || true"
# Create branch for Flatbot
- name: "Create Flatbot branch"
run: "git checkout -b $BRANCH_NAME"
# Push new branch so Flatbot can make its commit
- name: "Push Flatbot branch"
run: "git push --set-upstream origin $BRANCH_NAME"
run: "git push -f --set-upstream origin $BRANCH_NAME"
# Install Black
- name: "Install Python Black"
run: "pip install black"
Expand Down
12 changes: 12 additions & 0 deletions development_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@
"_dict": lib_mapper.SCRAPLI_LIB_MAPPER_REVERSE,
"_file": "docs/user/lib_mapper/scrapli_reverse.md",
},
"hierconfig": {
"header_src": "HIERCONFIG",
"header_dst": "NORMALIZED",
"_dict": lib_mapper.HIERCONFIG_LIB_MAPPER,
"_file": "docs/user/lib_mapper/hierconfig.md",
},
"hierconfig_reverse": {
"header_src": "NORMALIZED",
"header_dst": "HIERCONFIG",
"_dict": lib_mapper.HIERCONFIG_LIB_MAPPER_REVERSE,
"_file": "docs/user/lib_mapper/hierconfig_reverse.md",
},
},
"PARSER_MAPPER_TEMPLATE": {
"default": {
Expand Down
7 changes: 6 additions & 1 deletion docs/admin/release_notes/version_1.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Added first getter feature with Napalm Getter feature.
- Converted to mkdocs docs.
- Added Citrix NetScaler Parser.
- Removed support for Python 3.6.

## [v1.3.0] - 2022-11

Expand All @@ -22,4 +23,8 @@
- [#152](https://github.com/networktocode/netutils/pull/152) Converted to mkdocs docs.
- [#154](https://github.com/networktocode/netutils/pull/154) Update testing mock strategy for config parsers.
- [#155](https://github.com/networktocode/netutils/pull/155) Update links to render properly on rtd and pypi.
- [#159](https://github.com/networktocode/netutils/pull/159) Change how dunder version is created.
- [#159](https://github.com/networktocode/netutils/pull/159) Change how dunder version is created.

### Removed

- [#152](https://github.com/networktocode/netutils/pull/152) Removed support for Python 3.6.
49 changes: 49 additions & 0 deletions docs/admin/release_notes/version_1.5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# v1.5 Release Notes

## Release Overview

- Added Mikrotik, fastiron, and Panos parsers.
- Added function to allow conversion from Panos curly bracket to set format.
- Updated Interface mappings for FourHundredGigabitEthernet and TwoGigabitEthernet.
- Added Encryption/Decryption/Comparison for Cisco & Juniper Type 9.
- Added Regex functions to primarily be used wihin your Jinja2 environment.

## Announcements

- Deprecation of compare_type5, compare_type7, encrypt_type7, encrypt_type5, and decrypt_type7 in favor of vendor namespaced functions, such as compare_cisco_type5 and decrypt_cisco_type7 to take place on netutils 2.0.
- Support for Python 3.7 is dropped.

## [v1.5.0] - 2023-07

### Added

- [#223](https://github.com/networktocode/netutils/pull/223) Interface abbreviation for TwoGigabitEthernet.
- [#227](https://github.com/networktocode/netutils/pull/227) Add functions for encrypting and decrypting junipter $9$ type passwords.
- [#244](https://github.com/networktocode/netutils/pull/244) Added Mikrotik RouterOS Parser.
- [#252](https://github.com/networktocode/netutils/pull/252) New lib mapper to translate between normalized network OS names and names used by hier_config.
- [#253](https://github.com/networktocode/netutils/pull/253) Add encrypt_type9 (changed to encrypt_cisco_type9) function to netutils.password.
- [#261](https://github.com/networktocode/netutils/pull/261) Added function get_upgrade_path to provide the step upgrade path of to a new version.
- [#262](https://github.com/networktocode/netutils/pull/262) Added Palo Alto networks panos parser.
- [#262](https://github.com/networktocode/netutils/pull/262) Added Palo Alto brace to set conversion function.
- [#264](https://github.com/networktocode/netutils/pull/264) Added Ruckus fastiron parser.
- [#285](https://github.com/networktocode/netutils/pull/285) Added FourHundredGigabitEthernet to REVERSE_MAPPING.
- [#318](https://github.com/networktocode/netutils/pull/318) Added Regex functions to primarily be used wihin your Jinja2 environment.

### Changed

- [#213](https://github.com/networktocode/netutils/pull/213) Clarify when Python 3.6 support was dropped.
- [#286](https://github.com/networktocode/netutils/pull/286) Move password helper names to be namespaced with vendor information. Assign new name to old name to not break semver.
- [#317](https://github.com/networktocode/netutils/pull/317) Dropped Python 3.6 and bump version of dev dependencies.


### Fixed

- [#217](https://github.com/networktocode/netutils/pull/217) Moved where deletion of branch took place in workflow.
- [#218](https://github.com/networktocode/netutils/pull/218) Create dependabot.yml to fix itdependsabot.
- [#219](https://github.com/networktocode/netutils/pull/219) Fix vlanlist_to_config failing on empty list.
- [#224](https://github.com/networktocode/netutils/pull/224) Add Interface type for Cisco App-hosting port.
- [#284](https://github.com/networktocode/netutils/pull/284) Add -f to flatbot branch pushes.
- [#304](https://github.com/networktocode/netutils/pull/304) Update hier_config docs and add fastiron to NAPALM mapper.
- [#305](https://github.com/networktocode/netutils/pull/305) Fixed OS Version docs showing in mkdocs.
- [#316](https://github.com/networktocode/netutils/pull/316) Update panos conversion function to strip out `devices localhost.localdomain`.
- [#317](https://github.com/networktocode/netutils/pull/317) Fix Citrix mock tests file location to correctly run.
20 changes: 10 additions & 10 deletions docs/dev/attribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ Influencers

In many instances variables and function names were reused, but the code was built from scratch to avoid any potential licensing issues. Functions that were known to be rewritten and their known origin.

| Function | Origin |
| ---------------- | ------- |
| asn_to_int | NAPALM |
| is_ip | IPCal |
| ip_to_bin | IPCal |
| get_usable_range | IPCal |
| encrypt_type7 | unknown |
| decrypt_type7 | unknown |
| vlan_to_list | Ansible |
| sanitize_config | NAPALM |
| Function | Origin |
| ------------------- | ------- |
| asn_to_int | NAPALM |
| is_ip | IPCal |
| ip_to_bin | IPCal |
| get_usable_range | IPCal |
| encrypt_cisco_type7 | unknown |
| decrypt_cisco_type7 | unknown |
| vlan_to_list | Ansible |
| sanitize_config | NAPALM |

Relevant PR's

Expand Down
5 changes: 5 additions & 0 deletions docs/dev/code_reference/os_version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# OS Version

::: netutils.os_version
options:
show_submodules: True
5 changes: 5 additions & 0 deletions docs/dev/code_reference/regex.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Regex

::: netutils.regex
options:
show_submodules: True
4 changes: 4 additions & 0 deletions docs/dev/dev_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ The section banners have been simplified to extract the section header itself. T

As the NetScaler configuration uses each line to make a specific configuration change there is no support for parent/child relationships in the parser.

### Palo Alto Conversion

The conversion from curly to set format via the `paloalto_panos_brace_to_set` function strips any usage of `devices localhost.localdomain`. This will be evaluated in the future to be configurable but it is the current intention.

### Duplicate Line Detection

In some circumstances replacing lines, such as secrets without uniqueness in the replacement, will result in duplicated lines that are invalid configuration, such as::
Expand Down
5 changes: 4 additions & 1 deletion docs/dev/include_parser_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
| fortinet_fortios | netutils.config.parser.FortinetConfigParser |
| juniper_junos | netutils.config.parser.JunosConfigParser |
| linux | netutils.config.parser.LINUXConfigParser |
| mikrotik_routeros | netutils.config.parser.RouterOSConfigParser |
| mrv_optiswitch | netutils.config.parser.OptiswitchConfigParser |
| nokia_sros | netutils.config.parser.NokiaConfigParser |
| nokia_sros | netutils.config.parser.NokiaConfigParser |
| paloalto_panos | netutils.config.parser.PaloAltoNetworksConfigParser |
| ruckus_fastiron | netutils.config.parser.FastironConfigParser |
8 changes: 4 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
mkdocs==1.3.1
mkdocs==1.4.3
# Material for MkDocs theme
mkdocs-material==8.3.9
mkdocs-material==8.5.8
# Render custom markdown for version added/changed/remove notes
mkdocs-version-annotations==1.0.0
# Automatic documentation from sources, for MkDocs
mkdocstrings==0.19
mkdocstrings-python==0.7.1
mkdocstrings==0.22.0
mkdocstrings-python==1.1.2
16 changes: 16 additions & 0 deletions docs/user/include_jinja_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
| feature_compliance | netutils.config.compliance.feature_compliance |
| find_unordered_cfg_lines | netutils.config.compliance.find_unordered_cfg_lines |
| section_config | netutils.config.compliance.section_config |
| paloalto_panos_brace_to_set | netutils.config.conversion.paloalto_panos_brace_to_set |
| fqdn_to_ip | netutils.dns.fqdn_to_ip |
| is_fqdn_resolvable | netutils.dns.is_fqdn_resolvable |
| abbreviated_interface_name | netutils.interface.abbreviated_interface_name |
Expand Down Expand Up @@ -51,13 +52,28 @@
| mac_to_format | netutils.mac.mac_to_format |
| mac_to_int | netutils.mac.mac_to_int |
| mac_type | netutils.mac.mac_type |
| get_upgrade_path | netutils.os_version.get_upgrade_path |
| compare_cisco_type5 | netutils.password.compare_cisco_type5 |
| compare_cisco_type7 | netutils.password.compare_cisco_type7 |
| compare_cisco_type9 | netutils.password.compare_cisco_type9 |
| compare_type5 | netutils.password.compare_type5 |
| compare_type7 | netutils.password.compare_type7 |
| decrypt_cisco_type7 | netutils.password.decrypt_cisco_type7 |
| decrypt_juniper_type9 | netutils.password.decrypt_juniper_type9 |
| decrypt_type7 | netutils.password.decrypt_type7 |
| encrypt_cisco_type5 | netutils.password.encrypt_cisco_type5 |
| encrypt_cisco_type7 | netutils.password.encrypt_cisco_type7 |
| encrypt_cisco_type9 | netutils.password.encrypt_cisco_type9 |
| encrypt_juniper_type9 | netutils.password.encrypt_juniper_type9 |
| encrypt_type5 | netutils.password.encrypt_type5 |
| encrypt_type7 | netutils.password.encrypt_type7 |
| get_hash_salt | netutils.password.get_hash_salt |
| tcp_ping | netutils.ping.tcp_ping |
| regex_findall | netutils.regex.regex_findall |
| regex_match | netutils.regex.regex_match |
| regex_search | netutils.regex.regex_search |
| regex_split | netutils.regex.regex_split |
| regex_sub | netutils.regex.regex_sub |
| longest_prefix_match | netutils.route.longest_prefix_match |
| uptime_seconds_to_string | netutils.time.uptime_seconds_to_string |
| uptime_string_to_seconds | netutils.time.uptime_string_to_seconds |
Expand Down
8 changes: 8 additions & 0 deletions docs/user/lib_mapper/hierconfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
| HIERCONFIG | | NORMALIZED |
| ---------- | -- | ------ |
| eos || arista_eos |
| fastiron || ruckus_fastiron |
| ios || cisco_ios |
| iosxe || cisco_xe |
| iosxr || cisco_xr |
| nxos || cisco_nxos |
8 changes: 8 additions & 0 deletions docs/user/lib_mapper/hierconfig_reverse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
| NORMALIZED | | HIERCONFIG |
| ---------- | -- | ------ |
| arista_eos || eos |
| cisco_ios || ios |
| cisco_nxos || nxos |
| cisco_xe || iosxe |
| cisco_xr || iosxr |
| ruckus_fastiron || fastiron |
Loading

0 comments on commit 1e7355b

Please sign in to comment.