Skip to content

Commit 54c9adc

Browse files
Merge pull request #284 from linode/main
fix: Merge `Instance.ips()` fix to `dev` branch
2 parents 93dd8de + dc592c7 commit 54c9adc

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

linode_api4/objects/linode.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from linode_api4.objects import Base, DerivedBase, Image, Property, Region
1212
from linode_api4.objects.base import MappedObject
1313
from linode_api4.objects.filtering import FilterableAttribute
14-
from linode_api4.objects.networking import IPAddress, IPv6Pool
14+
from linode_api4.objects.networking import IPAddress, IPv6Range
1515
from linode_api4.paginated_list import PaginatedList
1616

1717
PASSWORD_CHARS = string.ascii_letters + string.digits + string.punctuation
@@ -465,7 +465,10 @@ def ips(self):
465465
result["ipv6"]["link_local"],
466466
)
467467

468-
pools = [IPv6Pool(self._client, result["ipv6"]["global"]["range"])]
468+
ranges = [
469+
IPv6Range(self._client, r["range"])
470+
for r in result["ipv6"]["global"]
471+
]
469472

470473
ips = MappedObject(
471474
**{
@@ -478,7 +481,7 @@ def ips(self):
478481
"ipv6": {
479482
"slaac": slaac,
480483
"link_local": link_local,
481-
"pools": pools,
484+
"ranges": ranges,
482485
},
483486
}
484487
)

test/fixtures/linode_instances_123_ips.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,14 @@
5454
]
5555
},
5656
"ipv6": {
57-
"global": {
58-
"prefix": 124,
59-
"range": "2600:3c01::2:5000:0",
60-
"region": "us-east",
61-
"route_target": "2600:3c01::2:5000:f"
62-
},
57+
"global": [
58+
{
59+
"prefix": 124,
60+
"range": "2600:3c01::2:5000:0",
61+
"region": "us-east",
62+
"route_target": "2600:3c01::2:5000:f"
63+
}
64+
],
6365
"link_local": {
6466
"address": "fe80::f03c:91ff:fe24:3a2f",
6567
"gateway": "fe80::1",

test/objects/linode_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def test_ips(self):
345345
self.assertIsNotNone(ips.ipv4.reserved)
346346
self.assertIsNotNone(ips.ipv6.slaac)
347347
self.assertIsNotNone(ips.ipv6.link_local)
348-
self.assertIsNotNone(ips.ipv6.pools)
348+
self.assertIsNotNone(ips.ipv6.ranges)
349349

350350
def test_initiate_migration(self):
351351
"""

0 commit comments

Comments
 (0)