SealSkin

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 * 1024
funchome_path(username, home_name) -> str

Return the directory of a user's home on this node.

paramusernamestr
paramhome_namestr

Returns

str
funcis_mounted(username, home_name) -> bool

Whether a running session on this node has the home directory mounted.

paramusernamestr
paramhome_namestr

Returns

bool
func_archive(username, home_name, failed) -> AsyncIterator[bytes]

Yield a tar archive of a home directory, noting in failed when tar did not finish cleanly.

paramusernamestr
paramhome_namestr
paramfailedlist[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.

paramusernamestr
paramhome_namestr
paramtargetstr

Returns

dict

{"status": "success", "node": <target id>}.

funcreceive(username, home_name, chunks) -> None

Unpack the archive of a home directory another node sends, in place only when all of it arrived.

paramusernamestr
paramhome_namestr
paramchunksAsyncIterator[bytes]

Returns

None
funcdiscard(username, home_name) -> None

Remove a home directory this node received in a move that then failed.

paramusernamestr
paramhome_namestr

Returns

None