Skip to content

Commit 079baac

Browse files
committed
pydantic(netapp): cleanup, update docstrings
1 parent 05eaff5 commit 079baac

File tree

4 files changed

+477
-43
lines changed

4 files changed

+477
-43
lines changed

python/understack-workflows/tests/test_netapp_value_objects.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from understack_workflows.netapp.value_objects import InterfaceSpec
99
from understack_workflows.netapp.value_objects import NamespaceResult
1010
from understack_workflows.netapp.value_objects import NamespaceSpec
11-
from understack_workflows.netapp.value_objects import NodeResult
1211
from understack_workflows.netapp.value_objects import PortResult
1312
from understack_workflows.netapp.value_objects import PortSpec
1413
from understack_workflows.netapp.value_objects import RouteResult
@@ -351,6 +350,7 @@ def test_volume_result_various_states(self):
351350
)
352351
assert result.state == state
353352

353+
354354
class TestPortResult:
355355
"""Test cases for PortResult value object."""
356356

@@ -588,9 +588,9 @@ def test_calculate_destination_comprehensive_third_octet_zero(self):
588588

589589
for ip in test_ips:
590590
destination = RouteSpec._calculate_destination(ip)
591-
assert destination == ipaddress.IPv4Network(
592-
"100.126.0.0/17"
593-
), f"Failed for IP: {ip}"
591+
assert destination == ipaddress.IPv4Network("100.126.0.0/17"), (
592+
f"Failed for IP: {ip}"
593+
)
594594

595595
def test_calculate_destination_comprehensive_third_octet_128(self):
596596
"""Test comprehensive route destination calculation for third octet = 128."""
@@ -606,9 +606,9 @@ def test_calculate_destination_comprehensive_third_octet_128(self):
606606

607607
for ip in test_ips:
608608
destination = RouteSpec._calculate_destination(ip)
609-
assert destination == ipaddress.IPv4Network(
610-
"100.126.128.0/17"
611-
), f"Failed for IP: {ip}"
609+
assert destination == ipaddress.IPv4Network("100.126.128.0/17"), (
610+
f"Failed for IP: {ip}"
611+
)
612612

613613
def test_calculate_destination_comprehensive_invalid_patterns(self):
614614
"""Test comprehensive error handling for all invalid third octet values."""

python/understack-workflows/understack_workflows/main/netapp_configure_net.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from understack_workflows.nautobot import Nautobot
1010
from understack_workflows.netapp.manager import NetAppManager
1111
from understack_workflows.netapp.value_objects import NetappIPInterfaceConfig
12-
from understack_workflows.netapp.value_objects import InterfaceInfo
1312
from understack_workflows.netapp.value_objects import VirtualMachineNetworkInfo
1413

1514
logger = setup_logger(__name__, level=logging.INFO)
@@ -22,7 +21,6 @@
2221
)
2322

2423

25-
2624
def validate_and_normalize_uuid(value: str) -> str:
2725
"""Validate that the input is a valid UUID and normalize it by removing dashes.
2826

python/understack-workflows/understack_workflows/netapp/client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
handling low-level operations and converting between value objects and SDK objects.
77
"""
88

9-
import ipaddress
109
import logging
1110
from abc import ABC
1211
from abc import abstractmethod
@@ -673,7 +672,7 @@ def create_route(self, route_spec: RouteSpec) -> RouteResult:
673672
result = RouteResult(
674673
uuid=str(route.uuid),
675674
gateway=str(route_spec.gateway),
676-
destination=ipaddress.IPv4Network(str(route_spec.destination)),
675+
destination=str(route_spec.destination),
677676
svm_name=route_spec.svm_name,
678677
)
679678

0 commit comments

Comments
 (0)