From a625ee5c44bd1c2d022ab2740468371828ff1d2f Mon Sep 17 00:00:00 2001 From: Will Johnson Date: Wed, 17 Jun 2020 15:10:02 -0400 Subject: [PATCH] Use the filesystem from the object cache when unmounting / mounting (#1978) filesystems. Signed-off-by: johnsonw --- chroma_core/models/client_mount.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/chroma_core/models/client_mount.py b/chroma_core/models/client_mount.py index 5772f6e241..579d48b8a7 100644 --- a/chroma_core/models/client_mount.py +++ b/chroma_core/models/client_mount.py @@ -293,7 +293,17 @@ def description(self): def get_steps(self): search = lambda cm: (cm.host == self.host and cm.state == "unmounted") unmounted = ObjectCache.get(LustreClientMount, search) - args = dict(host=self.host, filesystems=[(m.filesystem.mount_path(), m.mountpoint) for m in unmounted]) + args = { + "host": self.host, + "filesystems": [ + ( + ObjectCache.get_one(ManagedFilesystem, lambda mf, mtd=m: mf.name == mtd.filesystem).mount_path(), + m.mountpoint, + ) + for m in unmounted + ], + } + return [(MountLustreFilesystemsStep, args)] @@ -353,5 +363,15 @@ def description(self): def get_steps(self): search = lambda cm: (cm.host == self.host and cm.state == "mounted") mounted = ObjectCache.get(LustreClientMount, search) - args = dict(host=self.host, filesystems=[(m.filesystem.mount_path(), m.mountpoint) for m in mounted]) + args = { + "host": self.host, + "filesystems": [ + ( + ObjectCache.get_one(ManagedFilesystem, lambda mf, mtd=m: mf.name == mtd.filesystem).mount_path(), + m.mountpoint, + ) + for m in mounted + ], + } + return [(UnmountLustreFilesystemsStep, args)]