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

Return value of VSwitch.ListBridges() #53

Closed
hwchiu opened this issue Jun 2, 2018 · 3 comments
Closed

Return value of VSwitch.ListBridges() #53

hwchiu opened this issue Jun 2, 2018 · 3 comments

Comments

@hwchiu
Copy link
Contributor

hwchiu commented Jun 2, 2018

Hi all.

If there're not any OpenvSwitch in the system but the length of the return value of VSwitch.ListBridges() is 1 not zero.

I think that is caused by the strings.Split and you can find it below.

func (v *VSwitchService) ListBridges() ([]string, error) {
output, err := v.exec("list-br")
if err != nil {
return nil, err
}
bridges := strings.Split(strings.TrimSpace(string(output)), "\n")
return bridges, err
}

Do we need to fix it by return a empty string array if the output of list-br is empty string?

Thanks.

@mdlayher
Copy link
Contributor

mdlayher commented Jun 2, 2018

Yep, that makes sense to me!

@chenyunchen
Copy link
Contributor

chenyunchen commented Jun 2, 2018

Same here. Fix this #54 to return the empty array. :)

@hwchiu
Copy link
Contributor Author

hwchiu commented Jun 6, 2018

Has fixed, thanks

@hwchiu hwchiu closed this as completed Jun 6, 2018
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

No branches or pull requests

3 participants