Skip to content

Commit

Permalink
prep for 1.8.1 release (#510)
Browse files Browse the repository at this point in the history
* prep for 1.8.1 release

* More IOS banner related fixes. (#509)

* dual banner parser actual parser fix and empty banner fix

* black

* fixed docs

* Update docs/admin/release_notes/version_1.8.md

* Update docs/admin/release_notes/version_1.8.md

---------

Co-authored-by: Jeff Kala <[email protected]>
  • Loading branch information
susanhooks and jeffkala authored Apr 19, 2024
1 parent 914a20e commit 3b1004e
Show file tree
Hide file tree
Showing 44 changed files with 1,031 additions and 905 deletions.
1 change: 1 addition & 0 deletions development_scripts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Developer script to generate markdown tables."""

from jinja2 import Environment, BaseLoader, select_autoescape
from netutils.utils import _JINJA2_FUNCTION_MAPPINGS
from netutils import lib_mapper
Expand Down
6 changes: 6 additions & 0 deletions docs/admin/release_notes/version_1.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,9 @@

- [#496](https://github.com/networktocode/netutils/pull/496) Fixed vyos lib_mapper.
- [#416](https://github.com/networktocode/netutils/pull/416) Fixed for `\n` characters in parsing bug in palo parser.

## [v1.8.1] 2024-04

### Fixed
- [#509](https://github.com/networktocode/netutils/pull/509) Fixed parsing of empty banner, and dual banner for Cisco platforms.

1 change: 1 addition & 0 deletions flat_postprocess/oui_postprocess.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Python code used to postprocess Flat github action data related to OUI mappings."""

import sys
import re
from urllib.request import urlopen
Expand Down
1 change: 1 addition & 0 deletions flat_postprocess/protocol_number_postprocess.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Python code used to postprocess Flat github action data related to Protocol mappings."""

import csv
import os
import sys
Expand Down
1 change: 1 addition & 0 deletions flat_postprocess/protocol_postprocess.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Python code used to postprocess Flat github action data related to Protocol mappings."""

import csv
import os
import sys
Expand Down
1 change: 0 additions & 1 deletion netutils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Initialization file for library."""


from importlib import metadata


Expand Down
1 change: 1 addition & 0 deletions netutils/bandwidth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for performing bandwidth calculations."""

import re
import typing as t

Expand Down
1 change: 1 addition & 0 deletions netutils/banner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for working with the banner configuration."""

import re

from netutils.constants import CARET_C
Expand Down
1 change: 1 addition & 0 deletions netutils/config/clean.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for working with configuration to clean the config."""

# pylint: disable=anomalous-backslash-in-string

import re
Expand Down
8 changes: 5 additions & 3 deletions netutils/config/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ def paloalto_panos_clean_newlines(cfg: str) -> str:
)

newlines_cleaned_cfg = paloalto_panos_newline_regex.sub(
lambda match: match.group().replace("\n", " ")
if not any(substring in match.group() for substring in paloalto_panos_no_newline_cleanup_match)
else match.group(),
lambda match: (
match.group().replace("\n", " ")
if not any(substring in match.group() for substring in paloalto_panos_no_newline_cleanup_match)
else match.group()
),
cfg,
)

Expand Down
1 change: 1 addition & 0 deletions netutils/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constant definitions used in project."""

from netutils.data_files.protocol_mappings import ( # noqa: F401 # pylint:disable=unused-import
PROTOCOLS,
)
Expand Down
1 change: 1 addition & 0 deletions netutils/dns.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for working with DNS."""

import socket


Expand Down
1 change: 1 addition & 0 deletions netutils/hash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for hashing data."""

import hashlib
import typing as t

Expand Down
1 change: 1 addition & 0 deletions netutils/interface.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for working with interface."""

import itertools
import re
import typing as t
Expand Down
1 change: 1 addition & 0 deletions netutils/os_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for working with OS Versions."""

import typing as t

from netutils._private.version import LooseVersion, StrictVersion # type: ignore
Expand Down
1 change: 1 addition & 0 deletions netutils/ping.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions to create a ping via pure Python."""

import socket


Expand Down
1 change: 1 addition & 0 deletions netutils/protocol_mapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Protocol Mappers."""

import typing as t

from netutils.constants import PROTOCOLS
Expand Down
1 change: 1 addition & 0 deletions netutils/time.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions for working with time."""

import re
import typing as t

Expand Down
1,880 changes: 980 additions & 900 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "netutils"
version = "1.8.0"
version = "1.8.1"
description = "Common helper functions useful in network automation."
authors = ["Network to Code, LLC <[email protected]>"]
license = "Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tasks for use with Invoke."""

import os
import sys

Expand Down
1 change: 1 addition & 0 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Used to setup fixtures to be used through tests"""

import json
import os
import importlib.util
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_acl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the BGP ASN functions."""

# pylint: disable=use-dict-literal

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_basics.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Basic tests that do not require netutils."""

import os
import unittest
import toml
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_compliance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the config compliance functions."""

import glob
import os

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_config_clean.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the config cleaning functions."""

import glob
import os

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_conversion.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test that configurations properly convert from undesired format to desired"""

import glob
import os

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_docs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Update docs tests to include assurance that development script ran."""

import sys

sys.path.append("...")
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_hash.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the hash functions."""

import pytest

from netutils.hash import hash_data
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_interface.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the interface functions."""

import pytest

from netutils import interface
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_lib_helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the lib_helpers definitions."""

from unittest import mock

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_lib_helpers_optionals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the lib_helpers definitions when optional packages are installed."""

from unittest import mock

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_mac.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the MAC address functions."""

import pytest

from netutils import mac
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_os_versions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the lib_helpers definitions."""

import pytest
from netutils import os_version
from netutils.constants import UPGRADE_PATHS
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the network os parser functions."""

import glob
import os

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_password.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the password functions."""

import pytest

from netutils import password
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_private_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for distutils.version."""

# pylint: disable=deprecated-module,missing-class-docstring,invalid-name,protected-access,consider-using-f-string,no-else-continue,raise-missing-from

# Taken from https://github.com/python/cpython/blob/3.11/Lib/distutils/tests/test_version.py
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_protocol_mapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the lib_mapper definitions."""

import pytest

from netutils.protocol_mapper import (
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_route.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the longest_prefix_match definitions."""

from ipaddress import AddressValueError, NetmaskValueError

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_sanitize.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the network os sanitize functions."""

import glob
import os

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_time.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the time functions."""

import pytest
from netutils.time import uptime_string_to_seconds, uptime_seconds_to_string

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the library utilities."""

import os
from glob import glob
from importlib import import_module
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Basic test for version check."""

import unittest
import os
import toml
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_vlan.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for the VLAN functions."""

import os
import glob

Expand Down

0 comments on commit 3b1004e

Please sign in to comment.