Skip to content

Commit af3c727

Browse files
authored
Merge pull request #280 from lgarber-akamai/fix/ips-global
fix: Resolve error when attempting to parse global IPv6 ranges in Instance.ips
2 parents 5ee2ea3 + b9f7703 commit af3c727

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

linode_api4/objects/linode.py

Lines changed: 5 additions & 2 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+
pools = [
469+
IPv6Range(self._client, r["range"])
470+
for r in result["ipv6"]["global"]
471+
]
469472

470473
ips = MappedObject(
471474
**{

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",

0 commit comments

Comments
 (0)