Skip to content

Commit 9fca3ce

Browse files
Remove unnecessary for loop from dict.update()
Co-authored-by: Angus Hollands <[email protected]>
1 parent a18f028 commit 9fca3ce

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

jupyterhub/files/hub/jupyterhub_config.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,16 +342,14 @@ def camelCaseify(s):
342342
# Inject extraVolumes / extraVolumeMounts
343343
extra_volumes = get_config("singleuser.storage.extraVolumes", default={})
344344
if isinstance(extra_volumes, dict):
345-
for key, volume in extra_volumes.items():
346-
volumes.update[key] = volume
345+
volumes.update(extra_volumes)
347346
elif isinstance(extra_volumes, list):
348347
for volume in extra_volumes:
349348
volumes[volume["name"]] = volume
350349

351350
extra_volume_mounts = get_config("singleuser.storage.extraVolumeMounts", default={})
352351
if isinstance(extra_volume_mounts, dict):
353-
for key, volume_mount in extra_volume_mounts.items():
354-
volume_mounts[key] = volume_mount
352+
volume_mounts.update(extra_volume_mounts)
355353
elif isinstance(extra_volume_mounts, list):
356354
# If extraVolumeMounts is a list, we need to add them to the volume_mounts
357355
# dictionary with a unique key.

0 commit comments

Comments
 (0)