Exit reload early if no mounts (#4338)

* Exit reload early if no mounts

* Formatting
This commit is contained in:
Mike Degatano 2023-06-05 10:40:16 -04:00 committed by GitHub
parent 9800955646
commit f4df298cb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,6 +142,9 @@ class MountManager(FileConfiguration, CoreSysAttributes):
@Job(conditions=[JobCondition.MOUNT_AVAILABLE]) @Job(conditions=[JobCondition.MOUNT_AVAILABLE])
async def reload(self) -> None: async def reload(self) -> None:
"""Update mounts info via dbus and reload failed mounts.""" """Update mounts info via dbus and reload failed mounts."""
if not self.mounts:
return
await asyncio.wait( await asyncio.wait(
[self.sys_create_task(mount.update()) for mount in self.mounts] [self.sys_create_task(mount.update()) for mount in self.mounts]
) )