-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Using python for the configuration file is powerfull but require duplication - for example, here we duplicate the value of BASE_DIR and the name of the backend:
BASE_DIR = "/path/to/base-dir"
BACKENDS = {
"block-4k": LoopDevice(
base_dir=BASE_DIR,
name="block-4k",
size=GiB,
sector_size=4096,
),
...
}
Add option to configure using yaml:
base_dir: /path/to/base-dir
backends:
block-4k:
backend: "loop",
size: 1073741824
sector_size: 4096
...And json:
{
"base_dir": "/path/to/base-dir",
"backends": {
"block-4k": {
"backend": "loop",
"size": 1073741824,
"sector_size": 4096
}
}
}Internally both formats return the same python dict, so supporting both cost nothing. yaml is shorter, easier to write and can include comments.
Not sure how stacked backeends should be described in yaml/json:
file-4k:
backend: file
mount:
backend: mount
backend: loop
size: 1073741824
sector_size: 4096
...This should translate to:
{
"file-4k": File(
Mount(
LoopDevice(
base_dir=BASE_DIR,
name="file-4k",
size=1073741824,
sector_size=5096,
),
),
),
}Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed