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

Remove error on empty outputs when -json is set #11721

Merged
merged 1 commit into from
Jun 20, 2018

Conversation

ljfranklin
Copy link
Contributor

  • Fixes Handling empty set of outputs in automatable way #11696
  • This changes makes terraform output -json return '{}' instead of
    throwing an error about "no outputs defined"
  • If -json is not set, the user will receive an error as before
    • This UX helps new users to understand how outputs are used
  • Allows for easier automation of TF CLI as an empty set of outputs is
    usually acceptable, but any other error from output would be
    re-raised to the user.

- Fixes hashicorp#11696
- This changes makes `terraform output -json` return '{}' instead of
  throwing an error about "no outputs defined"
- If `-json` is not set, the user will receive an error as before
  - This UX helps new users to understand how outputs are used
- Allows for easier automation of TF CLI as an empty set of outputs is
  usually acceptable, but any other error from `output` would be
  re-raised to the user.
@ljfranklin
Copy link
Contributor Author

@paddyforan gentle bump on getting this merged before I completely forget about it :)

@paddycarver
Copy link
Contributor

Hi @ljfranklin! I am, unfortunately, probably the wrong person to look at this issue; we all just help triage them so the right people can find them. The good news is now that it's labeled, when the right people have time, they'll be able to find the issue pretty easily. Sorry for the delays!

@genevieve
Copy link

We ran into this today. Is there anything stopping this from being merged?

genevieve pushed a commit to cloudfoundry/bosh-bootloader that referenced this pull request Nov 15, 2017
- When there are no outputs:  hashicorp/terraform#11721

[#152866137]

Signed-off-by: Genevieve LEsperance <glesperance@pivotal.io>
genevieve pushed a commit to cloudfoundry/bosh-bootloader that referenced this pull request Nov 15, 2017
- When there are no outputs:  hashicorp/terraform#11721

[#152866137]

Signed-off-by: Genevieve LEsperance <glesperance@pivotal.io>
@apparentlymart
Copy link
Contributor

Hi @ljfranklin, and @genevievelesperance!

Sorry that this one apparently fell through the cracks. It looks like a good change so I'll make a note to look at it again once we're out of the 0.11.0 release freeze period. (We keep this active for a few days after the release in case any bug fixes are required.)

@genevieve
Copy link

Awesome! Thank you.

genevieve pushed a commit to cloudfoundry/bosh-bootloader that referenced this pull request Nov 18, 2017
- When there are no outputs:  hashicorp/terraform#11721

[#152866137]

Signed-off-by: Genevieve LEsperance <glesperance@pivotal.io>
@matthewrj
Copy link

Any updates on this? We are having the same issue.

@apparentlymart apparentlymart added cli and removed core labels Jun 20, 2018
@mildwonkey mildwonkey merged commit 26b9073 into hashicorp:master Jun 20, 2018
@mildwonkey
Copy link
Contributor

Hi @ljfranklin and @genevieve ,
I'm very sorry this slipped through the cracks again - I will merge this now and it will be included in the next release. Thank you for submitting this work!

xiaozhu36 pushed a commit to xiaozhu36/terraform that referenced this pull request Aug 9, 2018
- Fixes hashicorp#11696
- This changes makes `terraform output -json` return '{}' instead of
  throwing an error about "no outputs defined"
- If `-json` is not set, the user will receive an error as before
  - This UX helps new users to understand how outputs are used
- Allows for easier automation of TF CLI as an empty set of outputs is
  usually acceptable, but any other error from `output` would be
  re-raised to the user.
xiaozhu36 pushed a commit to xiaozhu36/terraform that referenced this pull request Aug 9, 2018
- Fixes hashicorp#11696
- This changes makes `terraform output -json` return '{}' instead of
  throwing an error about "no outputs defined"
- If `-json` is not set, the user will receive an error as before
  - This UX helps new users to understand how outputs are used
- Allows for easier automation of TF CLI as an empty set of outputs is
  usually acceptable, but any other error from `output` would be
  re-raised to the user.
@ghost
Copy link

ghost commented Apr 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling empty set of outputs in automatable way
6 participants