Platform requirements¶
Import the checks from rmote.requires. A tool that reads a kernel interface
of Linux, or runs the program of one distribution, calls one of them before it
touches that interface. The refusal is NotImplementedError, and its message
names the operation, what it needs and what the host is:
Sysctl.get needs the /proc/sys interface of Linux, and this host runs Darwin
Service needs the systemctl program of systemd, and this host has none
AptRepository.absent needs /etc/apt of Debian and Ubuntu, and this host has none
The reason has to be in the message, because the failure travels through RPC and the caller sees the exception and nothing else. A missing file or a missing program on its own reads like a damaged host instead of the wrong one. See Built-in Tools for what each built-in tool needs.
A tool of your own uses the same checks. The module transfers on demand, like every other module a tool imports.
- rmote.requires.needs_linux(operation, source)[source]¶
Refuse operation unless this target is Linux.
- Parameters:
- Raises:
NotImplementedError – The target runs another system.
- Return type:
- rmote.requires.needs_program(operation, name, provider)[source]¶
Refuse operation unless the program name is on the PATH.
- Parameters:
- Raises:
NotImplementedError – The program is absent, so the operation has no way to run on this host.
- Return type:
- rmote.requires.needs_file(operation, path, provider)[source]¶
Refuse operation unless the configuration of provider is present.
- Parameters:
- Raises:
NotImplementedError – The configuration is absent, so this host does not have the system the operation configures.
- Return type: