Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ddae564

Browse files
authoredJan 8, 2025··
Merge pull request #606 from networktocode/develop
1.12.0 Release
2 parents 2097256 + ae370fa commit ddae564

31 files changed

+2224
-1367
lines changed
 

‎.github/workflows/ci.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99

1010
jobs:
1111
black:
12-
runs-on: "ubuntu-20.04"
12+
runs-on: "ubuntu-24.04"
1313
env:
1414
INVOKE_LOCAL: "True"
1515
steps:
@@ -18,11 +18,11 @@ jobs:
1818
- name: "Setup environment"
1919
uses: "networktocode/gh-action-setup-poetry-environment@v2"
2020
with:
21-
python-version: "3.12"
21+
python-version: "3.13"
2222
- name: "Linting: black"
2323
run: "poetry run invoke black"
2424
bandit:
25-
runs-on: "ubuntu-20.04"
25+
runs-on: "ubuntu-24.04"
2626
env:
2727
INVOKE_LOCAL: "True"
2828
steps:
@@ -31,13 +31,13 @@ jobs:
3131
- name: "Setup environment"
3232
uses: "networktocode/gh-action-setup-poetry-environment@v2"
3333
with:
34-
python-version: "3.12"
34+
python-version: "3.13"
3535
- name: "Linting: bandit"
3636
run: "poetry run invoke bandit"
3737
needs:
3838
- "black"
3939
mypy:
40-
runs-on: "ubuntu-20.04"
40+
runs-on: "ubuntu-24.04"
4141
env:
4242
INVOKE_LOCAL: "True"
4343
steps:
@@ -46,13 +46,13 @@ jobs:
4646
- name: "Setup environment"
4747
uses: "networktocode/gh-action-setup-poetry-environment@v2"
4848
with:
49-
python-version: "3.12"
49+
python-version: "3.13"
5050
- name: "Type-Hints: mypy"
5151
run: "poetry run invoke mypy"
5252
needs:
5353
- "black"
5454
pydocstyle:
55-
runs-on: "ubuntu-20.04"
55+
runs-on: "ubuntu-24.04"
5656
env:
5757
INVOKE_LOCAL: "True"
5858
steps:
@@ -61,13 +61,13 @@ jobs:
6161
- name: "Setup environment"
6262
uses: "networktocode/gh-action-setup-poetry-environment@v2"
6363
with:
64-
python-version: "3.12"
64+
python-version: "3.13"
6565
- name: "Linting: pydocstyle"
6666
run: "poetry run invoke pydocstyle"
6767
needs:
6868
- "black"
6969
flake8:
70-
runs-on: "ubuntu-20.04"
70+
runs-on: "ubuntu-24.04"
7171
env:
7272
INVOKE_LOCAL: "True"
7373
steps:
@@ -76,13 +76,13 @@ jobs:
7676
- name: "Setup environment"
7777
uses: "networktocode/gh-action-setup-poetry-environment@v2"
7878
with:
79-
python-version: "3.12"
79+
python-version: "3.13"
8080
- name: "Linting: flake8"
8181
run: "poetry run invoke flake8"
8282
needs:
8383
- "black"
8484
yamllint:
85-
runs-on: "ubuntu-20.04"
85+
runs-on: "ubuntu-24.04"
8686
env:
8787
INVOKE_LOCAL: "True"
8888
steps:
@@ -91,7 +91,7 @@ jobs:
9191
- name: "Setup environment"
9292
uses: "networktocode/gh-action-setup-poetry-environment@v2"
9393
with:
94-
python-version: "3.12"
94+
python-version: "3.13"
9595
- name: "Linting: yamllint"
9696
run: "poetry run invoke yamllint"
9797
needs:
@@ -100,8 +100,8 @@ jobs:
100100
strategy:
101101
fail-fast: true
102102
matrix:
103-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
104-
runs-on: "ubuntu-20.04"
103+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
104+
runs-on: "ubuntu-24.04"
105105
env:
106106
PYTHON_VER: "${{ matrix.python-version }}"
107107
steps:
@@ -133,11 +133,11 @@ jobs:
133133
- "flake8"
134134
- "yamllint"
135135
pylint:
136-
runs-on: "ubuntu-20.04"
136+
runs-on: "ubuntu-24.04"
137137
strategy:
138138
fail-fast: true
139139
matrix:
140-
python-version: ["3.12"]
140+
python-version: ["3.13"]
141141
env:
142142
PYTHON_VER: "${{ matrix.python-version }}"
143143
steps:
@@ -173,8 +173,8 @@ jobs:
173173
strategy:
174174
fail-fast: true
175175
matrix:
176-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
177-
runs-on: "ubuntu-20.04"
176+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
177+
runs-on: "ubuntu-24.04"
178178
env:
179179
PYTHON_VER: "${{ matrix.python-version }}"
180180
steps:
@@ -212,15 +212,15 @@ jobs:
212212
- "pylint"
213213
publish_gh:
214214
name: "Publish to GitHub"
215-
runs-on: "ubuntu-20.04"
215+
runs-on: "ubuntu-24.04"
216216
if: "startsWith(github.ref, 'refs/tags/v')"
217217
steps:
218218
- name: "Check out repository code"
219219
uses: "actions/checkout@v2"
220220
- name: "Set up Python"
221221
uses: "actions/setup-python@v2"
222222
with:
223-
python-version: "3.12"
223+
python-version: "3.13"
224224
- name: "Install Python Packages"
225225
run: "pip install poetry"
226226
- name: "Set env"
@@ -241,15 +241,15 @@ jobs:
241241
- "pytest"
242242
publish_pypi:
243243
name: "Push Package to PyPI"
244-
runs-on: "ubuntu-20.04"
244+
runs-on: "ubuntu-24.04"
245245
if: "startsWith(github.ref, 'refs/tags/v')"
246246
steps:
247247
- name: "Check out repository code"
248248
uses: "actions/checkout@v2"
249249
- name: "Set up Python"
250250
uses: "actions/setup-python@v2"
251251
with:
252-
python-version: "3.12"
252+
python-version: "3.13"
253253
- name: "Install Python Packages"
254254
run: "pip install poetry"
255255
- name: "Set env"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# v1.11 Release Notes
2+
3+
## Release Overview
4+
5+
- Release is the same as v1.10.1
6+
7+
## [v1.11.0] 2024-12
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# v1.12 Release Notes
2+
3+
## Release Overview
4+
5+
- Added Python 3.13 support.
6+
- Removed Python 3.8 support.
7+
8+
## [v1.12.0] 2025-01
9+
10+
### Added
11+
- [593](https://github.com/networktocode/netutils/pull/593) Add nokia_srl to the mappers.
12+
13+
### Changed
14+
15+
- [603](https://github.com/networktocode/netutils/pull/603) Add support for Python 3.8 and add Python 3.13.
16+
17+
### Fixed
18+
19+
- [602](https://github.com/networktocode/netutils/pull/602) Fix ASA banner config parsing.

‎docs/dev/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pull requests are welcomed and automatically built and tested against multiple versions of Python through GitHub Actions.
44

5-
Except for unit tests, testing is only supported on Python 3.9.
5+
Except for unit tests, testing is only supported on Python 3.13.
66

77
The project is packaged with a light development environment based on `Docker` to help with the local development of the project and to run tests within GitHub Actions.
88

‎docs/user/lib_mapper/ansible.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
| f5networks.f5_bigip.bigip || bigip_f5 |
3030
| fortinet.fortios.fortios || fortinet |
3131
| junipernetworks.junos.junos || juniper_junos |
32+
| nokia.srl || nokia_srl |
3233
| paloaltonetworks.panos.panos || paloalto_panos |
3334
| vyos.vyos.vyos || vyos |

‎docs/user/lib_mapper/ansible_reverse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
| lenovo_cnos || community.network.cnos |
2727
| lenovo_enos || community.network.enos |
2828
| mikrotik_routeros || community.network.routeros |
29+
| nokia_srl || nokia.srl |
2930
| nokia_sros || community.network.sros |
3031
| paloalto_panos || paloaltonetworks.panos.panos |
3132
| pluribus || community.network.netvisor |

‎docs/user/lib_mapper/napalm.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
| nxos_ssh || cisco_nxos |
1515
| panos || paloalto_panos |
1616
| ros || mikrotik_routeros |
17+
| srl || nokia_srl |
1718
| sros || nokia_sros |
1819
| vyos || vyos |

‎docs/user/lib_mapper/napalm_reverse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
| huawei || huawei_vrp |
1414
| juniper_junos || junos |
1515
| mikrotik_routeros || ros |
16+
| nokia_srl || srl |
1617
| nokia_sros || sros |
1718
| paloalto_panos || panos |
1819
| vyos || vyos |

‎docs/user/lib_mapper/netmiko.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
| netapp_cdot || netapp_cdot |
8888
| netgear_prosafe || netgear_prosafe |
8989
| netscaler || netscaler |
90+
| nokia_srl || nokia_srl |
9091
| nokia_sros || nokia_sros |
9192
| oneaccess_oneos || oneaccess_oneos |
9293
| ovs_linux || ovs_linux |

‎docs/user/lib_mapper/netmiko_reverse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
| netapp_cdot || netapp_cdot |
8585
| netgear_prosafe || netgear_prosafe |
8686
| netscaler || netscaler |
87+
| nokia_srl || nokia_srl |
8788
| nokia_sros || nokia_sros |
8889
| oneaccess_oneos || oneaccess_oneos |
8990
| ovs_linux || ovs_linux |

‎docs/user/lib_mapper/ntctemplates.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
| netapp_cdot || netapp_cdot |
9090
| netgear_prosafe || netgear_prosafe |
9191
| netscaler || netscaler |
92+
| nokia_srl || nokia_srl |
9293
| nokia_sros || nokia_sros |
9394
| oneaccess_oneos || oneaccess_oneos |
9495
| ovs_linux || ovs_linux |

‎docs/user/lib_mapper/ntctemplates_reverse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
| netapp_cdot || netapp_cdot |
8787
| netgear_prosafe || netgear_prosafe |
8888
| netscaler || netscaler |
89+
| nokia_srl || nokia_srl |
8990
| nokia_sros || nokia_sros |
9091
| oneaccess_oneos || oneaccess_oneos |
9192
| ovs_linux || ovs_linux |

‎docs/user/lib_mapper/scrapli.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
| cisco_iosxe || cisco_ios |
66
| cisco_iosxr || cisco_xr |
77
| cisco_nxos || cisco_nxos |
8-
| juniper_junos || juniper_junos |
8+
| juniper_junos || juniper_junos |
9+
| nokia_srlinux || nokia_srl |

‎docs/user/lib_mapper/scrapli_reverse.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
| cisco_nxos || cisco_nxos |
77
| cisco_xe || cisco_iosxe |
88
| cisco_xr || cisco_iosxr |
9-
| juniper_junos || juniper_junos |
9+
| juniper_junos || juniper_junos |
10+
| nokia_srl || nokia_srlinux |

‎mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ nav:
117117
- Uninstall: "admin/uninstall.md"
118118
- Release Notes:
119119
- "admin/release_notes/index.md"
120+
- v1.12: "admin/release_notes/version_1.12.md"
121+
- v1.11: "admin/release_notes/version_1.11.md"
122+
- v1.10: "admin/release_notes/version_1.10.md"
120123
- v1.9: "admin/release_notes/version_1.9.md"
121124
- v1.8: "admin/release_notes/version_1.8.md"
122125
- v1.7: "admin/release_notes/version_1.7.md"

‎netutils/config/parser.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def find_children_w_parents(
417417
]
418418
for cfg_line in self.build_config_relationship():
419419
parents = cfg_line.parents[0] if cfg_line.parents else None
420-
if parents in potential_parents and self._match_type_check(parents, parent_pattern, match_type):
420+
if parents in potential_parents and self._match_type_check(parents, parent_pattern, match_type): # type: ignore[arg-type]
421421
config.append(cfg_line.config_line)
422422
return config
423423

@@ -913,6 +913,7 @@ def banner_end(self) -> str:
913913
class ASAConfigParser(CiscoConfigParser):
914914
"""Cisco ASA implementation of ConfigParser Class."""
915915

916+
banner_start: t.List[str] = ["banner"]
916917
comment_chars: t.List[str] = ["!", ":"]
917918

918919
def __init__(self, config: str):
@@ -925,6 +926,22 @@ def __init__(self, config: str):
925926
self.same_line_children: t.Set[ConfigLine] = set()
926927
super(ASAConfigParser, self).__init__(config)
927928

929+
def is_banner_start(self, line: str) -> bool:
930+
"""Determine if the line starts a banner config.
931+
932+
Args:
933+
line: The current config line in iteration.
934+
935+
Returns:
936+
True if line starts banner, else False.
937+
"""
938+
for banner_start in self.banner_start:
939+
if not line:
940+
return False
941+
if line.startswith(banner_start):
942+
return True
943+
return False
944+
928945
def _update_config_lines(self, config_line: str) -> None:
929946
"""Add a ``ConfigLine`` object to ``self.config_lines``.
930947

0 commit comments

Comments
 (0)
Please sign in to comment.