homes
Moving a home directory from the node that holds it to another.
A home directory lives on one node, and a session that mounts it starts
there. migrate runs on the node that holds the directory: it refuses while
a session has it mounted, streams it to the other node as a tar archive over
the peer channel, and only when that node has unpacked all of it records the
new location and deletes its own copy.
attributelogger= logging.getLogger(__name__)attributeCHUNK= 1024 * 1024funchome_path(username, home_name) -> strReturn the directory of a user's home on this node.
paramusernamestrparamhome_namestrReturns
strfuncis_mounted(username, home_name) -> boolWhether a running session on this node has the home directory mounted.
paramusernamestrparamhome_namestrReturns
boolfunc_archive(username, home_name, failed) -> AsyncIterator[bytes]Yield a tar archive of a home directory, noting in failed when tar did not finish cleanly.
paramusernamestrparamhome_namestrparamfailedlist[str]Returns
collections.abc.AsyncIterator[bytes]funcmigrate(username, home_name, target) -> dict[str, str]Move a home directory on this node to the node target.
paramusernamestrparamhome_namestrparamtargetstrReturns
dict{"status": "success", "node": <target id>}.
funcreceive(username, home_name, chunks) -> NoneUnpack the archive of a home directory another node sends, in place only when all of it arrived.
paramusernamestrparamhome_namestrparamchunksAsyncIterator[bytes]Returns
Nonefuncdiscard(username, home_name) -> NoneRemove a home directory this node received in a move that then failed.
paramusernamestrparamhome_namestrReturns
None