Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
Use the filesystem from the object cache when unmounting / mounting (#…
Browse files Browse the repository at this point in the history
…1978)

filesystems.

Signed-off-by: johnsonw <wjohnson@whamcloud.com>
  • Loading branch information
johnsonw authored Jun 17, 2020
1 parent ff77eee commit a625ee5
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions chroma_core/models/client_mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]


Expand Down Expand Up @@ -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)]

0 comments on commit a625ee5

Please sign in to comment.