Skip to content

Commit 4a678b3

Browse files
tidy up
1 parent 0a29768 commit 4a678b3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

linode_api4/objects/linode.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,15 +1299,17 @@ def config_create(
12991299
for suffix in generate_device_suffixes(device_limit)
13001300
]
13011301

1302-
def _flatten_device(device: Disk | Volume | None):
1302+
def _flatten_device(device: Disk | Volume | dict | None):
13031303
if device is None:
13041304
return None
13051305
elif isinstance(device, Disk):
13061306
return {"disk_id": device.id}
13071307
elif isinstance(device, Volume):
13081308
return {"volume_id": device.id}
1309+
elif isinstance(device, dict):
1310+
return device
13091311

1310-
raise TypeError("Disk or Volume expected!")
1312+
raise TypeError("Disk, Volume, or dict expected!")
13111313

13121314
def _device_entry(device: Disk | Volume | int, key: str):
13131315
if isinstance(device, (Disk, Volume)):
@@ -1350,7 +1352,11 @@ def _build_devices():
13501352

13511353
if volumes:
13521354
device_list += [
1353-
_device_entry(volume, "volume_id") if volume is not None else None
1355+
(
1356+
_device_entry(volume, "volume_id")
1357+
if volume is not None
1358+
else None
1359+
)
13541360
for volume in normalize_as_list(volumes)
13551361
]
13561362

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ line_length = 80
7979

8080
[tool.black]
8181
line-length = 80
82-
target-version = ["py38", "py39", "py310", "py311", "py312"]
82+
target-version = ["py310", "py311", "py312", "py313", "py314"]
8383

8484
[tool.autoflake]
8585
expand-star-imports = true

0 commit comments

Comments
 (0)