Go implementation of bridge script #6963

Merged
merged 1 commit into from May 9, 2017

Conversation

Projects
None yet
4 participants
Contributor

frobware commented Feb 10, 2017

Description of change

This is a Go implementation of the Python-based add-juju-bridge script
that I started in my spare some time ago. I have spent some time
tidying it up this week and the test coverage is now approaching
100% (currently 98%).

I have deliberately put this into its own package --
juju/network/debinterfaces -- so that it doesn't clash with any of the
existing bridging machinations.

This parses and handles the existing test cases with the exception of
Andrew's recent PR #6962 to handle multiple iface stanzas against a
physical interface. I guess I (and many people) were not using IPv6
that much given how long the Python logic has been around.

The juju-bridge(1) command is an example of how to drive the Go
implementation and interface. I have historically found it imperative
that you are able to give an end-user the script that Juju uses and
ask them to run it on their hardware which quite often finds new and
interesting ways that bridging fails.

I have focused much of my recent effort on the test cases and the
general logic in the package; It was only this week I created
juju-bridge(1) and as a result that has had limited exposure. Having
said that, the logic it relies on is almost identical to the way
dynamic bridging invocation is done today.

I think the Go logic is much better than the accreted wisdom (and
mess) that is in the Python script. And having "ported" it to Go
there's also a lot of cruft that could be removed from the Python
version should you not want this PR.

Good luck and sorry for the mess that comes with bridging...

Signed-off-by: Andrew McDermott andrew.mcdermott@frobware.com

Go implementation of bridge script
This is a Go implementation of the Python-based add-juju-bridge script
that I started in my spare some time ago. I have spent some time
tidying it up this week and the test coverage is now approaching
100% (currently 98%).

I have deliberately put this into its own package --
juju/network/debinterfaces -- so that it doesn't clash with any of the
existing bridging machinations.

This parses and handles the existing test cases with the exception of
Andrew's recent PR #6962 to handle multiple iface stanzas against a
physical interface. I guess I (and many people) were not using IPv6
that much given how long the Python logic has been around.

The juju-bridge(1) command is an example of how to drive the Go
implementation and interface. I have historically found it imperative
that you are able to give an end-user the script that Juju uses and
ask them to run it on their hardware which quite often finds new and
interesting ways that bridging fails.

I have focused much of my recent effort on the test cases and the
general logic in the package; It was only this week I created
juju-bridge(1) and as a result that has had limited exposure. Having
said that, the logic it relies on is almost identical to the way
dynamic bridging invocation is done today.

I think the Go logic is much better than the accreted wisdom (and
mess) that is in the Python script. And having "ported" it to Go
there's also a lot of cruft that could be removed from the Python
version should you not want this PR.

Good luck and sorry for the mess that comes with bridging...

Signed-off-by: Andrew McDermott <andrew.mcdermott@frobware.com>
Contributor

frobware commented Feb 10, 2017

!!build!!

Owner

jameinel commented Feb 10, 2017

Thanks for finishing this off. It is certainly appreciated. I think we'll hold off on this for 2.1 but look for 2.1.1 or maybe 2.2. I'll definitely be giving it a close look next week.

Contributor

frobware commented Feb 10, 2017

If you want any clarifications, et al, you'll have to ping me on my personal email address. I have just updated my launchpad settings and will probably receive no more @canonical mail.

+}
+
+func (g *globber) Expand(pattern string) ([]string, error) {
+ // The ifupdown package natively used wordexp(3). For the
Member

axw commented Feb 10, 2017

@frobware Thank you for this!

@jujubot jujubot merged commit 56461ed into juju:develop May 9, 2017

1 check failed

github-check-merge-juju Built PR, ran unit tests, and tested LXD deploy. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment