File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11import base64
22import os
3+ from collections .abc import Iterable
34
45from linode_api4 import Profile
56from linode_api4 .common import SSH_KEY_TYPES , load_and_validate_keys
@@ -307,10 +308,12 @@ def instance_create(
307308 kwargs ["firewall_id" ] = fw .id if isinstance (fw , Firewall ) else fw
308309
309310 if "interfaces" in kwargs :
310- kwargs ["interfaces" ] = [
311- i ._serialize () if isinstance (i , ConfigInterface ) else i
312- for i in kwargs ["interfaces" ]
313- ]
311+ interfaces = kwargs .get ("interfaces" )
312+ if interfaces is not None and isinstance (interfaces , Iterable ):
313+ kwargs ["interfaces" ] = [
314+ i ._serialize () if isinstance (i , ConfigInterface ) else i
315+ for i in interfaces
316+ ]
314317
315318 params = {
316319 "type" : ltype .id if issubclass (type (ltype ), Base ) else ltype ,
You can’t perform that action at this time.
0 commit comments