Skip to content

Commit

Permalink
Fix interfaces parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
zliang-akamai committed Mar 6, 2024
1 parent fc27a62 commit 7b78d0c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions linode_api4/groups/linode.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import base64
import os
from collections.abc import Iterable

from linode_api4 import Profile
from linode_api4.common import SSH_KEY_TYPES, load_and_validate_keys
Expand Down Expand Up @@ -307,10 +308,12 @@ def instance_create(
kwargs["firewall_id"] = fw.id if isinstance(fw, Firewall) else fw

if "interfaces" in kwargs:
kwargs["interfaces"] = [
i._serialize() if isinstance(i, ConfigInterface) else i
for i in kwargs["interfaces"]
]
interfaces = kwargs.get("interfaces")
if interfaces is not None and isinstance(interfaces, Iterable):
kwargs["interfaces"] = [
i._serialize() if isinstance(i, ConfigInterface) else i
for i in interfaces
]

params = {
"type": ltype.id if issubclass(type(ltype), Base) else ltype,
Expand Down

0 comments on commit 7b78d0c

Please sign in to comment.