mache.deploy.machine.get_machine

mache.deploy.machine.get_machine(*, requested_machine: str | None, machines_path: str | None = None, quiet: bool = False) str | None[source]

Get the selected machine.

If requested_machine is provided, it must correspond to a machine known to mache and/or the target software. If it is unknown, a ValueError is raised.

If requested_machine is not provided, we attempt to detect the machine using mache.discover.discover_machine(). If detection fails or yields an unknown machine, the returned machine is None.

Parameters:
  • requested_machine – The requested machine name (known to mache and/or the target software) or None to detect the machine.

  • machines_path – Optional path (absolute or relative to repo root) containing machine config files in ini format (e.g. deploy/machines). If None/empty, only mache.machines is used.

  • quiet – If True, suppress warnings.

Returns:

machine – The selected machine name (known to mache and/or the target software) or None.