Skip to content

Stop creating groups for tfstate attribute counts#47

Merged
adammck merged 2 commits intoadammck:masterfrom
Jonnymcc:group-counts
Jun 9, 2017
Merged

Stop creating groups for tfstate attribute counts#47
adammck merged 2 commits intoadammck:masterfrom
Jonnymcc:group-counts

Conversation

@Jonnymcc
Copy link
Contributor

terraform-inventory currently creates groups like the following...

{"%_5":["10.95.12.224"],"%_6":["53.81.162.94"], ...

This ensures these groups do not get created.

@adammck
Copy link
Owner

adammck commented Feb 6, 2017

This looks good, but would you mind adding a couple of examples to the fixture in parser_test.go?

resource.go Outdated
for k, v := range r.Attributes() {
parts := strings.SplitN(k, ".", 2)
if len(parts) == 2 && parts[0] == "tags" && parts[1] != "#" {
if len(parts) == 2 && parts[0] == "tags" && !tf_count.MatchString(parts[1]) {
Copy link
Owner

Choose a reason for hiding this comment

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

I think parts[1] != "#" && parts[1] != "%" would be clearer, here. Could we also get a comment reminding us why we might encounter either symbol? I'm assuming it's a change between Terraform versions.

Jonathan McCall added 2 commits June 9, 2017 14:01
@adammck adammck merged commit 6f4c1a9 into adammck:master Jun 9, 2017
@adammck
Copy link
Owner

adammck commented Jun 9, 2017

Thanks!

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