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 1
1
import base64
2
2
import os
3
+ from collections .abc import Iterable
3
4
4
5
from linode_api4 import Profile
5
6
from linode_api4 .common import SSH_KEY_TYPES , load_and_validate_keys
@@ -307,10 +308,12 @@ def instance_create(
307
308
kwargs ["firewall_id" ] = fw .id if isinstance (fw , Firewall ) else fw
308
309
309
310
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
+ ]
314
317
315
318
params = {
316
319
"type" : ltype .id if issubclass (type (ltype ), Base ) else ltype ,
You can’t perform that action at this time.
0 commit comments