terragrunt graph adds header, invalidates dot format

Created on 30 Aug 2016  路  4Comments  路  Source: gruntwork-io/terragrunt

Just a cosmetics thing, if you run terragrunt graph | dot -Tpng > mygraph.png
you will get an error like so Error: <stdin>: syntax error in line 1 near '[' because terragrunt adds the two lines [terragrunt] 2016/08/30 11:41:34 Remote state is already configured for backend s3 [terragrunt] 2016/08/30 11:41:34 Running command: terraform graph

It's easy to just run terraform graph instead, but I wanted to give a heads up

enhancement help wanted

Most helpful comment

One solution would be to log to stderr instead of stdout. This would ensure "transparent" wrapping around terraform.

As a personal preference, I would also opt for being quiet by default.

All 4 comments

Ah, good point. I suppose there are two options: either a) add a --silent flag that suppresses terragrunt logging or b) detect if we're being piped into another process, at least for certain commands like graph, and automatically suppress logging in those cases.

I was thinking of just disable logging if the command was graph, but maybe figuring out if we are piping the command is the nicer way to solve it.

A flag like --silent would be confusing I think, as it isn't clear if we silence terragrunt only or if it is a flag passed to terraform.

One solution would be to log to stderr instead of stdout. This would ensure "transparent" wrapping around terraform.

As a personal preference, I would also opt for being quiet by default.

This should be fixed by #94.

Was this page helpful?
0 / 5 - 0 ratings