You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is a bit flaky. It doesn't look directly related with a specific resource (we are using terraform-compliance on a high number of cicd pipelines and this issue is only affecting a few of them)
Example: when generating a plan that applies the whole infrastructure from scratch it doesn't fail, however when the plan includes updates, terraform-compliance fails with the Exception:
| Name | .+ |
AttributeError: 'NoneType' object has no attribute 'get'
Used terraform-compliance Parameters:
I was able to isolate the issue by running radish directly with the parameters terraform-compliance uses. bin/radish --write-steps-once /feature/directory/ --basedir /terraform_compliance/steps --user-data=plan_file=my-plan.tfplan.json --user-data=exit_on_failure=False --user-data=terraform_executable=None --user-data=no_failure=False --user-data=silence_mode_enabled=False --user-data=debugging_mode_enabled=False
Running via Docker:
No
Error Output:
| Name | .+ |
AttributeError: 'NoneType' object has no attribute 'get'
Expected Behavior:
Failed / passed scenarios without Exceptions.
Tested Versions:
terraform-compliance version: 1.3.29
terraform version: 1.0.2
python version: 3.9.7
Additional Context:
From what I was able to debug I have found a potential issue here
)
When resource['values'] is None, the original Exception will be thrown.
I confirm that having a None protection here fixes my problem but I am not certain that having resource['values'] as None at this point means the issue should be fixed somewhere else first.
I'll create a PR and reference the issue.
The text was updated successfully, but these errors were encountered:
Description
To Reproduce
The issue is a bit flaky. It doesn't look directly related with a specific resource (we are using terraform-compliance on a high number of cicd pipelines and this issue is only affecting a few of them)
Example: when generating a plan that applies the whole infrastructure from scratch it doesn't fail, however when the plan includes updates, terraform-compliance fails with the Exception:
Feature File:
https://github.com/joaoubaldo/cli/blob/issue-567-handle-none-resource-values/tests/functional/test_issue-567/test.feature
Plan File:
https://github.com/joaoubaldo/cli/blob/issue-567-handle-none-resource-values/tests/functional/test_issue-567/plan.out.json
Used
terraform-compliance
Parameters:I was able to isolate the issue by running radish directly with the parameters terraform-compliance uses.
bin/radish --write-steps-once /feature/directory/ --basedir /terraform_compliance/steps --user-data=plan_file=my-plan.tfplan.json --user-data=exit_on_failure=False --user-data=terraform_executable=None --user-data=no_failure=False --user-data=silence_mode_enabled=False --user-data=debugging_mode_enabled=False
Running via Docker:
No
Error Output:
Expected Behavior:
Failed / passed scenarios without Exceptions.
Tested Versions:
1.3.29
1.0.2
3.9.7
Additional Context:
From what I was able to debug I have found a potential issue here
cli/terraform_compliance/common/helper.py
Line 507 in 811d178
When
resource['values']
isNone
, the original Exception will be thrown.I confirm that having a None protection here fixes my problem but I am not certain that having
resource['values']
asNone
at this point means the issue should be fixed somewhere else first.I'll create a PR and reference the issue.
The text was updated successfully, but these errors were encountered: