-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Describe the bug
When attempting to convert a Terraform file into GLITCH's intermediate representation using the --mode repr option, the tool encounters an error: AttributeError: 'Attribute' object has no attribute 'column'
. This error prevents the successful generation of the intermediate representation.
To Reproduce
The command I use: glitch --tech terraform --mode repr /Personal' ' Storage/Project/research/glitch/playground/boolean_value_assign
. Note that I create a playground folder in the glitch project.
Steps to reproduce the behavior:
- Have a Terraform file named boolean_value_assign.tf located at /playground/boolean_value_assign.tf. I get the file from
https://github.com/sr-lab/GLITCH/blob/main/glitch/tests/parser/terraform/files/boolean_value_assign.tf
- Execute the following command in the terminal:
- glitch --tech terraform --mode repr /Personal' 'Storage/Project/research/glitch/playground/boolean_value_assign.tf
- Observe the AttributeError: 'Attribute' object has no attribute 'column' traceback.
Expected behavior
I expected GLITCH to successfully parse the Terraform file and generate its intermediate representation without any errors. The command should complete, and the representation should be outputted (or saved to a file, depending on GLITCH's default behavior for this mode).
Desktop (please complete the following information):
- OS: [Windows 11]
- Python: 3.11
- Download GLITCH with
poetry install
Additional Context
When I test with another terraform file "backend.tf" with the following content the above issue does not occur, but generate an "empty IR".
The content in backend.tf
backend "s3" {
bucket = "s3bucketName" // s3 bucket name created from AWS console
key = "terraform.tfstate" // terraform state file
region = "" // provide s3 bucket region
}
}
The output
(.venv1) PS D:\Personal Storage\Project\research\glitch> glitch --tech terraform --mode repr /Personal' 'Storage/Project/research/glitch/playground/backend.tf
{
"ir_type": "UnitBlock",
"line": -1,
"column": -1,
"code": "",
"statements": [],
"dependencies": [],
"comments": [],
"variables": [],
"atomic_units": [],
"unit_blocks": [],
"attributes": [],
"name": "/Personal Storage/Project/research/glitch/playground/backend.tf",
"path": "/Personal Storage/Project/research/glitch/playground/backend.tf",
"type": "unknown"
}