fix: storage.cfg parser was stripping indentation before checking line.startswith(' ') — property lines never parsed
This commit is contained in:
parent
dc023c8572
commit
9bab8e95a1
1 changed files with 6 additions and 6 deletions
|
|
@ -104,19 +104,19 @@ def storage_pools():
|
|||
lines = cfg.read_text()
|
||||
current = {}
|
||||
for line in lines.split("\n"):
|
||||
line = line.strip()
|
||||
if not line or line.startswith("#"):
|
||||
stripped = line.strip()
|
||||
if not stripped or stripped.startswith("#"):
|
||||
continue
|
||||
if ":" in line and not line.startswith(" "):
|
||||
if ":" in stripped and not line.startswith(" "):
|
||||
if current and current.get("name"):
|
||||
pools.append(current)
|
||||
parts = line.split(":", 1)
|
||||
parts = stripped.split(":", 1)
|
||||
stype = parts[0].strip()
|
||||
sname = parts[1].strip() if len(parts) > 1 else ""
|
||||
current = {"name": sname, "type": stype}
|
||||
elif line.startswith(" ") and current:
|
||||
if " " in line:
|
||||
key, val = line.strip().split(" ", 1)
|
||||
if " " in stripped:
|
||||
key, val = stripped.split(" ", 1)
|
||||
current[key] = val
|
||||
if current and current.get("name"):
|
||||
pools.append(current)
|
||||
|
|
|
|||
Loading…
Reference in a new issue