Introduce TOML-based configuration to replace data.py#491
Draft
glehmann wants to merge 4 commits into
Draft
Conversation
This was referenced Apr 21, 2026
| "type": "object", | ||
| "properties": { | ||
| "path": { "type": "string" }, | ||
| "net-url": { "type": "string" }, |
Contributor
There was a problem hiding this comment.
Maybe you should choose a convention "snake_case" or "kebab-case", what do you think?
ee666c4 to
ed2606e
Compare
789db8a to
ff81a81
Compare
ed2606e to
8c9e4e8
Compare
ff81a81 to
4b18836
Compare
8c9e4e8 to
1271dc5
Compare
4b18836 to
78b593a
Compare
1271dc5 to
5edbb05
Compare
The previous data.py approach had several shortcomings: - No base configuration: users had to start from scratch or copy data.py-dist - No environment management: working with multiple infra required to manually copy the data.py files - No clear default and customization separation: the data.py, once copied from data.py-dist and customized, was mixing the defaults and the customizations The new TOML config system addresses this by: - Providing a base config.toml maintained by the project with sensible defaults, which can be updated without user action - Supporting per-environment override files (config.<name>.toml) so users only specify what differs from the defaults, making their customizations explicit Options have been grouped by sections for clarity. Configuration sections and their contents: - [host]: default XAPI credentials (user, password) - [hosts]: per-host credential overrides - [network]: management network name - [pxe]: PXE server settings (arp_server) - [vm]: VM settings (default_sr, images, equivalents, def_url) - [install]: installer settings (answerfiles, iso_remaster, isos) - [guest_tools]: guest tools packages and installer ISOs (win, other, installed, download_url) - [ssh]: SSH client settings (pubkey, output_max_lines, ignore_banner) - [storage]: storage backend configs (nfs, nfs4, nfs_iso, cifs_iso, cephfs, moosefs, lvmoiscsi) - Root keys: objects_name_prefix, dns_server Also includes config-schema.json, lib/config_loader.py (Pydantic models), and scripts/migrate_data_py.py to help users migrate from data.py. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
To make easier editing within our editors. This format is compatible with multiple toml lsp, including taplo. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Configuration is now done in config.toml and config.*.toml Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
5edbb05 to
7884b4e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous data.py approach had several shortcomings:
copy the data.py files
from data.py-dist and customized, was mixing the defaults and the
customizations
The new TOML config system addresses this by:
which can be updated without user action
specify what differs from the defaults, making their customizations explicit
Options have been grouped by sections for clarity.
Configuration sections and their contents:
Also includes config-schema.json, lib/config_loader.py (Pydantic models),
and scripts/migrate_data_py.py to help users migrate from data.py.
This PR is part of a tree containing 3 PRs:
mastermaster