migrate_yaml

Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.

migrate_yaml(config_path: str | Path, output_path: str | Path | None = None, *, dry_run: bool = False, workflow: str | None = None) → MigrationReport[source]

Migrate one v0 YAML config into the v1 document layout.

Parameters:
  • config_path – Source v0 YAML file.

  • output_path – Destination v1 file; defaults to <name>.v1.yaml next to the source.

  • dry_run – When True, compute the diff without writing anything.

  • workflow – Workflow alias; guessed from the path when omitted.

Returns:

The migration report with the translated document, unified diff and warnings.

Raises:

HABITAPIError – When the file is already v1, the workflow cannot be determined, or translation fails.