Skip to content

Commit

Permalink
Merge pull request #192 from networktocode/develop
Browse files Browse the repository at this point in the history
Release 1.4.0
  • Loading branch information
jeffkala authored Jan 5, 2023
2 parents c839d51 + bdf5857 commit 339a8bf
Show file tree
Hide file tree
Showing 62 changed files with 78,673 additions and 100 deletions.
41 changes: 32 additions & 9 deletions .github/workflows/oui_filepull.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,50 @@
---
name: "Flat"

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

jobs:
scheduled:
data_gathering:
runs-on: "ubuntu-latest"
env:
BRANCH_NAME: "OUI_Updates"
steps:
# Checkout repo
- name: "Check out code"
uses: "actions/checkout@v2"
with:
ref: "develop"
# 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"
# 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"
with:
deno-version: "v1.10.x"
# Check out the repository so it can read the files inside of it and do other operations
- name: "Check out repo"
uses: "actions/checkout@v2"
# The Flat Action step. We fetch the data in the http_url and save it as downloaded_filename
- name: "Fetch data"
uses: "githubocto/flat@v3"
with:
http_url: "https://standards-oui.ieee.org"
downloaded_filename: "./netutils/oui_mappings.py"
downloaded_filename: "./netutils/data_files/oui_mappings.py"
postprocess: "./flat_postprocess/oui_postprocess.ts"
pr_creation:
runs-on: "ubuntu-latest"
needs: "data_gathering"
steps:
# Checkout repo
- name: "Check out code"
uses: "actions/checkout@v2"
with:
ref: "OUI_Updates"
# Create PR from branch created above into develop
- name: "Create a Pull Request"
run: "gh pr create -B develop -H OUI_Updates --title 'Flatbot OUI File Updates' --body 'Created by Flatbot action'"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
33 changes: 33 additions & 0 deletions docs/admin/release_notes/version_1.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# v1.4 Release Notes

## Release Overview

- Added is_classful utility function.
- Added AOS-CX, IOS-XR, MRV_OPTISWITCH, and EXTREME_NETIRON parsers.
- Update flatbot CI process.
- Fix and cleanup tests and parser information.
- Fix tcp_ping behavior.

## [v1.4.0] - 2023-01

### Added

- [#163](https://github.com/networktocode/netutils/pull/163) Added IP `is_classfull` utility function.
- [#172](https://github.com/networktocode/netutils/pull/172) Added Aruba AOS-CX Parser.
- [#177](https://github.com/networktocode/netutils/pull/177) Added IOS-XR Parser.
- [#182](https://github.com/networktocode/netutils/pull/182) Added Mrv Optiswitch Parser.
- [#182](https://github.com/networktocode/netutils/pull/182) Added Extreme Netiron Parser.

### Changed

- [#178](https://github.com/networktocode/netutils/pull/178) Update OUI flatbot CI process.

### Fixed

- [#173](https://github.com/networktocode/netutils/pull/173) Fixes classfull address naming.
- [#183](https://github.com/networktocode/netutils/pull/183) Updates parser folder info, fix aruba tests.
- [#181](https://github.com/networktocode/netutils/pull/181) Fixes incorrect behavior when calling tcp_ping with timeout >= 3.

### Removed

- [#184](https://github.com/networktocode/netutils/pull/184) Removed redundant `__init__` methods on Parser classes.
2 changes: 1 addition & 1 deletion docs/dev/dev_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ There are a series of considerations documented below, when developing a new par
- Create the class name in the format of `{os_name.title()}ConfigParser`.
- The classes `__init__` method must keep true to the signature or `__init__(self, config)`.
- The class must provide a `self.config_lines` that is a list of `ConfigLine` named tuples.
- Build tests for the `tests/unit/mock/config/compliance/{os_name}/*` and `tests/unit/mock/config/parser/{os_name}/*`.
- Build tests for the `tests/unit/mock/config/compliance/compliance/{os_name}/*` and `tests/unit/mock/config/parser/base/{os_name}/*`.
- Add to `netutils/config/compliance.py` the `parser_map`, that maps the name of the parser to the Plugin.
- Fill out docstrings in the class and methods within the class that describe the parameters and an Example that compiles.
- The following tips will generally be applicable.
Expand Down
4 changes: 4 additions & 0 deletions docs/dev/include_parser_list.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
| OS Name | Parser Class |
| ---------- | ------ |
| arista_eos | netutils.config.parser.EOSConfigParser |
| aruba_aoscx | netutils.config.parser.ArubaConfigParser |
| bigip_f5 | netutils.config.parser.F5ConfigParser |
| cisco_aireos | netutils.config.parser.AIREOSConfigParser |
| cisco_asa | netutils.config.parser.ASAConfigParser |
| cisco_ios | netutils.config.parser.IOSConfigParser |
| cisco_iosxr | netutils.config.parser.IOSXRConfigParser |
| cisco_nxos | netutils.config.parser.NXOSConfigParser |
| citrix_netscaler | netutils.config.parser.NetscalerConfigParser |
| extreme_netiron | netutils.config.parser.NetironConfigParser |
| fortinet_fortios | netutils.config.parser.FortinetConfigParser |
| juniper_junos | netutils.config.parser.JunosConfigParser |
| linux | netutils.config.parser.LINUXConfigParser |
| mrv_optiswitch | netutils.config.parser.OptiswitchConfigParser |
| nokia_sros | netutils.config.parser.NokiaConfigParser |
1 change: 1 addition & 0 deletions docs/user/include_jinja_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
| ipaddress_address | netutils.ip.ipaddress_address |
| ipaddress_interface | netutils.ip.ipaddress_interface |
| ipaddress_network | netutils.ip.ipaddress_network |
| is_classful | netutils.ip.is_classful |
| is_ip | netutils.ip.is_ip |
| is_netmask | netutils.ip.is_netmask |
| netmask_to_cidr | netutils.ip.netmask_to_cidr |
Expand Down
1 change: 1 addition & 0 deletions docs/user/lib_mapper/ansible.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
| NORMALIZED | | ANSIBLE |
| ---------- | -- | ------ |
| arista.eos.eos || arista_eos |
| arubanetworks.aoscx || aruba_aoscx |
| ciena.saos6.saos6 || ciena_saos |
| cisco.asa.asa || cisco_asa |
| cisco.ios.ios || cisco_ios |
Expand Down
1 change: 1 addition & 0 deletions docs/user/lib_mapper/ansible_reverse.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
| ANSIBLE | | NORMALIZED |
| ---------- | -- | ------ |
| arista_eos || arista.eos.eos |
| aruba_aoscx || arubanetworks.aoscx |
| ciena_saos || ciena.saos6.saos6 |
| cisco_asa || cisco.asa.asa |
| cisco_ios || cisco.ios.ios |
Expand Down
1 change: 1 addition & 0 deletions docs/user/lib_mapper/napalm.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| NORMALIZED | | NAPALM |
| ---------- | -- | ------ |
| aoscx || aruba_aoscx |
| asa || cisco_asa |
| cisco_wlc_ssh || cisco_wlc |
| eos || arista_eos |
Expand Down
1 change: 1 addition & 0 deletions docs/user/lib_mapper/napalm_reverse.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
| NAPALM | | NORMALIZED |
| ---------- | -- | ------ |
| arista_eos || eos |
| aruba_aoscx || aoscx |
| brocade_vyos || vyos |
| cisco_asa || asa |
| cisco_ios || ios |
Expand Down
1 change: 1 addition & 0 deletions docs/user/lib_mapper/ntctemplates.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| allied_telesis_awplus || allied_telesis_awplus |
| apresia_aeos || apresia_aeos |
| arista_eos || arista_eos |
| aruba_aoscx || aruba_aoscx |
| aruba_os || aruba_os |
| aruba_osswitch || aruba_osswitch |
| aruba_procurve || aruba_procurve |
Expand Down
1 change: 1 addition & 0 deletions docs/user/lib_mapper/ntctemplates_reverse.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| allied_telesis_awplus || allied_telesis_awplus |
| apresia_aeos || apresia_aeos |
| arista_eos || arista_eos |
| aruba_aoscx || aruba_aoscx |
| aruba_os || aruba_os |
| aruba_osswitch || aruba_osswitch |
| aruba_procurve || aruba_procurve |
Expand Down
1 change: 1 addition & 0 deletions docs/user/lib_mapper/scrapli.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
| NORMALIZED | | SCRAPLI |
| ---------- | -- | ------ |
| arista_eos || arista_eos |
| aruba_aoscx || aruba_aoscx |
| cisco_iosxe || cisco_ios |
| cisco_iosxr || cisco_xr |
| cisco_nxos || cisco_nxos |
Expand Down
1 change: 1 addition & 0 deletions docs/user/lib_mapper/scrapli_reverse.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
| SCRAPLI | | NORMALIZED |
| ---------- | -- | ------ |
| arista_eos || arista_eos |
| aruba_aoscx || aruba_aoscx |
| cisco_ios || cisco_iosxe |
| cisco_nxos || cisco_nxos |
| cisco_xr || cisco_iosxr |
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ nav:
- v1.1: "admin/release_notes/version_1.1.md"
- v1.2: "admin/release_notes/version_1.2.md"
- v1.3: "admin/release_notes/version_1.3.md"
- v1.4: "admin/release_notes/version_1.4.md"
- Developer Guide:
- Extending the Library: "dev/extending.md"
- Contributing to the Library: "dev/contributing.md"
Expand Down
8 changes: 6 additions & 2 deletions netutils/config/compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
parser_map: t.Dict[str, t.Type[parser.BaseConfigParser]] = {
"arista_eos": parser.EOSConfigParser,
"cisco_ios": parser.IOSConfigParser,
"cisco_iosxr": parser.IOSXRConfigParser,
"cisco_nxos": parser.NXOSConfigParser,
"cisco_aireos": parser.AIREOSConfigParser,
"linux": parser.LINUXConfigParser,
Expand All @@ -16,6 +17,9 @@
"fortinet_fortios": parser.FortinetConfigParser,
"nokia_sros": parser.NokiaConfigParser,
"citrix_netscaler": parser.NetscalerConfigParser,
"aruba_aoscx": parser.ArubaConfigParser,
"mrv_optiswitch": parser.OptiswitchConfigParser,
"extreme_netiron": parser.NetironConfigParser,
}

# TODO: Once support for 3.7 is dropped, there should be a typing.TypedDict for this which should then also be used
Expand Down Expand Up @@ -277,8 +281,8 @@ def diff_network_config(compare_config: str, base_config: str, network_os: str)
for parent in line.parents:
if parent not in needed_lines:
needed_lines.append(parent)
needed_lines.append(line.config_line)

if line.config_line:
needed_lines.append(line.config_line)
return "\n".join(needed_lines)


Expand Down
Loading

0 comments on commit 339a8bf

Please sign in to comment.