Skip to content

Commit 0a7a5cf

Browse files
Fix lint
1 parent 1c524f1 commit 0a7a5cf

6 files changed

Lines changed: 24 additions & 18 deletions

File tree

‎linode_api4/groups/networking.py‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
IPAddress,
1414
IPv6Pool,
1515
IPv6Range,
16-
NetworkTransferPrice,
17-
Region,
1816
NATGateway,
1917
NATGatewayAddress,
18+
NetworkTransferPrice,
19+
Region,
2020
)
2121
from linode_api4.objects.base import _flatten_request_body_recursive
2222
from linode_api4.objects.networking import (
@@ -630,7 +630,6 @@ def reserved_ip_types(self, *filters) -> PaginatedList:
630630
ReservedIPType, *filters, endpoint="/networking/reserved/ips/types"
631631
)
632632

633-
634633
def natgateways(self, *filters):
635634
"""
636635
Retrieves the NAT Gateways your user has access to.
@@ -646,7 +645,6 @@ def natgateways(self, *filters):
646645
"""
647646
return self.client._get_and_filter(NATGateway, *filters)
648647

649-
650648
def natgateway_create(
651649
self,
652650
region: Union[Region, str],
@@ -744,4 +742,3 @@ def natgateway_settings(self) -> NATGatewaySettings:
744742
)
745743

746744
return NATGatewaySettings.from_json(result)
747-

‎linode_api4/objects/linode_interfaces.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,9 @@ class LinodeInterfaceVPCIPv4NATGatewayPortsetPort(JSONObject):
254254
@dataclass
255255
class LinodeInterfaceVPCIPv4NATGatewayPortset(JSONObject):
256256
address: str = ""
257-
ports: List[LinodeInterfaceVPCIPv4NATGatewayPortsetPort] = field(default_factory=list)
257+
ports: List[LinodeInterfaceVPCIPv4NATGatewayPortsetPort] = field(
258+
default_factory=list
259+
)
258260

259261

260262
@dataclass
@@ -270,7 +272,9 @@ class LinodeInterfaceVPCIPv4NATGateway(JSONObject):
270272
addresses: List[str] = field(default_factory=list)
271273
portset_assignments: int = 0
272274
portset_capacity: int = 0
273-
portsets: List[LinodeInterfaceVPCIPv4NATGatewayPortset] = field(default_factory=list) # NOTE: This field may not be available to all users.
275+
portsets: List[LinodeInterfaceVPCIPv4NATGatewayPortset] = field(
276+
default_factory=list
277+
) # NOTE: This field may not be available to all users.
274278

275279

276280
@dataclass

‎linode_api4/objects/networking.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ class VPCIPAddressNATGateway(JSONObject):
233233
addresses: List[str] = field(default_factory=list)
234234
portset_assignments: int = 0
235235
portset_capacity: int = 0
236-
portsets: List[VPCIPAddressNATGatewayPortset] = field(default_factory=list) # NOTE: This field may not be available to all users.
236+
portsets: List[VPCIPAddressNATGatewayPortset] = field(
237+
default_factory=list
238+
) # NOTE: This field may not be available to all users.
237239

238240

239241
@dataclass
@@ -552,7 +554,6 @@ class NATGatewayInterfaceLinode(JSONObject):
552554
url: str = ""
553555

554556

555-
556557
@dataclass
557558
class NATGatewayInterfacePortsetPort(JSONObject):
558559
start: int = 0
@@ -570,7 +571,9 @@ class NATGatewayInterface(JSONObject):
570571
id: int = 0
571572
linode: NATGatewayInterfaceLinode = None
572573
addresses: List[str] = field(default_factory=list)
573-
portsets: List[NATGatewayInterfacePortset] = field(default_factory=list) # NOTE: This field may not be available to all users.
574+
portsets: List[NATGatewayInterfacePortset] = field(
575+
default_factory=list
576+
) # NOTE: This field may not be available to all users.
574577

575578

576579
@dataclass
@@ -747,4 +750,3 @@ def address_interfaces(self, address: str, *filters) -> PaginatedList:
747750
NATGateway.api_endpoint, address
748751
).format(id=self.id),
749752
)
750-

‎linode_api4/objects/vpc.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ class VPCSubnetNATGateway(JSONObject):
149149
addresses: List[str] = None
150150
portset_assignments: int = 0
151151
portset_capacity: int = 0
152-
portsets: List[VPCSubnetNATGatewayPortset] = None # NOTE: This field may not be available to all users.
152+
portsets: List[VPCSubnetNATGatewayPortset] = (
153+
None # NOTE: This field may not be available to all users.
154+
)
153155

154156

155157
class VPCSubnet(DerivedBase):
@@ -224,7 +226,12 @@ def subnet_create(
224226
:param natgateway: The NAT gateway options for this subnet. NOTE: May not be available for all users.
225227
:type natgateway: VPCSubnetNATGatewayOptions
226228
"""
227-
params = {"label": label, "ipv4": ipv4, "ipv6": ipv6, "natgateway": natgateway}
229+
params = {
230+
"label": label,
231+
"ipv4": ipv4,
232+
"ipv6": ipv6,
233+
"natgateway": natgateway,
234+
}
228235

229236
params.update(kwargs)
230237

‎test/unit/groups/networking_test.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,4 +324,3 @@ def test_natgateway_settings(self):
324324
assert settings.allowed_ports_per_interface == [4096, 8192, 16384]
325325
assert settings.maximum_autoscaling_addresses_per_natgateway == 100
326326
assert settings.maximum_reserved_addresses_per_natgateway == 100
327-

‎test/unit/objects/networking_test.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,9 +559,7 @@ def test_create_address_assignment(self):
559559
natgateway = NATGateway(self.client, 42)
560560
assignment = natgateway.address_assignment_create("203.0.113.42")
561561

562-
self.assertEqual(
563-
m.call_url, "/networking/natgateways/42/addresses"
564-
)
562+
self.assertEqual(m.call_url, "/networking/natgateways/42/addresses")
565563
self.assertEqual(m.call_data, {"address": "203.0.113.42"})
566564

567565
assert isinstance(assignment, NATGatewayAddressAssignment)
@@ -632,4 +630,3 @@ def test_list_address_interfaces(self):
632630
assert iface.portsets[0].address == "203.0.113.42"
633631
assert iface.portsets[0].ports[0].start == 2048
634632
assert iface.portsets[0].ports[0].end == 3071
635-

0 commit comments

Comments
 (0)