Skip to content

Commit a70daed

Browse files
progress
1 parent 7eff2a3 commit a70daed

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

linode_api4/objects/linode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def _serialize(self):
477477
),
478478
"ipv6": (
479479
self.ipv6.dict
480-
if isinstance(self.ipv4, ConfigInterfaceIPv6)
480+
if isinstance(self.ipv6, ConfigInterfaceIPv6)
481481
else self.ipv6
482482
),
483483
"ip_ranges": self.ip_ranges,

test/unit/objects/linode_test.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
from datetime import datetime
22
from test.unit.base import ClientBaseCase
33

4-
from linode_api4 import InstanceDiskEncryptionType, NetworkInterface
4+
from linode_api4 import (
5+
ConfigInterfaceIPv6SLAAC,
6+
InstanceDiskEncryptionType,
7+
NetworkInterface,
8+
)
59
from linode_api4.objects import (
610
Config,
711
ConfigInterface,
812
ConfigInterfaceIPv4,
913
ConfigInterfaceIPv6,
1014
ConfigInterfaceIPv6Options,
15+
ConfigInterfaceIPv6Range,
1116
ConfigInterfaceIPv6RangeOptions,
17+
ConfigInterfaceIPv6SLAAC,
1218
ConfigInterfaceIPv6SLAACOptions,
1319
Disk,
1420
Image,
@@ -507,8 +513,30 @@ def test_update_interfaces(self):
507513
new_interfaces = [
508514
{"purpose": "public", "primary": True},
509515
ConfigInterface("vlan", label="cool-vlan"),
516+
ConfigInterface(
517+
"vpc",
518+
vpc_id=18881,
519+
subnet_id=123,
520+
ipv4=ConfigInterfaceIPv4(vpc="10.0.0.4", nat_1_1="any"),
521+
ipv6=ConfigInterfaceIPv6(
522+
slaac=[
523+
ConfigInterfaceIPv6SLAAC(
524+
range="1234::5678/64", address="1234::5678"
525+
)
526+
],
527+
ranges=[
528+
ConfigInterfaceIPv6Range(range="1234::5678/64")
529+
],
530+
is_public=True,
531+
),
532+
),
533+
]
534+
535+
expected_body = [
536+
new_interfaces[0],
537+
new_interfaces[1]._serialize(),
538+
new_interfaces[2]._serialize(),
510539
]
511-
expected_body = [new_interfaces[0], new_interfaces[1]._serialize()]
512540

513541
config.interfaces = new_interfaces
514542

0 commit comments

Comments
 (0)