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

Metricbeat - Vsphere module - Fix Error collecting network_names #5962

Merged
merged 1 commit into from
Jan 9, 2018
Merged

Metricbeat - Vsphere module - Fix Error collecting network_names #5962

merged 1 commit into from
Jan 9, 2018

Conversation

amandahla
Copy link
Contributor

@amandahla amandahla commented Dec 27, 2017

The messages occurs because virtualmachine have "distributed port group" instead of "network". It was already fixed in "host" and now it was made the same in "virtualmachine".

Closes #5961

@elasticmachine
Copy link
Collaborator

Can one of the admins verify this patch?

@@ -215,8 +215,20 @@ func getNetworkNames(c *vim25.Client, ref types.ManagedObjectReference) ([]strin
return nil, errors.Wrap(err, "no networks found")
}

networksRefs := []types.ManagedObjectReference{}
Copy link
Member

Choose a reason for hiding this comment

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

Use var networkRefs types.ManagedObjectReferenc instead. https://github.com/golang/go/wiki/CodeReviewComments#declaring-empty-slices

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed, thanks for the link!


// If only "Distributed port group" was found, for example.
if len(networksRefs) == 0 {
return nil, errors.Wrap(err, "no networks found")
Copy link
Member

@andrewkroh andrewkroh Dec 27, 2017

Choose a reason for hiding this comment

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

I think you want errors.New instead of errors.Wrap because err == nil here. Same thing with the earlier errors.Wrap usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed!

@ruflin ruflin changed the title Fix #5961 Metricbeat - Vsphere module - Fix Error collecting network_names Dec 28, 2017
@ruflin
Copy link
Member

ruflin commented Dec 28, 2017

Could you add a changelog? I adjusted the title of the PR a bit.

@ruflin
Copy link
Member

ruflin commented Dec 29, 2017

jenkins, test it

@ruflin
Copy link
Member

ruflin commented Jan 4, 2018

@amandahla Could you rebase this PR on master?

@amandahla
Copy link
Contributor Author

@ruflin Sure! Done :)

@ruflin
Copy link
Member

ruflin commented Jan 5, 2018

@amandahla Just wanted to merge this but there is now a conflict in the CHANGELOG :-( Sorry. Can you rebase again?

@amandahla
Copy link
Contributor Author

No problem! :)

@ruflin
Copy link
Member

ruflin commented Jan 9, 2018

jenkins, test it

@ruflin ruflin merged commit d67ed64 into elastic:master Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Metricbeat - Vsphere module - Error collecting network_names
4 participants