Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/networktocode/netutils i…
Browse files Browse the repository at this point in the history
…nto palo_alto_logging_fixes
  • Loading branch information
bile0026 committed Mar 21, 2024
2 parents 11fe843 + 99315cb commit 5ef0b42
Show file tree
Hide file tree
Showing 55 changed files with 2,133 additions and 427 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Linting: black"
run: "poetry run invoke black"
bandit:
Expand All @@ -31,7 +31,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Linting: bandit"
run: "poetry run invoke bandit"
needs:
Expand All @@ -46,7 +46,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Type-Hints: mypy"
run: "poetry run invoke mypy"
needs:
Expand All @@ -61,7 +61,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Linting: pydocstyle"
run: "poetry run invoke pydocstyle"
needs:
Expand All @@ -76,7 +76,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Linting: flake8"
run: "poetry run invoke flake8"
needs:
Expand All @@ -91,7 +91,7 @@ jobs:
- name: "Setup environment"
uses: "networktocode/gh-action-setup-poetry-environment@v2"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Linting: yamllint"
run: "poetry run invoke yamllint"
needs:
Expand All @@ -100,7 +100,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: "ubuntu-20.04"
env:
PYTHON_VER: "${{ matrix.python-version }}"
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
python-version: ["3.12"]
env:
PYTHON_VER: "${{ matrix.python-version }}"
steps:
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: "ubuntu-20.04"
env:
PYTHON_VER: "${{ matrix.python-version }}"
Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.11"
python-version: "3.12"
- name: "Install Python Packages"
run: "pip install poetry"
- name: "Set env"
Expand Down
36 changes: 36 additions & 0 deletions development_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@

MAPPER = {
"LIB_MAPPER_TEMPLATE": {
"aerleon": {
"header_src": "AERLEON",
"header_dst": "NORMALIZED",
"_dict": lib_mapper.AERLEON_LIB_MAPPER,
"_file": "docs/user/lib_mapper/aerleon.md",
},
"aerleon_reverse": {
"header_src": "NORMALIZED",
"header_dst": "AERLEON",
"_dict": lib_mapper.AERLEON_LIB_MAPPER_REVERSE,
"_file": "docs/user/lib_mapper/aerleon_reverse.md",
},
"ansible": {
"header_src": "ANSIBLE",
"header_dst": "NORMALIZED",
Expand All @@ -46,6 +58,30 @@
"_dict": lib_mapper.ANSIBLE_LIB_MAPPER_REVERSE,
"_file": "docs/user/lib_mapper/ansible_reverse.md",
},
"capirca": {
"header_src": "CAPIRCA",
"header_dst": "NORMALIZED",
"_dict": lib_mapper.CAPIRCA_LIB_MAPPER,
"_file": "docs/user/lib_mapper/capirca.md",
},
"capirca_reverse": {
"header_src": "NORMALIZED",
"header_dst": "CAPIRCA",
"_dict": lib_mapper.CAPIRCA_LIB_MAPPER_REVERSE,
"_file": "docs/user/lib_mapper/capirca_reverse.md",
},
"forwardnetworks": {
"header_src": "FORWARDNETWORKS",
"header_dst": "NORMALIZED",
"_dict": lib_mapper.FORWARDNETWORKS_LIB_MAPPER,
"_file": "docs/user/lib_mapper/forwardnetworks.md",
},
"forwardnetworks_reverse": {
"header_src": "NORMALIZED",
"header_dst": "FORWARDNETWORKS",
"_dict": lib_mapper.FORWARDNETWORKS_LIB_MAPPER_REVERSE,
"_file": "docs/user/lib_mapper/forwardnetworks_reverse.md",
},
"hierconfig": {
"header_src": "HIERCONFIG",
"header_dst": "NORMALIZED",
Expand Down
28 changes: 28 additions & 0 deletions docs/admin/release_notes/version_1.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# v1.7 Release Notes

## Release Overview

- Added the ability to hash a value via `hash_data` function.
- Added the ability to sort IPs a value via `get_ips_sorted` function.
- Added lib_mapper entries for `ruckus_smartzone`, `cisco_xe`, `huawei` and `cisco_xr`.

## [v1.7.0] - 2024-03

### Added

- [#373](https://github.com/networktocode/netutils/pull/373) Added the ability to hash a value via `hash_data` function.
- [#374](https://github.com/networktocode/netutils/pull/374) Added `ruckus_smartzone` to lib_mapper.
- [#451](https://github.com/networktocode/netutils/pull/451) Added `forward` mappings.
- [#473](https://github.com/networktocode/netutils/pull/473) Added the ability to sort IPs a value via `get_ips_sorted` function.

### Changed

- [#369](https://github.com/networktocode/netutils/pull/369) Update doc string example to include the import statement.
- [#429](https://github.com/networktocode/netutils/pull/429) Updated `cisco_xe` mappings.
- [#443](https://github.com/networktocode/netutils/pull/443) Updated `ansible` platform mappers.
- [#466](https://github.com/networktocode/netutils/pull/466) Improve performance of jinja2_convenience_function by not importing NAPALM when called.

### Fixed

- [#429](https://github.com/networktocode/netutils/pull/429) Fixed `huawei` and `cisco_xr` mapping.
- [#445](https://github.com/networktocode/netutils/pull/445) Fixed dual banner issue.
1 change: 1 addition & 0 deletions docs/dev/attribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Influencers
- [IPCal](https://github.com/ammyblabla/ipcal)
- [StackOverflow](https://stackoverflow.com/)
- [Python 3 Docs](https://docs.python.org/3/library/)
- [Python distutils version](https://github.com/python/cpython/blob/3.11/Lib/distutils/version.py)

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.

Expand Down
3 changes: 3 additions & 0 deletions docs/user/include_jinja_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
| get_all_host | netutils.ip.get_all_host |
| get_broadcast_address | netutils.ip.get_broadcast_address |
| get_first_usable | netutils.ip.get_first_usable |
| get_ips_sorted | netutils.ip.get_ips_sorted |
| get_peer_ip | netutils.ip.get_peer_ip |
| get_range_ips | netutils.ip.get_range_ips |
| get_usable_range | netutils.ip.get_usable_range |
Expand All @@ -59,6 +60,8 @@
| mac_to_format | netutils.mac.mac_to_format |
| mac_to_int | netutils.mac.mac_to_int |
| mac_type | netutils.mac.mac_type |
| compare_version_loose | netutils.os_version.compare_version_loose |
| compare_version_strict | netutils.os_version.compare_version_strict |
| 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 |
Expand Down
30 changes: 30 additions & 0 deletions docs/user/lib_mapper/aerleon.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
| AERLEON | | NORMALIZED |
| ---------- | -- | ------ |
| arista || arista_eos |
| aruba || aruba_aoscx |
| brocade || ruckus_fastiron |
| cisco || cisco_ios |
| ciscoasa || cisco_asa |
| cisconx || cisco_nxos |
| ciscoxr || cisco_iosxr |
| cloudarmor || cloudarmor |
| gce || gce |
| gcp_hf || gcp_hf |
| ipset || ipset |
| iptables || iptables |
| juniper || juniper_junos |
| juniperevo || juniper_evo |
| k8s || k8s |
| msmpc || juniper_msmpc |
| nsxt || vmware_nsxt |
| nsxv || vmware_nsxv |
| openconfig || openconfig |
| packetfilter || packetfilter |
| paloalto || paloalto_panos |
| pcap || pcap |
| sonic || sonic |
| speedway || speedway |
| srx || juniper_srx |
| srxlo || juniper_srx |
| windows || windows |
| windows_advfirewall || windows_advfirewall |
31 changes: 31 additions & 0 deletions docs/user/lib_mapper/aerleon_reverse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
| NORMALIZED | | AERLEON |
| ---------- | -- | ------ |
| arista_eos || arista |
| aruba_aoscx || aruba |
| brocade_fastiron || brocade |
| brocade_netiron || brocade |
| cisco_asa || ciscoasa |
| cisco_ios || cisco |
| cisco_iosxr || ciscoxr |
| cisco_nxos || cisconx |
| cloudarmor || cloudarmor |
| gce || gce |
| gcp_hf || gcp_hf |
| ipset || ipset |
| iptables || iptables |
| juniper_evo || juniperevo |
| juniper_junos || juniper |
| juniper_msmpc || msmpc |
| juniper_srx || srxlo |
| k8s || k8s |
| openconfig || openconfig |
| packetfilter || packetfilter |
| paloalto_panos || paloalto |
| pcap || pcap |
| ruckus_fastiron || brocade |
| sonic || sonic |
| speedway || speedway |
| vmware_nsxt || nsxt |
| vmware_nsxv || nsxv |
| windows_advfirewall || windows_advfirewall |
| windows_ipsec || windows |
6 changes: 6 additions & 0 deletions docs/user/lib_mapper/ansible.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
| ANSIBLE | | NORMALIZED |
| ---------- | -- | ------ |
| a10.acos_axapi.a10 || a10 |
| arista.eos.eos || arista_eos |
| arubanetworks.aoscx || aruba_aoscx |
| ciena.saos6.saos6 || ciena_saos |
| cisco.asa.asa || cisco_asa |
| cisco.ios.ios || cisco_ios |
| cisco.iosxr.iosxr || cisco_xr |
| cisco.meraki.meraki || cisco_meraki |
| cisco.nxos.nxos || cisco_nxos |
| community.network.ce || huawei |
| community.network.cnos || lenovo_cnos |
Expand All @@ -20,8 +22,12 @@
| community.network.slxos || extreme_slx |
| community.network.sros || nokia_sros |
| community.network.voss || extreme_vsp |
| dellemc.enterprise_sonic.sonic || sonic |
| dellemc.os10.0s10 || dell_os10 |
| dellemc.os6.os6 || dell_os6 |
| dellemc.os9.os9 || dell_os9 |
| f5networks.f5_bigip.bigip || bigip_f5 |
| fortinet.fortios.fortios || fortinet |
| junipernetworks.junos.junos || juniper_junos |
| paloaltonetworks.panos.panos || paloalto_panos |
| vyos.vyos.vyos || vyos |
7 changes: 7 additions & 0 deletions docs/user/lib_mapper/ansible_reverse.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
| NORMALIZED | | ANSIBLE |
| ---------- | -- | ------ |
| a10 || a10.acos_axapi.a10 |
| arista_eos || arista.eos.eos |
| aruba_aoscx || arubanetworks.aoscx |
| bigip_f5 || f5networks.f5_bigip.bigip |
| ciena_saos || ciena.saos6.saos6 |
| cisco_asa || cisco.asa.asa |
| cisco_ios || cisco.ios.ios |
| cisco_meraki || cisco.meraki.meraki |
| cisco_nxos || cisco.nxos.nxos |
| cisco_xe || cisco.ios.ios |
| cisco_xr || cisco.iosxr.iosxr |
| dell_os10 || dellemc.os10.0s10 |
| dell_os6 || dellemc.os6.os6 |
Expand All @@ -16,12 +20,15 @@
| extreme_nos || community.network.nos |
| extreme_slx || community.network.slxos |
| extreme_vsp || community.network.voss |
| fortinet || fortinet.fortios.fortios |
| huawei || community.network.ce |
| juniper_junos || junipernetworks.junos.junos |
| lenovo_cnos || community.network.cnos |
| lenovo_enos || community.network.enos |
| mikrotik_routeros || community.network.routeros |
| nokia_sros || community.network.sros |
| paloalto_panos || paloaltonetworks.panos.panos |
| pluribus || community.network.netvisor |
| ruckus_icx || community.network.icx |
| sonic || dellemc.enterprise_sonic.sonic |
| vyos || vyos.vyos.vyos |
30 changes: 30 additions & 0 deletions docs/user/lib_mapper/capirca.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
| CAPIRCA | | NORMALIZED |
| ---------- | -- | ------ |
| arista || arista_eos |
| aruba || aruba_aoscx |
| brocade || ruckus_fastiron |
| cisco || cisco_ios |
| ciscoasa || cisco_asa |
| cisconx || cisco_nxos |
| ciscoxr || cisco_iosxr |
| cloudarmor || cloudarmor |
| gce || gce |
| gcp_hf || gcp_hf |
| ipset || ipset |
| iptables || iptables |
| juniper || juniper_junos |
| juniperevo || juniper_evo |
| k8s || k8s |
| msmpc || juniper_msmpc |
| nsxt || vmware_nsxt |
| nsxv || vmware_nsxv |
| openconfig || openconfig |
| packetfilter || packetfilter |
| paloalto || paloalto_panos |
| pcap || pcap |
| sonic || sonic |
| speedway || speedway |
| srx || juniper_srx |
| srxlo || juniper_srx |
| windows || windows |
| windows_advfirewall || windows_advfirewall |
31 changes: 31 additions & 0 deletions docs/user/lib_mapper/capirca_reverse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
| NORMALIZED | | CAPIRCA |
| ---------- | -- | ------ |
| arista_eos || arista |
| aruba_aoscx || aruba |
| brocade_fastiron || brocade |
| brocade_netiron || brocade |
| cisco_asa || ciscoasa |
| cisco_ios || cisco |
| cisco_iosxr || ciscoxr |
| cisco_nxos || cisconx |
| cloudarmor || cloudarmor |
| gce || gce |
| gcp_hf || gcp_hf |
| ipset || ipset |
| iptables || iptables |
| juniper_evo || juniperevo |
| juniper_junos || juniper |
| juniper_msmpc || msmpc |
| juniper_srx || srxlo |
| k8s || k8s |
| openconfig || openconfig |
| packetfilter || packetfilter |
| paloalto_panos || paloalto |
| pcap || pcap |
| ruckus_fastiron || brocade |
| sonic || sonic |
| speedway || speedway |
| vmware_nsxt || nsxt |
| vmware_nsxv || nsxv |
| windows_advfirewall || windows_advfirewall |
| windows_ipsec || windows |
Loading

0 comments on commit 5ef0b42

Please sign in to comment.