host.factory

The host-dict factory: builds and validates RemoteHost instances from raw lab-data host dicts, resolving os_type against the otto.host.os_profile registry.

Host-dict factory: build and validate RemoteHost instances from raw config dicts.

otto.host.factory.create_host_from_dict(host_data: dict[str, Any], preferences: dict[str, dict[str, Any]] | None = None) RemoteHost

Create the appropriate RemoteHost subclass from a host dict.

os_type selects the profile / class / spec. preferences is the unified {selector: {capability_list | option_table}} table; for each host the factory cascades it by id into capability selections (forwarded to to_host) and option-value defaults (merged per-key, product-wins). With preferences=None the result is identical to a bare host dict.

otto.host.factory.validate_host_dict(host_data: dict[str, Any]) None

Validate a host dict without constructing the host.

os_type must name a registered profile; the profile’s base spec validates the merged dict (extra='forbid', required fields, typed coercion, family-specific field validators for command_frame / filesystem / transfer / docker_capable).

Raises

ValueError

If os_type names no registered profile.

pydantic.ValidationError

On any structural problem (subclass of ValueError).