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

allow for non-string outputs #45

Merged
merged 1 commit into from
Sep 7, 2016
Merged

Conversation

jonasi
Copy link
Contributor

@jonasi jonasi commented Sep 6, 2016

not sure if this is new in 0.7, but non-string outputs are allowed. Without this fix, I get

panic: interface conversion: interface is []interface {}, not string

goroutine 1 [running]:
panic(0x1020e0, 0xc420498e00)
        /Users/isao/.gimme/versions/go1.7.darwin.amd64/src/runtime/panic.go:500 +0x1a1
main.(*state).outputs(0xc4200722c0, 0xc420357bc0, 0xc4202cdd00, 0xc4202cdd50)
        /Users/isao/dev/src/github.com/adammck/terraform-inventory/parser.go:41 +0x3b0
main.gatherResources(0xc4200722c0, 0xc4a44)
        /Users/isao/dev/src/github.com/adammck/terraform-inventory/cli.go:23 +0x3a3
main.cmdList(0x19f4c0, 0xc420098008, 0x19f4c0, 0xc420098010, 0xc4200722c0, 0x0)
        /Users/isao/dev/src/github.com/adammck/terraform-inventory/cli.go:33 +0x2b
main.main()
        /Users/isao/dev/src/github.com/adammck/terraform-inventory/main.go:63 +0x4e4

@adammck
Copy link
Owner

adammck commented Sep 7, 2016

Thank you, @jonasi! I've been meaning to fix this for a while. Would you mind adding a few examples to this test, so we can be sure not to re-break this in future?

@jonasi jonasi force-pushed the non-string-outputs branch from 6825310 to 3e29ab9 Compare September 7, 2016 02:37
@jonasi jonasi force-pushed the non-string-outputs branch from 3e29ab9 to 22069a5 Compare September 7, 2016 02:39
@jonasi
Copy link
Contributor Author

jonasi commented Sep 7, 2016

@adammck updated with a list and map example

@adammck
Copy link
Owner

adammck commented Sep 7, 2016

Wonderful, thank you! I don't know that the output format will actually be useful to Ansible (do you?), but this solves the crash nicely. Thanks for the patch!

@adammck adammck merged commit e62801b into adammck:master Sep 7, 2016
@jonasi jonasi deleted the non-string-outputs branch September 7, 2016 03:17
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.

2 participants