Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Special characters returned by cmd.run state #66535

Closed
AGirin opened this issue May 16, 2024 · 1 comment
Closed

[BUG] Special characters returned by cmd.run state #66535

AGirin opened this issue May 16, 2024 · 1 comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@AGirin
Copy link

AGirin commented May 16, 2024

Description
Running terraform commands from salt state. Getting output similar to this:

?[0m?[1mdata.aws_iam_policy_document.assume-from-iam-account: Reading...?[0m?[0m
                  ?[0m?[1mdata.aws_caller_identity.current: Reading...?[0m?[0m
                  ?[0m?[1mdata.aws_iam_policy_document.assume-from-iam-account: Read complete after 0s [id=3203618795]?[0m
                  ?[0m?[1mdata.aws_caller_identity.current: Read complete after 0s [id=xxxxxxxxxx]?[0m

                  Terraform used the selected providers to generate the following execution
                  plan. Resource actions are indicated with the following symbols:
                    ?[32m+?[0m create?[0m

                  Terraform will perform the following actions:

                  ?[1m  # aws_iam_role.this?[0m will be created
                  ?[0m  ?[32m+?[0m?[0m resource "aws_iam_role" "this" {
                        ?[32m+?[0m?[0m arn                   = (known after apply)
                        ?[32m+?[0m?[0m assume_role_policy    = jsonencode(...

Is it possible to change output to stop showing those ?[32m+?[0m?[0m special characters?

I can run the same command from the cli with --out=newline_values_only and it shows output without special characters.

Thanks,

Andrew

@AGirin AGirin added Bug broken, incorrect, or confusing behavior needs-triage labels May 16, 2024
@AGirin
Copy link
Author

AGirin commented May 22, 2024

Answered my own question. Add -no-color to terraform command...

@AGirin AGirin closed this as completed May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant