Compare commits

..

No commits in common. "main" and "v0.3" have entirely different histories.
main ... v0.3

2 changed files with 8 additions and 8 deletions

View File

@ -13,12 +13,12 @@ def get_pillar_name_sequence(name: str) -> list[str]:
def decode_pillar_value(pillar: Pillar) -> str | int | float | bool | list | dict:
match pillar.parameter_type:
case 'string': return str(json.loads(pillar.value))
case 'integer': return int(json.loads(pillar.value))
case 'float': return float(json.loads(pillar.value))
case 'boolean': return bool(json.loads(pillar.value))
case 'list': return list(json.loads(pillar.value))
case 'dict': return dict(json.loads(pillar.value))
case 'string': return str(pillar.value)
case 'integer': return int(pillar.value)
case 'float': return float(pillar.value)
case 'boolean': return bool(pillar.value)
case 'array': return json.loads(pillar.value)
case 'dict': return json.loads(pillar.value)
raise RuntimeError(f"Failed to decode pillar value: Invalid type '{pillar.parameter_type}'")
@ -43,6 +43,6 @@ def get_pillar_for_target(db: Session, target: UUID) -> dict:
current[label] = {}
current = current[label]
else:
current[label] = value
current[label] = json.loads(str(value))
return out

View File

@ -1,6 +1,6 @@
[project]
name = "pillartool"
version = "0.6.0"
version = "0.1.0"
description = "Add your description here"
requires-python = ">=3.13"
dependencies = [