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
|
rclone transport driver. |
- class exlab_wizard.sync.transports.rclone.RcloneTransport(*, binary='rclone')[source]#
Bases:
objectrclone transport driver. Backend Spec §7.1.3.
- Parameters:
binary (
str)
- async hashsum(remote)[source]#
Probe
remoteviarclone hashsum sha256and 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
TransportErrorwith the classifiederror_kindso 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
TransportErrorbut witherror_kind=Noneso the worker treats it as a non-terminal failure (operator can install the binary and the job will retry rather than terminating).
- async push(local, remote, *, bwlimit_kibps=None)[source]#
Run
rclone copy --checksumfromlocaltoremote.remoteis the full<remote_name>:<path>string per the rclone spec.bwlimit_kibps(KiB/s) is forwarded as--bwlimit <K>Kwhen set.Returns a
TransportResultdescribing the outcome. A process-spawn failure (binary missing) raisesTransportErrorbecause no retry will help – the lab admin needs to install the binary.- Parameters:
- Return type: