Skip to content

Commit f6a1500

Browse files
Merge pull request #501 from networktocode/develop
Merge 1.8.0 into main
2 parents 89449c7 + 3fb7206 commit f6a1500

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2220
-719
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: "Setup environment"
1919
uses: "networktocode/gh-action-setup-poetry-environment@v2"
2020
with:
21-
python-version: "3.11"
21+
python-version: "3.12"
2222
- name: "Linting: black"
2323
run: "poetry run invoke black"
2424
bandit:
@@ -31,7 +31,7 @@ jobs:
3131
- name: "Setup environment"
3232
uses: "networktocode/gh-action-setup-poetry-environment@v2"
3333
with:
34-
python-version: "3.11"
34+
python-version: "3.12"
3535
- name: "Linting: bandit"
3636
run: "poetry run invoke bandit"
3737
needs:
@@ -46,7 +46,7 @@ jobs:
4646
- name: "Setup environment"
4747
uses: "networktocode/gh-action-setup-poetry-environment@v2"
4848
with:
49-
python-version: "3.11"
49+
python-version: "3.12"
5050
- name: "Type-Hints: mypy"
5151
run: "poetry run invoke mypy"
5252
needs:
@@ -61,7 +61,7 @@ jobs:
6161
- name: "Setup environment"
6262
uses: "networktocode/gh-action-setup-poetry-environment@v2"
6363
with:
64-
python-version: "3.11"
64+
python-version: "3.12"
6565
- name: "Linting: pydocstyle"
6666
run: "poetry run invoke pydocstyle"
6767
needs:
@@ -76,7 +76,7 @@ jobs:
7676
- name: "Setup environment"
7777
uses: "networktocode/gh-action-setup-poetry-environment@v2"
7878
with:
79-
python-version: "3.11"
79+
python-version: "3.12"
8080
- name: "Linting: flake8"
8181
run: "poetry run invoke flake8"
8282
needs:
@@ -91,7 +91,7 @@ jobs:
9191
- name: "Setup environment"
9292
uses: "networktocode/gh-action-setup-poetry-environment@v2"
9393
with:
94-
python-version: "3.11"
94+
python-version: "3.12"
9595
- name: "Linting: yamllint"
9696
run: "poetry run invoke yamllint"
9797
needs:
@@ -100,7 +100,7 @@ jobs:
100100
strategy:
101101
fail-fast: true
102102
matrix:
103-
python-version: ["3.8", "3.9", "3.10", "3.11"]
103+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
104104
runs-on: "ubuntu-20.04"
105105
env:
106106
PYTHON_VER: "${{ matrix.python-version }}"
@@ -137,7 +137,7 @@ jobs:
137137
strategy:
138138
fail-fast: true
139139
matrix:
140-
python-version: ["3.11"]
140+
python-version: ["3.12"]
141141
env:
142142
PYTHON_VER: "${{ matrix.python-version }}"
143143
steps:
@@ -173,7 +173,7 @@ jobs:
173173
strategy:
174174
fail-fast: true
175175
matrix:
176-
python-version: ["3.8", "3.9", "3.10", "3.11"]
176+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
177177
runs-on: "ubuntu-20.04"
178178
env:
179179
PYTHON_VER: "${{ matrix.python-version }}"
@@ -220,7 +220,7 @@ jobs:
220220
- name: "Set up Python"
221221
uses: "actions/setup-python@v2"
222222
with:
223-
python-version: "3.11"
223+
python-version: "3.12"
224224
- name: "Install Python Packages"
225225
run: "pip install poetry"
226226
- name: "Set env"
@@ -249,7 +249,7 @@ jobs:
249249
- name: "Set up Python"
250250
uses: "actions/setup-python@v2"
251251
with:
252-
python-version: "3.11"
252+
python-version: "3.12"
253253
- name: "Install Python Packages"
254254
run: "pip install poetry"
255255
- name: "Set env"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: "Protocol-Number-Updates"
3+
4+
on: # yamllint disable-line rule:truthy
5+
schedule:
6+
- cron: "0 2 1 * *"
7+
8+
jobs:
9+
data_gathering:
10+
runs-on: "ubuntu-latest"
11+
env:
12+
BRANCH_NAME: "PROTO_NUM_Updates"
13+
steps:
14+
# Checkout repo
15+
- name: "Check out code"
16+
uses: "actions/checkout@v2"
17+
with:
18+
ref: "develop"
19+
# Delete old branch if it exists
20+
- name: "Delete existing branch"
21+
run: "git branch -D $BRANCH_NAME || true"
22+
# Create branch for Flatbot
23+
- name: "Create Flatbot branch"
24+
run: "git checkout -b $BRANCH_NAME"
25+
# Push new branch so Flatbot can make its commit
26+
- name: "Push Flatbot branch"
27+
run: "git push -f --set-upstream origin $BRANCH_NAME"
28+
# Install Black
29+
- name: "Install Python Black"
30+
run: "pip install black"
31+
# This step installs Deno, which is a new Javascript runtime that improves on Node. Can be used for an optional postprocessing step
32+
- name: "Setup deno"
33+
uses: "denoland/setup-deno@main"
34+
with:
35+
deno-version: "v1.10.x"
36+
# The Flat Action step. We fetch the data in the http_url and save it as downloaded_filename
37+
- name: "Fetch data"
38+
uses: "githubocto/flat@v3"
39+
with:
40+
http_url: "https://www.iana.org/assignments/protocol-numbers/protocol-numbers-1.csv"
41+
downloaded_filename: "./netutils/data_files/protocol_number_mappings.py"
42+
postprocess: "./flat_postprocess/protocol_number_postprocess.ts"
43+
pr_creation:
44+
runs-on: "ubuntu-latest"
45+
needs: "data_gathering"
46+
steps:
47+
# Checkout repo
48+
- name: "Check out code"
49+
uses: "actions/checkout@v2"
50+
with:
51+
ref: "PROTO_NUM_Updates"
52+
# Create PR from branch created above into develop
53+
- name: "Create a Pull Request"
54+
run: "gh pr create -B develop -H PROTO_NUM_Updates --title 'Flatbot PROTOCOL Number File Updates' --body 'Created by Flatbot action'"
55+
env:
56+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# v1.8 Release Notes
2+
3+
## Release Overview
4+
5+
- Added support for Python 3.12.
6+
- Added local support of `distutils.version` now that Python 3.12 deprecates disutils.
7+
- Added functions `compare_version_loose` and `compare_version_strict` based on `distutils.version`.
8+
- Added function `paloalto_panos_clean_newlines`.
9+
- Added various lib_mapper updates.
10+
- Added HP Comware parser.
11+
12+
## [v1.8.0] 2024-04
13+
14+
### Added
15+
16+
- [#483](https://github.com/networktocode/netutils/pull/483) Added support for Python 3.12.
17+
- [#483](https://github.com/networktocode/netutils/pull/483) Added local support of `distutils.version` now that Python 3.12 deprecates disutils.
18+
- [#490](https://github.com/networktocode/netutils/pull/490) Add JunOS and Vyatta to HierConfig mappers.
19+
- [#416](https://github.com/networktocode/netutils/pull/416) Added `paloalto_panos_clean_newlines` function.
20+
- [#467](https://github.com/networktocode/netutils/pull/467) Added HP Comware parser.
21+
22+
### Changed
23+
24+
- [#485](https://github.com/networktocode/netutils/pull/485) Changed order of changelog menu.
25+
- [#494](https://github.com/networktocode/netutils/pull/494) Changed protocol number import to be dynamic update via flatbot.
26+
- [#495](https://github.com/networktocode/netutils/pull/495) Changed XR mapping, add tests to ensure always using normalized name, various lib_mapper fixes.
27+
28+
### Fixed
29+
30+
- [#496](https://github.com/networktocode/netutils/pull/496) Fixed vyos lib_mapper.
31+
- [#416](https://github.com/networktocode/netutils/pull/416) Fixed for `\n` characters in parsing bug in palo parser.

docs/dev/attribution.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Influencers
1010
- [IPCal](https://github.com/ammyblabla/ipcal)
1111
- [StackOverflow](https://stackoverflow.com/)
1212
- [Python 3 Docs](https://docs.python.org/3/library/)
13+
- [Python distutils version](https://github.com/python/cpython/blob/3.11/Lib/distutils/version.py)
1314

1415
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.
1516

docs/dev/include_parser_list.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
| citrix_netscaler | netutils.config.parser.NetscalerConfigParser |
1212
| extreme_netiron | netutils.config.parser.NetironConfigParser |
1313
| fortinet_fortios | netutils.config.parser.FortinetConfigParser |
14+
| hp_comware | netutils.config.parser.HPComwareConfigParser |
1415
| juniper_junos | netutils.config.parser.JunosConfigParser |
1516
| linux | netutils.config.parser.LINUXConfigParser |
1617
| mikrotik_routeros | netutils.config.parser.RouterOSConfigParser |

docs/user/include_jinja_list.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
| find_unordered_cfg_lines | netutils.config.compliance.find_unordered_cfg_lines |
1919
| section_config | netutils.config.compliance.section_config |
2020
| paloalto_panos_brace_to_set | netutils.config.conversion.paloalto_panos_brace_to_set |
21+
| paloalto_panos_clean_newlines | netutils.config.conversion.paloalto_panos_clean_newlines |
2122
| fqdn_to_ip | netutils.dns.fqdn_to_ip |
2223
| is_fqdn_resolvable | netutils.dns.is_fqdn_resolvable |
2324
| hash_data | netutils.hash.hash_data |
@@ -59,6 +60,8 @@
5960
| mac_to_format | netutils.mac.mac_to_format |
6061
| mac_to_int | netutils.mac.mac_to_int |
6162
| mac_type | netutils.mac.mac_type |
63+
| compare_version_loose | netutils.os_version.compare_version_loose |
64+
| compare_version_strict | netutils.os_version.compare_version_strict |
6265
| get_upgrade_path | netutils.os_version.get_upgrade_path |
6366
| compare_cisco_type5 | netutils.password.compare_cisco_type5 |
6467
| compare_cisco_type7 | netutils.password.compare_cisco_type7 |

docs/user/lib_mapper/aerleon.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
| ---------- | -- | ------ |
33
| arista || arista_eos |
44
| aruba || aruba_aoscx |
5-
| brocade || ruckus_fastiron |
5+
| brocade || brocade_nos |
66
| cisco || cisco_ios |
77
| ciscoasa || cisco_asa |
88
| cisconx || cisco_nxos |
9-
| ciscoxr || cisco_iosxr |
9+
| ciscoxr || cisco_xr |
1010
| cloudarmor || cloudarmor |
1111
| gce || gce |
1212
| gcp_hf || gcp_hf |
1313
| ipset || ipset |
1414
| iptables || iptables |
1515
| juniper || juniper_junos |
16-
| juniperevo || juniper_evo |
16+
| juniperevo || juniper_junos |
1717
| k8s || k8s |
18-
| msmpc || juniper_msmpc |
18+
| msmpc || juniper_junos |
1919
| nsxt || vmware_nsxt |
2020
| nsxv || vmware_nsxv |
2121
| openconfig || openconfig |
@@ -24,7 +24,7 @@
2424
| pcap || pcap |
2525
| sonic || sonic |
2626
| speedway || speedway |
27-
| srx || juniper_srx |
28-
| srxlo || juniper_srx |
27+
| srx || juniper_junos |
28+
| srxlo || juniper_junos |
2929
| windows || windows |
30-
| windows_advfirewall || windows_advfirewall |
30+
| windows_advfirewall || windows |

docs/user/lib_mapper/aerleon_reverse.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,25 @@
22
| ---------- | -- | ------ |
33
| arista_eos || arista |
44
| aruba_aoscx || aruba |
5-
| brocade_fastiron || brocade |
6-
| brocade_netiron || brocade |
5+
| brocade_nos || brocade |
76
| cisco_asa || ciscoasa |
87
| cisco_ios || cisco |
9-
| cisco_iosxr || ciscoxr |
108
| cisco_nxos || cisconx |
9+
| cisco_xe || cisco |
10+
| cisco_xr || ciscoxr |
1111
| cloudarmor || cloudarmor |
1212
| gce || gce |
1313
| gcp_hf || gcp_hf |
1414
| ipset || ipset |
1515
| iptables || iptables |
16-
| juniper_evo || juniperevo |
1716
| juniper_junos || juniper |
18-
| juniper_msmpc || msmpc |
19-
| juniper_srx || srxlo |
2017
| k8s || k8s |
2118
| openconfig || openconfig |
2219
| packetfilter || packetfilter |
2320
| paloalto_panos || paloalto |
2421
| pcap || pcap |
25-
| ruckus_fastiron || brocade |
2622
| sonic || sonic |
2723
| speedway || speedway |
2824
| vmware_nsxt || nsxt |
2925
| vmware_nsxv || nsxv |
30-
| windows_advfirewall || windows_advfirewall |
31-
| windows_ipsec || windows |
26+
| windows || windows |

docs/user/lib_mapper/capirca.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
| ---------- | -- | ------ |
33
| arista || arista_eos |
44
| aruba || aruba_aoscx |
5-
| brocade || ruckus_fastiron |
5+
| brocade || brocade_nos |
66
| cisco || cisco_ios |
77
| ciscoasa || cisco_asa |
88
| cisconx || cisco_nxos |
9-
| ciscoxr || cisco_iosxr |
9+
| ciscoxr || cisco_xr |
1010
| cloudarmor || cloudarmor |
1111
| gce || gce |
1212
| gcp_hf || gcp_hf |
1313
| ipset || ipset |
1414
| iptables || iptables |
1515
| juniper || juniper_junos |
16-
| juniperevo || juniper_evo |
16+
| juniperevo || juniper_junos |
1717
| k8s || k8s |
18-
| msmpc || juniper_msmpc |
18+
| msmpc || juniper_junos |
1919
| nsxt || vmware_nsxt |
2020
| nsxv || vmware_nsxv |
2121
| openconfig || openconfig |
@@ -24,7 +24,7 @@
2424
| pcap || pcap |
2525
| sonic || sonic |
2626
| speedway || speedway |
27-
| srx || juniper_srx |
28-
| srxlo || juniper_srx |
27+
| srx || juniper_junos |
28+
| srxlo || juniper_junos |
2929
| windows || windows |
30-
| windows_advfirewall || windows_advfirewall |
30+
| windows_advfirewall || windows |

docs/user/lib_mapper/capirca_reverse.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,25 @@
22
| ---------- | -- | ------ |
33
| arista_eos || arista |
44
| aruba_aoscx || aruba |
5-
| brocade_fastiron || brocade |
6-
| brocade_netiron || brocade |
5+
| brocade_nos || brocade |
76
| cisco_asa || ciscoasa |
87
| cisco_ios || cisco |
9-
| cisco_iosxr || ciscoxr |
108
| cisco_nxos || cisconx |
9+
| cisco_xe || cisco |
10+
| cisco_xr || ciscoxr |
1111
| cloudarmor || cloudarmor |
1212
| gce || gce |
1313
| gcp_hf || gcp_hf |
1414
| ipset || ipset |
1515
| iptables || iptables |
16-
| juniper_evo || juniperevo |
1716
| juniper_junos || juniper |
18-
| juniper_msmpc || msmpc |
19-
| juniper_srx || srxlo |
2017
| k8s || k8s |
2118
| openconfig || openconfig |
2219
| packetfilter || packetfilter |
2320
| paloalto_panos || paloalto |
2421
| pcap || pcap |
25-
| ruckus_fastiron || brocade |
2622
| sonic || sonic |
2723
| speedway || speedway |
2824
| vmware_nsxt || nsxt |
2925
| vmware_nsxv || nsxv |
30-
| windows_advfirewall || windows_advfirewall |
31-
| windows_ipsec || windows |
26+
| windows || windows |

docs/user/lib_mapper/forwardnetworks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
| ASA || cisco_asa |
66
| EXTREME_NOS || extreme_netiron |
77
| F5 || bigip_f5 |
8-
| FORTINET || fortinet_fortios |
8+
| FORTINET || fortinet |
99
| IOS || cisco_ios |
1010
| IOS_XE || cisco_ios |
11-
| IOS_XR || cisco_iosxr |
11+
| IOS_XR || cisco_xr |
1212
| JUNOS || juniper_junos |
1313
| LINUX || linux |
1414
| LINUX_OVS_OFCTL || linux |

docs/user/lib_mapper/forwardnetworks_reverse.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
| bigip_f5 || F5 |
66
| cisco_asa || ASA |
77
| cisco_ios || IOS |
8-
| cisco_iosxr || IOS_XR |
98
| cisco_nxos || NXOS |
9+
| cisco_xe || IOS |
10+
| cisco_xr || IOS_XR |
1011
| extreme_netiron || EXTREME_NOS |
11-
| fortinet_fortios || FORTINET |
12+
| fortinet || FORTINET |
1213
| juniper_junos || JUNOS |
1314
| linux || LINUX |
1415
| netscaler || NETSCALER |

0 commit comments

Comments
 (0)