Skip to content

Commit

Permalink
fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisbowden committed Apr 22, 2024
1 parent a233115 commit fe7ec3f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 0 additions & 1 deletion agent_based/isis_adjacency.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def __init__(self, params) -> None:
for k, v in params.get("labels").items()
] if params.get("labels") else None


def discover(self, ip_address: str) -> bool:
ip = ipaddress.ip_address(ip_address)
for subnet in self.subnets:
Expand Down
14 changes: 10 additions & 4 deletions tests/unit/agent_based/test_isis_adjacency.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import pytest # type: ignore[import]


from cmk.base.plugins.agent_based.agent_based_api.v1 import (
Result,
Service,
State,
ServiceLabel
)


from cmk.base.plugins.agent_based import isis_adjacency


Expand All @@ -46,10 +50,12 @@ def test_parse_isis_adjacency(string_table, result):


TEST_DISCOVERY_SECTION = {
'10.0.0.1': {'Neighbor IPv4': '10.0.0.1', 'State': 3},
'192.168.0.1': {'Neighbor IPv4': '192.168.0.1', 'State': 3},
'fe80::8c21:b316:7d4e:a9dd': {'Neighbor IPv6': 'fe80::8c21:b316:7d4e:a9dd', 'State': 3}
}
'10.0.0.1': {'Neighbor IPv4': '10.0.0.1', 'State': 3},
'192.168.0.1': {'Neighbor IPv4': '192.168.0.1', 'State': 3},
'fe80::8c21:b316:7d4e:a9dd': {'Neighbor IPv6': 'fe80::8c21:b316:7d4e:a9dd', 'State': 3}
}


@pytest.mark.parametrize('params, section, result', [
(
[],
Expand Down
1 change: 1 addition & 0 deletions web/plugins/wato/isis_adjacency_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def _validate_spec_subnet(value: List, varprefix) -> bool:
)
return True


def _parameter_valuespec_isis_adjacency_discovery() -> Dictionary:
return Dictionary(
required_keys=["subnets"],
Expand Down

0 comments on commit fe7ec3f

Please sign in to comment.