Skip to content

Properly formatting generated tfvar#395

Merged
mpagot merged 1 commit intoSUSE:mainfrom
mpagot:tfvars_formatted
Oct 14, 2025
Merged

Properly formatting generated tfvar#395
mpagot merged 1 commit intoSUSE:mainfrom
mpagot:tfvars_formatted

Conversation

@mpagot
Copy link
Copy Markdown
Collaborator

@mpagot mpagot commented Oct 9, 2025

The glue script is generating the terraform.tfvars. Problem is that this generated file does not pass the test or terraform fmt (Makefile target static-terraform-fmt). Add a minimal change in the gluescript to generate formatted files.

Verification

sle-15-SP6-Qesap-Gcp-Payg-x86_64-BuildLATEST_GCE_SLE15_6_PAYG-qesap_gcp_angi_test

Copy link
Copy Markdown
Collaborator

@alvarocarvajald alvarocarvajald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Collaborator

@lpalovsky lpalovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Collaborator

@BillAnastasiadis BillAnastasiadis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

However, the UTs are not happy. I see failures like

E AssertionError: assert ['something =...0.0.4.0/24\n'] == ['something =...0/24\n', '\n'] E E Right contains one more item: '\n'

The tests could need to be updated

The glue script is generating the terraform.tfvars. Problem is that this
generated file does not pass the test or terraform fmt (Makefile target
`static-terraform-fmt`). Add a minimal change in the gluescript to
generate formatted files.
@mpagot mpagot force-pushed the tfvars_formatted branch 2 times, most recently from fb2cb36 to afc03f2 Compare October 9, 2025 15:24
data = file.readlines()
assert tfvar_template['data'] == data
with open(tfvar_path, "r", encoding="utf-8") as file:
data = [line for line in file.readlines() if line != "\n"]
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix for the UT

@mpagot mpagot force-pushed the tfvars_formatted branch 2 times, most recently from afc03f2 to bd098fb Compare October 9, 2025 15:33
@mpagot mpagot merged commit 0f68179 into SUSE:main Oct 14, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants