exlab_wizard.sync.transports.rclone#

rclone transport driver. Backend Spec §7.1.3.

Shells out to rclone copy --checksum --bwlimit=<K>K <local> <remote>:<path>. The remote name and path live in config.yaml (equipment.transport.rclone_remote + rclone_remote_path); rclone itself reads rclone.conf for the credential map.

The driver is intentionally thin: it calls the binary, captures stdout / stderr, and translates the exit-code + stderr-substring into one of the TransportErrorKind retry classes. Hash verification is the exlab_wizard.sync.verifier module’s responsibility, NOT this driver’s.

Classes

RcloneTransport(*[, binary])

rclone transport driver.

class exlab_wizard.sync.transports.rclone.RcloneTransport(*, binary='rclone')[source]#

Bases: object

rclone transport driver. Backend Spec §7.1.3.

Parameters:

binary (str)

async hashsum(remote)[source]#

Probe remote via rclone hashsum sha256 and parse the manifest.

Returns a {relative-path: sha256-hex} dict mirroring the on-disk manifest format on success (rc == 0). The dict may legitimately be empty if the remote subtree contains no files.

Failure modes are surfaced as TransportError with the classified error_kind so the caller (the verifier / queue worker) can route via the spec-correct §7.1.5 retry path:

  • AUTH – terminal FAILED.

  • NETWORK / UNKNOWN – backoff retry.

Spawn failure (binary missing) also raises TransportError but with error_kind=None so the worker treats it as a non-terminal failure (operator can install the binary and the job will retry rather than terminating).

Parameters:

remote (str)

Return type:

dict[str, str]

async push(local, remote, *, bwlimit_kibps=None)[source]#

Run rclone copy --checksum from local to remote.

remote is the full <remote_name>:<path> string per the rclone spec. bwlimit_kibps (KiB/s) is forwarded as --bwlimit <K>K when set.

Returns a TransportResult describing the outcome. A process-spawn failure (binary missing) raises TransportError because no retry will help – the lab admin needs to install the binary.

Parameters:
Return type:

TransportResult