module

Krikri::PythonLiteral

Best-effort ast.literal_eval for Python-literal text that JSON cannot parse: rewrites Python's single-quoted strings and True/False/None into their JSON spellings and hands the result to the JSON parser. Returns nil when that fails, which lands the caller on check_type_dict's own failure - the same shapes literal_eval itself rejects (bare names, tuples, sets, trailing junk) fail the rewrite or the JSON parse, so a caller only ever accepts what real Ansible's check_type_dict would accept as a dict. Mirrors the approach InventoryParser already uses for inventory-sourced literals.

Class methods

dict_json(value : String) : JSON::Any | Nil
Source