Skip to content

writes produces incorrect hcl: omits quotes around in map keys containing / #236

@esciara

Description

@esciara

Using version 7.2.1

The following Python code:

import hcl2

my_hcl = """toto = {
    "john/doh" = {}
} 
"""

tf_vars = hcl2.loads(my_hcl)
hcl2.writes(hcl2.reverse_transform(tf_vars))

Produces:

'toto = {\n  john/doh = {}\n}\n'

hence not keeping the quotes on"john/doh" and generating incorrect hcl.

Metadata

Metadata

Labels

bugSomething isn't workingfixed-in-8.0this issue has been fixed in `transformer-overhaul` feature branch, to be released as v8.0reverse transformationtransformationThe issue is related to logic of transforming Lark AST into Python data structure

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions